/* ==========================================
   DEVELOPER DESIGN SYSTEM & STYLESHEET
   Project: Beit Beirut Restaurant Digital Menu
   Aesthetics: Luxury Light & Golden Amber
   ========================================== */

:root {
    /* Brand Colors */
    --clr-primary: #c9a227;        /* Gold/Amber */
    --clr-primary-light: #e8b84b;  /* Light Gold */
    --clr-primary-dark: #a07c10;   /* Dark Gold */
    
    /* Neutrals */
    --bg-base: #f7f4ef;            /* Warm Cream Background */
    --bg-surface: #ffffff;         /* Card Surface */
    --bg-surface-hover: #fdf9f3;   /* Card Hover */
    --bg-header: rgba(247, 244, 239, 0.92); /* Semi-transparent header */
    
    /* Text */
    --text-main: #1a1a1a;          /* Primary Dark */
    --text-muted: #6b6b6b;         /* Secondary Gray */
    --text-on-primary: #ffffff;    /* Contrast Text */
    
    /* UI Feedback / Decorative */
    --clr-accent: #c0392b;         /* Subtle warm accent */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(201, 162, 39, 0.25);
    --glass-border-hover: rgba(201, 162, 39, 0.5);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.06);
    
    /* Fonts */
    --font-arabic: 'Cairo', sans-serif;
    --font-english: 'Outfit', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Globals */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-arabic);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--clr-primary);
}

/* ==========================================
   SPLASH / REEL SCREEN
   ========================================== */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* The rotating photo reel background */
.splash-reel {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.reel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1.2s ease-in-out, transform 6s ease-in-out;
    will-change: opacity, transform;
}

.reel-slide.active {
    opacity: 1;
    transform: scale(1);
}

/* Elegant dark gradient overlay */
.splash-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(10, 6, 0, 0.35) 0%,
        rgba(10, 6, 0, 0.55) 40%,
        rgba(10, 6, 0, 0.75) 80%,
        rgba(10, 6, 0, 0.88) 100%
    );
}

/* Indicator dots */
.reel-dots {
    position: absolute;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.reel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
}

.reel-dot.active {
    background: var(--clr-primary);
    width: 22px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(201, 162, 39, 0.7);
}

/* Center branded content */
.splash-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
    padding: 2rem;
    animation: splashContentIn 1.2s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

@keyframes splashContentIn {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animated logo ring */
.splash-logo-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, var(--clr-primary), transparent 60%);
    box-shadow:
        0 0 0 3px rgba(201, 162, 39, 0.4),
        0 0 40px rgba(201, 162, 39, 0.25),
        0 8px 32px rgba(0,0,0,0.4);
    animation: logoGlow 3s ease-in-out infinite alternate;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@keyframes logoGlow {
    from { box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.4), 0 0 30px rgba(201, 162, 39, 0.2), 0 8px 32px rgba(0,0,0,0.4); }
    to   { box-shadow: 0 0 0 5px rgba(201, 162, 39, 0.65), 0 0 55px rgba(201, 162, 39, 0.45), 0 8px 32px rgba(0,0,0,0.4); }
}

.splash-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Restaurant name */
.splash-title {
    font-family: var(--font-arabic);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* Tagline */
.splash-tagline {
    font-family: var(--font-arabic);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.04em;
    font-weight: 400;
}

/* Golden CTA button */
.splash-enter-btn {
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--clr-primary-light), var(--clr-primary));
    color: #1a1100;
    font-family: var(--font-arabic);
    font-size: 1.1rem;
    font-weight: 800;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow:
        0 4px 25px rgba(201, 162, 39, 0.55),
        0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.splash-enter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 60%);
    border-radius: 50px;
    pointer-events: none;
}

.splash-enter-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 8px 35px rgba(201, 162, 39, 0.75),
        0 2px 6px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #f5cc55, var(--clr-primary-light));
}

.splash-enter-btn:active {
    transform: translateY(0) scale(0.98);
}

.enter-btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.splash-enter-btn:hover .enter-btn-icon {
    transform: translateX(-4px);
}

/* Animated scroll hint chevron */
.splash-scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    opacity: 0.6;
    animation: bounceHint 2s ease-in-out infinite;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
}

@keyframes bounceHint {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(6px); }
}

/* Splash exit animation */
.splash-screen.hiding {
    animation: splashExit 0.85s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashExit {
    0%   { opacity: 1; transform: scale(1); }
    60%  { opacity: 0.6; transform: scale(1.03); }
    100% { opacity: 0; transform: scale(1.06); pointer-events: none; }
}

.splash-screen.hidden {
    display: none;
}

/* Main Header */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.header-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

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

.logo-container {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    mix-blend-mode: multiply;
}

.brand-info .brand-name-main {
    font-size: 1.7rem;
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.brand-info .brand-name-sub {
    font-size: 0.8rem;
    color: #1a1a1a;
    font-weight: 500;
    margin-top: 0.1rem;
    letter-spacing: 0.03em;
}

/* Search Box */
.header-actions {
    flex-grow: 1;
    max-width: 450px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-fast);
}

#menu-search {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 1.25rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--text-main);
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

#menu-search:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

#menu-search:focus + .search-icon {
    color: var(--clr-primary);
}

.clear-btn {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.clear-btn:hover {
    color: var(--clr-accent);
}

/* Layout Wrapper */
.menu-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    gap: 2.5rem;
    flex-grow: 1;
    width: 100%;
}

/* Sidebar Navigation (Desktop) */
.category-nav-wrapper {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: calc(100vh - 140px);
    overflow-y: auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.category-nav-header {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 0.75rem;
}

.category-nav-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--clr-primary-light);
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: right;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(to right, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.03));
    color: var(--clr-primary-light);
    border-right: 3px solid var(--clr-primary);
    font-weight: 700;
    padding-right: 0.85rem;
}

.nav-item .badge {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-english);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    transition: var(--transition-fast);
}

.nav-item.active .badge {
    background: rgba(212, 175, 55, 0.2);
    color: var(--clr-primary-light);
}

/* Products Content Area */
.menu-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
}

.content-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
}

.items-count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

/* Product Card */
.product-card {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    background: var(--bg-surface-hover);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg);
}

/* Card Image Section */
.card-img-container {
    height: 180px;
    position: relative;
    background: linear-gradient(135deg, #f0ece4, #e8e2d8);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--clr-primary-dark);
    font-size: 2.2rem;
    opacity: 0.5;
    transition: var(--transition-smooth);
    z-index: 0;
}

.product-card:hover .card-img-placeholder {
    transform: scale(1.1);
    color: var(--clr-primary-dark);
}

.placeholder-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    opacity: 0.3;
}

.product-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: var(--transition-smooth);
    z-index: 1;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Card Content Details */
.card-details {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.75rem;
}

.card-details h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 3.1rem; /* Clamp height to keep alignment */
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.card-price {
    font-family: var(--font-english);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--clr-primary-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-price .currency {
    font-family: var(--font-arabic);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.card-id-tag {
    font-family: var(--font-english);
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* Skeletons */
.skeleton-nav-item {
    height: 40px;
    background: linear-gradient(90deg, #ece8e0 25%, #f5f2eb 50%, #ece8e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-card {
    height: 300px;
    background: linear-gradient(90deg, #ece8e0 25%, #f5f2eb 50%, #ece8e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 16px;
    border-color: rgba(0, 0, 0, 0.05);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State styling */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-surface);
    border-radius: 20px;
    border: 1px dashed var(--glass-border);
    margin-top: 2rem;
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
    color: var(--text-on-primary);
    border: none;
    font-family: var(--font-arabic);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Floating Back to Top */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem; /* Left side since LTR/RTL reversed */
    background: var(--glass-bg);
    color: var(--clr-primary-light);
    border: 1px solid var(--glass-border);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    z-index: 99;
}

.back-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.back-to-top-btn:hover {
    background: var(--clr-primary);
    color: var(--text-on-primary);
    border-color: var(--clr-primary);
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3);
}

/* Footer styling */
.main-footer {
    background: #ede9e1;
    padding: 2.5rem 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    text-align: center;
    margin-top: auto;
}

.footer-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-content .powered-by {
    font-size: 0.75rem;
    color: #999999;
    margin-top: 0.5rem;
}

/* Responsive Breakpoints */

/* Tablet & Mobile Layout Adaptations */
@media (max-width: 1024px) {
    .menu-container {
        flex-direction: column;
        padding: 1.25rem;
        gap: 1.5rem;
    }
    
    .category-nav-wrapper {
        width: 100%;
        position: sticky;
        top: 80px; /* Adjust header sticky height offset */
        height: auto;
        padding: 0.5rem;
        overflow-y: visible;
        overflow-x: auto;
        z-index: 90;
        background: var(--bg-base);
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 0;
        box-shadow: none;
        margin: 0 -1.25rem; /* Full width bleeding */
        width: calc(100% + 2.5rem);
    }
    
    .category-nav-header {
        display: none; /* Hide sidebar heading */
    }
    
    .category-nav {
        flex-direction: row;
        gap: 0.50rem;
        padding: 0.5rem 1.25rem;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Hide scrollbars for mobile slider */
    .category-nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        padding: 0.6rem 1.25rem;
        text-align: center;
        border-radius: 20px;
        background: rgba(0, 0, 0, 0.04);
        border: 1px solid rgba(0, 0, 0, 0.08);
        flex-shrink: 0;
    }
    
    .nav-item.active {
        background: var(--clr-primary);
        color: var(--text-on-primary);
        border-right: none;
        border: 1px solid var(--clr-primary);
        font-weight: 700;
        padding-right: 1.25rem;
    }
    
    .nav-item.active .badge {
        background: rgba(0, 0, 0, 0.15);
        color: var(--text-on-primary);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1rem;
    }
    
    .main-header {
        position: sticky;
        top: 0;
    }
    
    .category-nav-wrapper {
        top: 148px; /* Shift top down to accommodate stacked header */
    }
    
    .header-actions {
        max-width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .card-img-container {
        height: 120px;
    }
    
    .card-img-placeholder {
        font-size: 1.8rem;
    }
    
    .card-details {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .card-details h3 {
        font-size: 0.95rem;
        height: 2.7rem;
        -webkit-line-clamp: 2;
    }
    
    .card-footer {
        padding-top: 0.4rem;
    }
    
    .card-price {
        font-size: 1rem;
    }
    
    .card-id-tag {
        display: none; /* Hide IDs on mobile grids to save space */
    }
    
    .content-header h2 {
        font-size: 1.3rem;
    }
}
