/**
 * HumaRestaurant 双语餐饮管理系统
 * 主样式文件
 * 
 * @author HumaTeam
 * @version 2.0
 */

/* 基础样式 */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
}

/* RTL支持 */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .me-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

body.rtl .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

body.rtl .text-start {
    text-align: right !important;
}

body.rtl .text-end {
    text-align: left !important;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

/* 导航栏 */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
}

/* 语言切换按钮 */
.lang-switcher .btn {
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 0.85rem;
}

.lang-switcher .btn.active {
    background-color: white;
    color: #333;
}

/* 菜品卡片 */
.dish-card {
    cursor: pointer;
    transition: all 0.3s;
}

.dish-card:hover {
    transform: scale(1.02);
}

.dish-card .dish-image {
    height: 150px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.dish-card .dish-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.dish-card .dish-price {
    color: var(--danger-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.dish-card .dish-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* 分类标签 */
.category-tab {
    border-radius: 20px;
    padding: 8px 20px;
    margin: 5px;
    border: 1px solid #dee2e6;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.category-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
}

/* 桌台状态 */
.table-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.table-status.available { background-color: var(--success-color); }
.table-status.occupied { background-color: var(--danger-color); }
.table-status.reserved { background-color: var(--warning-color); }
.table-status.cleaning { background-color: var(--info-color); }

/* 购物车 */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: right 0.3s;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.show {
    right: 0;
}

body.rtl .cart-sidebar {
    right: auto;
    left: -350px;
}

body.rtl .cart-sidebar.show {
    left: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.cart-overlay.show {
    display: block;
}

/* 购物车项目 */
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.cart-item .item-info {
    flex: 1;
}

.cart-item .item-name {
    font-weight: 600;
}

.cart-item .item-price {
    color: var(--danger-color);
}

.cart-item .quantity-control {
    display: flex;
    align-items: center;
}

.cart-item .quantity-control button {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.cart-item .quantity-control input {
    width: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
}

/* 订单状态标签 */
.order-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.order-status.pending { background: #fef3c7; color: #d97706; }
.order-status.paid { background: #dbeafe; color: #2563eb; }
.order-status.cooking { background: #e0e7ff; color: #4f46e5; }
.order-status.completed { background: #d1fae5; color: #059669; }
.order-status.cancelled { background: #f3f4f6; color: #6b7280; }
.order-status.refunded { background: #fee2e2; color: #dc2626; }

/* 表格响应式 */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    body.rtl .cart-sidebar {
        left: -100%;
    }
}

/* 统计卡片动画 */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    pointer-events: none;
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 加载动画 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 分页样式 */
.pagination {
    margin: 20px 0;
}

.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 通知框 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

body.rtl .notification {
    right: auto;
    left: 20px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 弹窗遮罩 */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* 快捷操作 */
.quick-action {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action:hover {
    transform: scale(1.1);
}

/* 搜索框 */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
    border-radius: 25px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

body.rtl .search-box input {
    padding-left: 15px;
    padding-right: 40px;
}

body.rtl .search-box i {
    left: auto;
    right: 15px;
}

/* 表格样式增强 */
.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* 徽章样式 */
.badge-soft-primary {
    background-color: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.badge-soft-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-soft-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* 进度条 */
.progress-thin {
    height: 6px;
}

/* 头像 */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 60px; height: 60px; }
.avatar-xl { width: 80px; height: 80px; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 10px;
}
