/**
 * 小票打印系统样式文件
 */

/* 全局样式 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.footer {
    margin-top: auto;
}

/* 小票预览样式 */
.receipt-preview {
    font-family: 'Microsoft YaHei', '微软雅黑', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

/* 菜品输入表单 */
.dish-input-form {
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
}

/* 菜品列表项 */
.dish-item {
    transition: background-color 0.3s;
}

.dish-item:hover {
    background-color: #f1f1f1;
}

/* 打印按钮 */
.print-btn {
    font-size: 1.2rem;
}

/* 管理员页面表格 */
.table-responsive {
    overflow-x: auto;
}

/* 登录和注册卡片 */
.card {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: none;
}

/* 小票管理页面行背景色 */
.receipt-row-light {
    background-color: #f8f9fa !important;
}

.receipt-row-dark {
    background-color: #e9ecef !important;
}

/* 菜品管理页面表格列宽设置 */
#dishes-table th:nth-child(1),
#dishes-table td:nth-child(1),
#search-dishes-table th:nth-child(1),
#search-dishes-table td:nth-child(1) {
    width: 50%;
    min-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 菜品名称列 - 加大宽度 */
#dishes-table th:nth-child(1),
#dishes-table td:nth-child(1),
#search-dishes-table th:nth-child(1),
#search-dishes-table td:nth-child(1) {
    width: 50%;
    min-width: 200px;
}

/* 单价列 - 向右适量移动 */
#dishes-table th:nth-child(2),
#dishes-table td:nth-child(2),
#search-dishes-table th:nth-child(2),
#search-dishes-table td:nth-child(2) {
    width: 25%;
    min-width: 100px;
    text-align: right;
    padding-right: 20px;
}

/* 操作列 - 向右移动与边框对齐 */
#dishes-table th:nth-child(3),
#dishes-table td:nth-child(3),
#search-dishes-table th:nth-child(3),
#search-dishes-table td:nth-child(3) {
    width: 25%;
    min-width: 140px;
    text-align: right;
    padding-right: 15px;
}

/* 响应式调整 */
/* 统一按钮尺寸 */
.btn {
    min-width: 120px;
    min-height: 40px;
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 确保flex-fill按钮大小一致 */
.btn.flex-fill {
    flex: 1;
    min-width: 0;
}

/* 小尺寸按钮 */
.btn-sm {
    min-width: 80px;
    min-height: 32px;
    padding: 6px 12px;
    font-size: 12px;
}

/* 特殊情况：表格内的按钮组 */
.btn-group-sm > .btn {
    min-width: 60px;
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
}

/* 关闭按钮保持原样 */
.btn-close {
    min-width: auto;
    min-height: auto;
    padding: 0;
}

/* 清除输入按钮保持原样 */
.clear-input-btn {
    min-width: auto;
    min-height: auto;
    padding: 0;
}

/* 桌面端隐藏移动端卡片容器 */
#mobile-dishes-container,
#mobile-search-dishes-container {
    display: none;
}

@media (max-width: 768px) {
    .receipt-preview {
        font-size: 0.8rem;
    }
    
    /* 移动端按钮稍小一些 */
    .btn {
        min-width: 100px;
        min-height: 36px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .btn-sm {
        min-width: 70px;
        min-height: 30px;
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .btn-group-sm > .btn {
        min-width: 50px;
        min-height: 26px;
        padding: 3px 6px;
        font-size: 10px;
    }
    
    /* 菜品管理页面移动端优化 */
    /* 隐藏桌面版表格，显示移动端卡片 */
    #dishes-table,
    #search-dishes-table {
        display: none;
    }
    
    /* 显示移动端卡片容器 */
    #mobile-dishes-container,
    #mobile-search-dishes-container {
        display: block !important;
    }
    
    /* 移动端卡片样式 */
    .mobile-dish-card {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 15px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .mobile-dish-card .dish-name {
        font-weight: 600;
        font-size: 16px;
        color: #333;
        margin-bottom: 8px;
        word-break: break-all;
    }
    
    .mobile-dish-card .dish-price {
        font-size: 18px;
        color: #007bff;
        font-weight: 600;
        margin-bottom: 12px;
    }
    
    .mobile-dish-card .dish-actions {
        display: flex;
        gap: 8px;
    }
    
    .mobile-dish-card .dish-actions .btn {
        flex: 1;
        min-width: auto;
        font-size: 12px;
        padding: 6px 8px;
    }
    
    /* 表单优化 */
    .col-md-8,
    .col-md-4 {
        margin-bottom: 15px;
    }
    
    /* 导航标签优化 */
    .nav-tabs .nav-link {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    /* 分页信息优化 */
    #pagination-container,
    #search-pagination-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .pagination-info {
        font-size: 12px;
        order: 2;
    }
    
    .pagination {
        justify-content: center;
        order: 1;
    }
    
    /* 搜索表单优化 */
    .col-md-8 input[type="text"] {
        margin-bottom: 10px;
    }
    
    .col-md-4.align-self-end {
        align-self: stretch !important;
    }
    
    /* 文件上传区域优化 */
    .form-text {
        font-size: 11px;
        line-height: 1.3;
        margin-bottom: 5px;
    }
    
    /* 卡片头部优化 */
    .card-header h5 {
        font-size: 16px;
    }
    
    /* 返回按钮优化 */
    .d-grid .btn {
        padding: 12px;
        font-size: 14px;
    }
}