:root {
    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --card-border: #dee2e6;
    --card-shadow: rgba(0, 0, 0, 0.05);
    --btn-primary-bg: #007bff;
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #6c757d;
    --btn-secondary-text: #ffffff;
    --timeline-marker-bg: #007bff;
    --timeline-line-bg: #e9ecef;
    --modal-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --input-text: #212529;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #404040;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --card-border: #404040;
    --card-shadow: rgba(0, 0, 0, 0.2);
    --btn-primary-bg: #0d6efd;
    --btn-primary-text: #ffffff;
    --btn-secondary-bg: #6c757d;
    --btn-secondary-text: #ffffff;
    --timeline-marker-bg: #0d6efd;
    --timeline-line-bg: #404040;
    --modal-bg: #2d2d2d;
    --input-bg: #404040;
    --input-border: #505050;
    --input-text: #ffffff;
}

/* Apply theme variables */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.card {
    background-color: var(--card-bg);
    border-color: var(--card-border);
    box-shadow: 0 2px 4px var(--card-shadow);
}

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

.btn-secondary {
    background-color: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

.timeline-marker {
    background: var(--timeline-marker-bg);
    border-color: var(--bg-primary);
}

.timeline-item:not(:last-child)::before {
    background: var(--timeline-line-bg);
}

.modal-content {
    background-color: var(--modal-bg);
    color: var(--text-primary);
}

.form-control {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--input-text);
}

.form-control:focus {
    background-color: var(--input-bg);
    color: var(--input-text);
}

/* Theme toggle button styles */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--card-shadow);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    color: var(--text-primary);
    font-size: 1.2rem;
}

/* --- UPDATED MENU THEMES --- */

.menu-theme-classic {
    --menu-bg: #232123;
    --menu-card-bg: #2d2a2e;
    --menu-card-border: #44414a;
    --menu-header: #ffb347;
    --menu-section: #ffb347;
    --menu-price: #ffb347;
    --menu-title: #fff;
    --menu-desc: #bdbdbd;
    --menu-allergy: #ff7675;
    --menu-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --menu-radius: 22px;
    --menu-padding: 2.5rem 2rem 2rem 2rem;
    --menu-section-title-size: 1.2rem;
    --menu-name-size: 2.2rem;
    --restaurant-name-size: 1.3rem;
    --menu-item-title-size: 1.13rem;
    --menu-item-price-size: 1.13rem;
    --menu-item-desc-size: 0.98rem;
    --menu-item-allergy-size: 0.95rem;
    --menu-header-bg: linear-gradient(135deg, rgba(45, 42, 46, 0.98) 0%, rgba(35, 33, 35, 0.95) 100%);
    --menu-header-border: #ffb347;
    --menu-logo-bg: rgba(255, 255, 255, 0.1);
    --menu-logo-border: rgba(255, 179, 71, 0.3);
    --menu-decoration-opacity: 0.25;
}
.menu-theme-modern {
    --menu-bg: #f7f8fa;
    --menu-card-bg: #fff;
    --menu-card-border: #e3eafc;
    --menu-header: #2563eb;
    --menu-section: #2563eb;
    --menu-price: #2563eb;
    --menu-title: #222;
    --menu-desc: #666;
    --menu-allergy: #eab308;
    --menu-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.10);
    --menu-radius: 22px;
    --menu-padding: 2.5rem 2rem 2rem 2rem;
    --menu-section-title-size: 1.2rem;
    --menu-name-size: 2.2rem;
    --restaurant-name-size: 1.3rem;
    --menu-item-title-size: 1.13rem;
    --menu-item-price-size: 1.13rem;
    --menu-item-desc-size: 0.98rem;
    --menu-item-allergy-size: 0.95rem;
    --menu-header-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 250, 0.98) 100%);
    --menu-header-border: #e3eafc;
    --menu-logo-bg: rgba(255, 255, 255, 0.95);
    --menu-logo-border: rgba(37, 99, 235, 0.15);
    --menu-decoration-opacity: 0.2;
}
.menu-theme-elegant {
    --menu-bg: #18130a;
    --menu-card-bg: #23200e;
    --menu-card-border: #e6c200;
    --menu-header: #ffd700;
    --menu-section: #ffd700;
    --menu-price: #ffd700;
    --menu-title: #fffbe6;
    --menu-desc: #e6c200;
    --menu-allergy: #d4af37;
    --menu-shadow: 0 8px 32px 0 rgba(191, 161, 0, 0.18);
    --menu-radius: 26px;
    --menu-padding: 2.8rem 2.2rem 2.2rem 2.2rem;
    --menu-section-title-size: 1.25rem;
    --menu-name-size: 2.3rem;
    --restaurant-name-size: 1.4rem;
    --menu-item-title-size: 1.18rem;
    --menu-item-price-size: 1.18rem;
    --menu-item-desc-size: 1.01rem;
    --menu-item-allergy-size: 1rem;
    --menu-header-bg: linear-gradient(135deg, rgba(35, 32, 14, 0.98) 0%, rgba(24, 19, 10, 0.95) 100%);
    --menu-header-border: #e6c200;
    --menu-logo-bg: rgba(255, 215, 0, 0.1);
    --menu-logo-border: rgba(230, 194, 0, 0.4);
    --menu-decoration-opacity: 0.3;
}
.menu-theme-mint {
    --menu-bg: #e6fff7;
    --menu-card-bg: #f0fffa;
    --menu-card-border: #7be0c7;
    --menu-header: #1abc9c;
    --menu-section: #1abc9c;
    --menu-price: #1abc9c;
    --menu-title: #145c4c;
    --menu-desc: #4e8577;
    --menu-allergy: #16a085;
    --menu-shadow: 0 8px 32px 0 rgba(26, 188, 156, 0.10);
    --menu-radius: 26px;
    --menu-padding: 2.8rem 2.2rem 2.2rem 2.2rem;
    --menu-section-title-size: 1.25rem;
    --menu-name-size: 2.3rem;
    --restaurant-name-size: 1.4rem;
    --menu-item-title-size: 1.18rem;
    --menu-item-price-size: 1.18rem;
    --menu-item-desc-size: 1.01rem;
    --menu-item-allergy-size: 1rem;
    --menu-header-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 255, 250, 0.98) 100%);
    --menu-header-border: #7be0c7;
    --menu-logo-bg: rgba(255, 255, 255, 0.95);
    --menu-logo-border: rgba(26, 188, 156, 0.2);
    --menu-decoration-opacity: 0.2;
}

.menu-card, .menu-showcase-card {
    border-radius: var(--menu-radius);
    box-shadow: var(--menu-shadow);
    background: var(--menu-card-bg);
    border: 1.5px solid var(--menu-card-border);
    color: var(--menu-title);
    padding: var(--menu-padding);
    margin: 2.5rem auto;
    max-width: 900px;
    width: 100%;
    box-sizing: border-box; /* Include padding in width calculation */
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    overflow-x: hidden; /* Prevent horizontal overflow */
}
.menu-header {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding: 2rem 2.5rem;
    border-bottom: 3px solid var(--menu-header-border);
    background: var(--menu-header-bg);
    border-radius: 12px;
    overflow: hidden;
}

/* Background decorative food/fruit icons */
.menu-header-decorations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: var(--menu-decoration-opacity, 0.15);
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.menu-header-decorations i {
    position: absolute;
    color: var(--menu-section);
    font-size: 3rem;
    animation: float 20s infinite ease-in-out;
    opacity: 1; /* Ensure icons themselves are fully opaque, parent controls overall visibility */
}

.menu-header-decorations i:nth-child(1) {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
    font-size: 2.5rem;
}

.menu-header-decorations i:nth-child(2) {
    top: 20%;
    right: 8%;
    animation-delay: 2s;
    font-size: 2rem;
}

.menu-header-decorations i:nth-child(3) {
    bottom: 15%;
    left: 12%;
    animation-delay: 4s;
    font-size: 2.8rem;
}

.menu-header-decorations i:nth-child(4) {
    top: 50%;
    right: 5%;
    animation-delay: 6s;
    font-size: 2.3rem;
}

.menu-header-decorations i:nth-child(5) {
    bottom: 25%;
    right: 15%;
    animation-delay: 8s;
    font-size: 2.6rem;
}

.menu-header-decorations i:nth-child(6) {
    top: 30%;
    left: 50%;
    animation-delay: 10s;
    font-size: 2.4rem;
}

.menu-header-decorations i:nth-child(7) {
    bottom: 10%;
    right: 30%;
    animation-delay: 12s;
    font-size: 2.2rem;
}

.menu-header-decorations i:nth-child(8) {
    top: 60%;
    left: 25%;
    animation-delay: 14s;
    font-size: 2.7rem;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.menu-header > * {
    position: relative;
    z-index: 1;
}

.restaurant-logo-container {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    position: relative;
}

.restaurant-logo {
    max-width: 140px;
    max-height: 140px;
    width: auto;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    object-fit: contain;
    background: var(--menu-logo-bg);
    padding: 12px;
    border: 2px solid var(--menu-logo-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.restaurant-logo:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.menu-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-header .menu-name {
    font-size: var(--menu-name-size);
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--menu-header);
    margin-bottom: 0.5rem;
    margin-top: 0;
    line-height: 1.2;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 0.75rem;
}

.menu-header .menu-name::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--menu-header) 0%, transparent 100%);
    border-radius: 2px;
}

.menu-header .restaurant-name {
    font-size: var(--restaurant-name-size);
    font-weight: 700;
    color: var(--menu-title);
    margin-bottom: 0.25rem;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.menu-header .restaurant-address {
    font-size: 1rem;
    color: var(--menu-desc);
    margin-bottom: 0.3rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-header .restaurant-address i {
    color: var(--menu-section);
    font-size: 0.9rem;
}

.menu-header .restaurant-established {
    font-size: 0.95rem;
    color: var(--menu-desc);
    margin-bottom: 0;
    line-height: 1.4;
    font-style: italic;
}
.menu-section {
    margin-bottom: 2.2rem;
}
.menu-section-title {
    font-size: var(--menu-section-title-size);
    font-weight: 700;
    color: var(--menu-section);
    border-bottom: 2px solid var(--menu-section);
    margin-bottom: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.menu-items-list {
    padding-left: 0;
    list-style: none;
}
.menu-item-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.1rem 0.5rem;
    border-bottom: 1px solid var(--menu-card-border);
    font-size: var(--menu-item-title-size);
    background: none;
    gap: 1rem; /* Space between details and price */
    overflow: hidden; /* Prevent content from overflowing */
}
.menu-item-row:last-child {
    border-bottom: none;
}
.menu-item-details {
    flex: 2 1 0;
    min-width: 0; /* Allows flex item to shrink below content size */
    max-width: 100%; /* Prevents overflow */
    padding-right: 1rem; /* Space between description and price */
}
.menu-item-title {
    font-weight: 600;
    font-size: var(--menu-item-title-size);
    color: var(--menu-title);
    margin-bottom: 0.18rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
}
.menu-item-desc {
    color: var(--menu-desc);
    font-size: var(--menu-item-desc-size);
    margin-bottom: 0.18rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.5;
    max-width: 100%;
    hyphens: auto; /* Automatic hyphenation for better wrapping */
    overflow: visible; /* Allow text to wrap naturally */
}
.menu-item-allergy {
    color: var(--menu-allergy);
    font-size: var(--menu-item-allergy-size);
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    max-width: 100%;
}
.menu-item-price {
    flex: 0 0 110px;
    min-width: 110px; /* Ensure minimum width for price */
    text-align: right;
    font-weight: 700;
    font-size: var(--menu-item-price-size);
    color: var(--menu-price);
    letter-spacing: 0.5px;
    white-space: nowrap; /* Prevent price from wrapping */
}
.menu-section-empty {
    color: var(--menu-desc);
    font-style: italic;
    margin-bottom: 1rem;
}
.menu-back-btn {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}
.menu-back-btn .btn {
    min-width: 220px;
    font-size: 1.1rem;
    border-radius: 8px;
}
/* Remove the body background override to preserve dark theme */
body.menu-theme-modern {
    /* background: var(--menu-bg) !important; */
}
body.menu-theme-classic {
    /* background: var(--menu-bg) !important; */
}
body.menu-theme-elegant {
    /* background: var(--menu-bg) !important; */
}
body.menu-theme-mint {
    /* background: var(--menu-bg) !important; */
}

/* Responsive styles for menu header */
@@media (max-width: 768px) {
    .menu-header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .restaurant-logo-container {
        align-self: center;
    }
    
    .restaurant-logo {
        max-width: 100px;
        max-height: 100px;
    }
    
    .menu-header-content {
        text-align: center;
    }
    
    .menu-header .menu-name::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .menu-header-decorations i {
        font-size: 1.5rem !important;
        opacity: 0.15; /* More visible on mobile */
    }
    
    /* Responsive menu item adjustments */
    .menu-item-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .menu-item-details {
        padding-right: 0;
        width: 100%;
    }
    
    .menu-item-price {
        flex: 0 0 auto;
        text-align: left;
        width: 100%;
    }
    
    .menu-item-desc {
        /* Natural wrapping on mobile - no line clamp needed */
    }
} 