/* index.css - Premium Luxury CSS for Geofenced Digital Menu */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-dark: #070605;          /* Deep luxury warm black */
    --bg-surface: #0e0c0b;       /* Soft obsidian */
    --bg-card: #151210;          /* Elegant warm dark card */
    --gold: #d4af37;             /* Classic champagne gold */
    --gold-hover: #ecc077;       /* Soft warm glow hover gold */
    --gold-glow: rgba(212, 175, 55, 0.08);
    --gold-glow-strong: rgba(212, 175, 55, 0.35);
    --text-primary: #f8f6f2;     /* Warm off-white primary text */
    --text-secondary: #c8c3bc;   /* Soft warm grey secondary text */
    --text-muted: #8b857c;       /* Luxurious muted text */
    --border-color: rgba(212, 175, 55, 0.1);
    --border-color-hover: rgba(212, 175, 55, 0.28);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius-lg: 20px;           /* Elegantly rounded corners */
    --radius-md: 12px;
    --radius-sm: 6px;
    --gold-gradient: linear-gradient(135deg, #d4af37 0%, #b88d3c 100%);
    --gold-gradient-hover: linear-gradient(135deg, #fce08a 0%, #d4af37 100%);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* LTR Specific settings dynamically enabled */
body.ltr-mode {
    font-family: 'Playfair Display', 'Cairo', serif;
}

body.ltr-mode .font-title {
    font-family: 'Playfair Display', serif;
}

/* Typography styles */
h1, h2, h3, h4, h5 {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

body.ltr-mode h1, body.ltr-mode h2, body.ltr-mode h3 {
    font-family: 'Playfair Display', serif;
}

/* Premium Layout Wrapper */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Luxury Background Accent Gradients */
.glow-accent {
    position: fixed;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, rgba(212, 175, 55, 0.01) 40%, rgba(0,0,0,0) 70%);
    top: -250px;
    right: -250px;
    pointer-events: none;
    z-index: 0;
}

.glow-accent-left {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.04) 0%, rgba(212, 175, 55, 0.005) 40%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    left: -150px;
    pointer-events: none;
    z-index: 0;
}

/* Header & Navigation Bar */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(8, 8, 8, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    z-index: 99;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Premium Buttons */
.btn-lang {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-lang:hover {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 12px var(--gold-glow);
}

/* Main Area Container */
main {
    flex: 1;
    z-index: 1;
    position: relative;
}

/* --- STATE 1: Locked Marketing UI --- */
.marketing-view {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    animation: fadeIn 0.8s ease-out;
}

.hero-section {
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 18px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 50px;
    color: var(--gold);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.25;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 35px;
    line-height: 1.8;
}

/* Premium Location Checking Card */
.geofence-card {
    background: linear-gradient(145deg, var(--bg-surface) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.geofence-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.geofence-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 25px 50px rgba(212, 175, 55, 0.05);
}

.geo-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.geo-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--gold);
    opacity: 0;
    animation: radarPulse 2s infinite ease-out;
}

.geo-icon {
    font-size: 2.2rem;
    color: var(--gold);
}

.geofence-card h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.geofence-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #b38f1e 100%);
    color: #000;
    border: none;
    padding: 14px 35px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold) 100%);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Feature Grid for teaser */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
}

.feature-card {
    background: rgba(18, 18, 18, 0.6);
    border: 1px solid rgba(255,255,255, 0.03);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    transition: var(--transition-smooth);
}

.feature-card:hover {
    background: rgba(18, 18, 18, 0.9);
    border-color: var(--border-color);
    transform: translateY(-5px);
}

.feature-emoji {
    font-size: 2rem;
    margin-bottom: 15px;
    display: inline-block;
}

.feature-card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--gold);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Restaurant Details Segment */
.restaurant-meta-bar {
    width: 100%;
    background: rgba(18, 18, 18, 0.4);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    text-align: center;
}

.meta-item-box h5 {
    color: var(--gold);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 5px;
}

.meta-item-box p {
    font-size: 1rem;
    font-weight: 600;
}

/* --- STATE 2: Unlocked Active Menu UI --- */
.menu-view {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 100px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Live Active Session Status Banner */
.status-banner {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-out;
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

.menu-cover {
    height: 250px;
    border-radius: var(--radius-lg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border: none;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.menu-cover::after {
    content: '';
    position: absolute;
    inset: -2px; /* Prevents subpixel layout leakage at rounded corners */
    border-radius: inherit;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.menu-cover-content {
    position: relative;
    z-index: 2;
}

.menu-cover-tag {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.menu-cover-title {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

/* Search and Filters Bar */
.menu-controls {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.search-input {
    width: 100%;
    background: rgba(14, 12, 11, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 20px;
    padding-right: 45px; /* Spaced for search icon in RTL */
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition-smooth);
}

body.ltr-mode .search-input {
    padding-right: 20px;
    padding-left: 45px;
}

.search-input:focus {
    outline: none;
    background: rgba(14, 12, 11, 0.9);
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.12);
}

.search-icon-svg {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition-smooth);
}

body.ltr-mode .search-icon-svg {
    right: auto;
    left: 18px;
}

.search-input:focus + .search-icon-svg {
    color: var(--gold);
}

/* Premium Category Navigation Tabs */
.category-tabs {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-top: 10px; /* Prevent hover scaling and shadow clipping */
    padding-bottom: 15px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.category-tabs::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.tab-btn {
    background: rgba(14, 12, 11, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    border-color: rgba(212, 175, 55, 0.55);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tab-btn.active {
    background: var(--gold-gradient);
    border-color: transparent;
    color: #050403;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(212, 175, 55, 0.35);
}

/* Category Sections & Items Grid */
.menu-category-section {
    margin-bottom: 50px;
    animation: fadeIn 0.6s ease-out;
}

.category-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-badge {
    width: 6px;
    height: 24px;
    background: var(--gold);
    border-radius: 3px;
}

.category-title {
    font-size: 1.6rem;
    font-weight: 700;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Luxurious Individual Menu Card */
.menu-card {
    background: rgba(21, 18, 16, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    gap: 18px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.menu-card:hover {
    background: rgba(21, 18, 16, 0.85);
    border-color: var(--border-color-hover);
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.06);
}

.item-thumbnail {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 175, 55, 0.25);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.menu-card:hover .item-thumbnail {
    border-color: var(--gold);
    transform: scale(1.05);
}

.item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}

.item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.menu-card:hover .item-name {
    color: var(--gold);
}

.item-price-tag {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    color: var(--gold);
    font-size: 1.05rem;
    white-space: nowrap;
}

body.ltr-mode .item-price-tag {
    font-family: 'Playfair Display', sans-serif;
}

.item-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid rgba(255,255,255,0.03);
    padding-top: 8px;
}

.calorie-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.spark-flame {
    color: #f97316;
}

/* Empty State / Not Found Styling */
.not-found-container {
    text-align: center;
    padding: 60px 20px;
}

.not-found-emoji {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.not-found-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* --- STATE 3: Real GPS Wait Dialog --- */
.checking-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 6, 5, 0.85);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    padding: 24px;
    animation: fadeIn 0.4s ease-out;
}

.spinner-circle {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    border-top-color: var(--gold);
    animation: spin 1s infinite linear;
}

.checking-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
}

.checking-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    max-width: 400px;
}

/* --- Simulation Test Control Drawer --- */
.sim-drawer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
    width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.1);
    z-index: 1000;
    overflow: hidden;
    transition: var(--transition-smooth);
    font-size: 0.85rem;
}

body[dir="ltr"] .sim-drawer {
    right: auto;
    left: 20px;
}

.sim-header {
    background: var(--gold-glow);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gold);
    cursor: pointer;
}

.sim-title {
    font-weight: 700;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sim-toggle-indicator {
    font-size: 0.6rem;
    transition: transform 0.3s;
}

.sim-drawer.collapsed .sim-toggle-indicator {
    transform: rotate(180deg);
}

.sim-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: max-height 0.4s ease-in-out;
    max-height: 400px;
}

.sim-drawer.collapsed .sim-body {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
    border: none;
}

.sim-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sim-group label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.sim-select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: inherit;
}

.sim-select:focus {
    border-color: var(--gold);
}

.sim-stats {
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.02);
}

.sim-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.sim-stat-row:last-child {
    margin-bottom: 0;
}

.sim-stat-label {
    color: var(--text-muted);
}

.sim-stat-value {
    font-weight: 600;
}

.stat-success {
    color: #4ade80;
}

.stat-danger {
    color: #f87171;
}

/* Footer Section */
footer {
    border-top: 1px solid var(--border-color);
    background: rgba(12, 12, 12, 0.9);
    padding: 40px 20px;
    text-align: center;
    z-index: 10;
}

.footer-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 0;
}

/* Animations */
@keyframes radarPulse {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes blink {
    50% { opacity: 0.4; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Rules */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 4%;
    }
    .hero-title {
        font-size: 2.2rem;
    }
    .hero-desc {
        font-size: 1rem;
    }
    .geofence-card {
        padding: 25px 15px;
    }
    .items-grid {
        grid-template-columns: 1fr;
    }
    .sim-drawer {
        width: calc(100% - 40px);
        left: 20px;
        right: 20px;
    }
}
