/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-indicator {
    font-size: 12px;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    color: #4caf50;
}

.status-indicator.disconnected {
    color: #f44336;
}

.status-indicator.connecting {
    color: #ff9800;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding: 10px 0;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.7);
    color: #333;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

/* Content Areas */
.tab-content {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-header h2 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.controls select,
.controls input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    min-width: 150px;
}

.controls select:focus,
.controls input:focus {
    border-color: #667eea;
}

.btn-refresh {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    color: #d32f2f;
}

.error-message h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.error-message button {
    margin-top: 20px;
    padding: 12px 24px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.error-message button:hover {
    background: #d32f2f;
}

/* Grid Container for Menu Items */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* Menu Item Card Styles */
.menu-item-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
}

.menu-item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.menu-item-card.special {
    border-color: #ff9800;
}

.item-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.menu-item-card:hover .item-image img {
    transform: scale(1.05);
}

.special-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.item-info {
    padding: 20px;
}

.item-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
}

.current-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2e7d32;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.status.active {
    background: #e8f5e8;
    color: #2e7d32;
}

.status.inactive {
    background: #ffebee;
    color: #d32f2f;
}

/* Orders Container */
.orders-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.order-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.order-status.status-hoàn-thành {
    background: #e8f5e8;
    color: #2e7d32;
}

.order-status.status-đang-giao-hàng {
    background: #fff3e0;
    color: #f57c00;
}

.order-status.status-chưa-thanh-toán {
    background: #ffebee;
    color: #d32f2f;
}

/* Promotions Container */
.promotions-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.promotion-card {
    background: white;
    color: #333;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 2px solid #ff9800;
}

.promotion-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.05) 0%, transparent 70%);
}

/* Promotion Card Content Styles */
.promo-info {
    position: relative;
    z-index: 1;
}

.promo-info h3 {
    color: #333;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.promo-description {
    color: #555;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.promo-details {
    margin-bottom: 16px;
}

.promo-details p {
    color: #333;
    font-size: 0.95rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.promo-details strong {
    color: #222;
    font-weight: 600;
}

.promo-status .status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.promo-status .status.active {
    background: #e8f5e8;
    color: #2e7d32;
}

.promo-status .status.inactive {
    background: #ffebee;
    color: #d32f2f;
}

/* Promotion Card Hover Effects */
.promotion-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: #f57c00;
}

.promotion-card:hover::before {
    background: radial-gradient(circle, rgba(255, 152, 0, 0.1) 0%, transparent 70%);
}

/* Statistics Footer */
.stats-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav-tabs {
        justify-content: flex-start;
    }
    
    .tab-btn {
        min-width: 100px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .stats-footer {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .order-details {
        grid-template-columns: 1fr;
    }
    
    .promotions-container {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-success { color: #4caf50; }
.text-warning { color: #ff9800; }
.text-danger { color: #f44336; }
.text-primary { color: #667eea; }

.bg-success { background-color: rgba(76, 175, 80, 0.1); }
.bg-warning { background-color: rgba(255, 152, 0, 0.1); }
.bg-danger { background-color: rgba(244, 67, 54, 0.1); }
.bg-primary { background-color: rgba(102, 126, 234, 0.1); }

.hidden { display: none !important; }
.visible { display: block !important; }
