/**
 * Admin CMS Styles
 * Restaurant Menu Management System
 */

/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #a5b4fc;
    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    
    --sidebar-width: 280px;
    --header-height: 60px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-gray-100);
    color: var(--color-gray-800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   Admin Layout
   ============================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-header .logo {
    font-size: 1.75rem;
}

.sidebar-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.nav-section-title {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-gray-500);
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--color-gray-400);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--accent-color, var(--color-primary));
    color: white;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.nav-icon {
    font-size: 1.1rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    font-size: 1.25rem;
}

.user-name {
    font-size: 0.9rem;
    color: var(--color-gray-400);
}

.logout-btn {
    color: var(--color-gray-500);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-error);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    max-width: calc(100vw - var(--sidebar-width));
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ============================================
   Content Header
   ============================================ */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.week-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.week-badge.current {
    background: #dbeafe;
    color: #1e40af;
}

.week-badge.future {
    background: #f3e8ff;
    color: #6b21a8;
}

.week-badge.past {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

.menu-status {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-draft {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

.status-published {
    background: #d1fae5;
    color: #065f46;
}

/* ============================================
   Week Navigation
   ============================================ */
.week-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.week-nav-btn {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.week-nav-btn:hover {
    background: var(--color-gray-100);
}

.week-display h3 {
    font-size: 1.1rem;
    color: var(--color-gray-700);
}

/* ============================================
   Week Grid (Vertical List)
   ============================================ */
.week-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   Day Card (Vertical Layout)
   ============================================ */
.day-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.day-card:hover {
    box-shadow: var(--shadow);
}

.day-card.today {
    border: 2px solid var(--color-primary);
}

.day-card.weekend {
    background: var(--color-gray-50);
}

.day-card.closed .day-menu-section {
    display: none;
}

.day-header {
    padding: 1rem 1.25rem;
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.day-title h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-gray-800);
    min-width: 80px;
}

.day-date {
    font-size: 0.85rem;
    color: var(--color-gray-500);
}

.today-badge {
    background: var(--color-primary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Closed Toggle */
.closed-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--color-gray-600);
}

.closed-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-error);
}

.toggle-label {
    user-select: none;
}

/* Closed Section */
.day-closed-section {
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.day-closed-section::before {
    content: '🔒';
    font-size: 1.25rem;
}

.closed-note-input {
    flex: 1;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
}

.closed-note-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Menu Section */
.day-menu-section {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-section {
    background: var(--color-gray-50);
    border-radius: var(--border-radius-sm);
    padding: 1rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-gray-100);
}

.category-header h5 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-600);
    font-weight: 600;
}

.add-dish-btn {
    background: none;
    border: 1px dashed var(--color-gray-300);
    color: var(--color-gray-500);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.add-dish-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.05);
}

/* Dish Items */
.dishes-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dish-item {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.dish-name-input {
    flex: 1;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    transition: var(--transition);
}

.dish-name-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.dish-price-input {
    width: 70px;
    padding: 0.5rem 0.4rem;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    text-align: right;
    font-family: inherit;
    transition: var(--transition);
}

.dish-price-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Dietary Tag Checkboxes */
.dish-tag-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.dish-tag-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.tag-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    background: var(--color-gray-100);
    border: 2px solid var(--color-gray-200);
    transition: var(--transition);
    opacity: 0.5;
    filter: grayscale(1);
}

.dish-tag-checkbox:hover .tag-icon {
    border-color: var(--color-gray-300);
    opacity: 0.7;
}

.dish-tag-checkbox input:checked + .tag-icon {
    opacity: 1;
    filter: grayscale(0);
}

.dish-tag-checkbox input:checked + .tag-icon.tag-gluten {
    background: #fef3c7;
    border-color: #f59e0b;
}

.dish-tag-checkbox input:checked + .tag-icon.tag-veg {
    background: #d1fae5;
    border-color: #10b981;
}

.remove-dish-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: var(--color-gray-100);
    color: var(--color-gray-400);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-dish-btn:hover {
    background: #fecaca;
    color: var(--color-error);
}

/* ============================================
   Action Bar
   ============================================ */
.action-bar {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    bottom: 1rem;
    z-index: 50;
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.last-modified {
    font-size: 0.85rem;
    color: var(--color-gray-500);
}

.action-bar-right {
    display: flex;
    gap: 0.75rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: var(--color-success-dark);
}

.btn-secondary {
    background: var(--color-gray-200);
    color: var(--color-gray-700);
}

.btn-secondary:hover {
    background: var(--color-gray-300);
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .week-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .action-bar {
        flex-direction: column;
        gap: 1rem;
        position: static;
    }
    
    .action-bar-right {
        width: 100%;
        flex-direction: column;
    }
    
    .action-bar-right .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Dish item responsive layout */
    .dish-item {
        flex-wrap: wrap;
    }
    
    .dish-name-input {
        flex: 1 1 100%;
        min-width: 0;
        order: 1;
    }
    
    .dish-price-input {
        width: 70px;
        flex-shrink: 0;
        order: 2;
    }
    
    .dish-tag-checkbox {
        order: 3;
    }
    
    .remove-dish-btn {
        order: 4;
        flex-shrink: 0;
    }
}

/* ============================================
   Utilities
   ============================================ */
.no-items {
    color: var(--color-gray-400);
    font-size: 0.85rem;
    font-style: italic;
    padding: 0.5rem 0;
}

/* Number input - hide arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

