:root {
    /* High-End Color Palette - HSL based for consistency */
    --bg-dark: #08090a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shine: rgba(255, 255, 255, 0.05);
    
    --primary-gold: hsl(45, 65%, 53%);
    --primary-blue: hsl(200, 70%, 55%);
    --primary-orange: hsl(15, 80%, 60%);
    --primary-green: hsl(150, 85%, 45%);
    
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    
    --font-ar: 'Tajawal', sans-serif;
    --font-en: 'Outfit', sans-serif;
    
    --blur-val: 20px;
    --radius-lg: 30px;
    --radius-md: 20px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ar);
    height: 100vh;
    width: 100vw;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.hidden { display: none !important; }

/* --- PREMIUM BACKGROUND --- */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: 
        radial-gradient(at 0% 0%, hsla(200, 70%, 55%, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(45, 65%, 53%, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(150, 85%, 45%, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(15, 80%, 60%, 0.1) 0px, transparent 50%);
    filter: blur(80px);
}

.bg-glass-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.05"/></svg>');
    opacity: 0.3;
}

.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    animation: blobMove 20s infinite alternate ease-in-out;
}

.blob-1 { width: 400px; height: 400px; background: var(--primary-blue); top: -100px; left: -100px; }
.blob-2 { width: 500px; height: 500px; background: var(--primary-gold); bottom: -150px; right: -100px; animation-delay: -5s; }
.blob-3 { width: 300px; height: 300px; background: var(--primary-orange); top: 30%; left: 60%; animation-delay: -10s; }

@keyframes blobMove {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* --- LAYOUT --- */
.screen-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
}

/* --- HEADER --- */
.main-header {
    height: 12vh;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4vw;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-val));
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
}

.logo-area h1 {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255,255,255,0.1);
}

.logo-area .subtitle {
    font-family: var(--font-en);
    font-size: 1.1rem;
    color: var(--primary-gold);
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 400;
    opacity: 0.9;
}

.page-dots {
    position: fixed;
    bottom: 9.5vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.dot.active {
    background: var(--primary-gold);
    box-shadow: 0 0 15px var(--primary-gold);
    transform: scale(1.4);
}

.time-display {
    font-family: var(--font-en);
    font-size: 2.2rem;
    font-weight: 300;
    color: var(--text-main);
    letter-spacing: 2px;
}

/* --- PAGES --- */
.page-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    display: flex !important;
}

.page.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- STATUS GRID --- */
.status-grid {
    padding: 2rem;
    gap: 1.5rem;
    width: 100%;
    display: flex !important;
}

.status-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-val));
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    padding: 1.8rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}

.status-column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent, var(--primary-blue));
    box-shadow: 0 0 15px var(--accent, var(--primary-blue));
}

.status-column.new { --accent: var(--primary-blue); }
.status-column.preparing { --accent: var(--primary-orange); }
.status-column.ready { --accent: var(--primary-green); }

.column-header {
    margin-bottom: 2rem;
    text-align: center;
}

.column-header h3 {
    font-size: 2.4rem;
    font-weight: 900;
    margin-bottom: 0.2rem;
    color: #fff;
}

.column-header .en-title {
    font-family: var(--font-en);
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* --- ORDER CARDS --- */
.orders-container {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    grid-auto-rows: min-content;
    gap: 1rem;
    align-content: start;
    overflow: hidden;
}

.order-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 1.2rem 0.8rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.order-number {
    font-family: var(--font-en);
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    display: block;
    line-height: 1;
}

.ready .order-number {
    color: var(--primary-green);
    text-shadow: 0 0 20px hsla(150, 85%, 45%, 0.3);
}

.order-card.is-online {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px dashed rgba(255,255,255,0.3);
}

.online-badge {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.65rem;
    font-family: var(--font-en);
    color: var(--primary-gold);
    font-weight: 700;
    text-transform: uppercase;
}

.table-badge {
    margin-top: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* --- PROMOTIONS PAGE --- */
.promotions-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    height: 100%;
    box-sizing: border-box;
}

.promotions-header {
    text-align: center;
    margin-bottom: 1.2rem;
}

.promo-title {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary-gold);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0;
}

.promo-subtitle {
    font-family: var(--font-en);
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 6px;
    margin-top: 5px;
    margin-bottom: 0;
}

.promotions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1100px;
    height: 52vh;
    max-height: 520px;
    margin: 0 auto;
    justify-content: center;
    align-content: center;
}

.promo-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-val));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    
    /* GORGEOUS PULSING FIRE GLOW */
    transition: all 0.5s ease;
    animation: promoFireGlow 3s infinite alternate;
}

@keyframes promoFireGlow {
    0% {
        box-shadow: 0 0 15px rgba(255, 107, 53, 0.4), 0 0 30px rgba(212, 175, 55, 0.1);
        border-color: rgba(255, 107, 53, 0.3);
    }
    100% {
        box-shadow: 0 0 35px rgba(255, 107, 53, 0.8), 0 0 60px rgba(212, 175, 55, 0.4);
        border-color: rgba(255, 107, 53, 0.7);
    }
}

.promo-image {
    width: 100%;
    height: 100%; /* Take full height! */
    object-fit: cover;
    border-bottom: none;
    transition: transform 0.5s ease;
}

.promo-card:hover .promo-image {
    transform: scale(1.05); /* Soft premium hover zoom! */
}

.promo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Stunning fade-to-black bottom gradient for perfect text legibility */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0) 100%);
    padding: 2.5rem 1rem 0.8rem 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: center;
    color: #fff;
    z-index: 1;
}

.promo-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.promo-info p {
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Premium Promotions Card Badges */
.promo-discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #FF6B35, #D4AF37);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.4);
    z-index: 2;
    animation: pulseBadge 2s infinite alternate;
}

@keyframes pulseBadge {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.promo-price-tag {
    margin-top: 6px;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.promo-original-price {
    font-size: 0.95rem;
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 400;
}

/* --- TICKER --- */
.scrolling-ticker {
    height: 7vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.ticker-wrapper {
    display: inline-block;
    white-space: nowrap;
    padding-right: 100%;
    animation: ticker var(--ticker-duration, 30s) linear infinite;
}

.ticker-item {
    display: inline-block;
    padding: 0 3rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.offer-item { color: var(--primary-gold); }

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* --- NOTIFICATIONS --- */
.overlay-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(30px);
    border: 2px solid var(--primary-green);
    border-radius: var(--radius-lg);
    padding: 4rem 6rem;
    z-index: 1000;
    box-shadow: 0 0 100px rgba(0,230,118,0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-width: 500px;
}

.overlay-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.overlay-icon { font-size: 6rem; margin-bottom: 1rem; }
.overlay-text { font-size: 4rem; font-weight: 900; line-height: 1.2; }

/* --- FULLSCREEN TOGGLE --- */
.fullscreen-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 100;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.fullscreen-btn:hover { opacity: 1; }

/* --- EMPTY STATES --- */
.logo-area {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.header-controls {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.toggle-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.8rem 1.5rem;
    border-radius: 15px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.toggle-btn.active {
    background: var(--primary-green);
    color: black;
    box-shadow: 0 0 20px rgba(0, 255, 140, 0.4);
    transform: translateY(-2px);
}



.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.empty-icon { font-size: 4rem; opacity: 0.3; margin-bottom: 1rem; }

/* Responsive adjustments */
@media (max-width: 1400px) {
    .logo-area h1 { font-size: 2.2rem; }
    .status-column h3 { font-size: 2rem; }
    .order-number { font-size: 2.2rem; }
}

/* --- BACKGROUND REWARDS PARTICLES --- */
.bg-particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1; /* Behind promo cards and columns, above base bg mesh */
}

.floating-particle {
    position: absolute;
    bottom: -50px;
    font-size: var(--p-size, 2rem);
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    animation: floatUp var(--p-duration, 20s) linear infinite;
    user-select: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: var(--p-opacity, 0.4);
    }
    90% {
        opacity: var(--p-opacity, 0.4);
    }
    100% {
        transform: translateY(-115vh) translateX(var(--p-drift, 50px)) rotate(var(--p-rotate, 360deg));
        opacity: 0;
    }
}

/* ==========================================================================
   PREMIUM MOBILE & TABLET RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 991px) {
    body {
        height: 100vh !important;
        width: 100vw !important;
        overflow: hidden !important;
    }
    
    .screen-container {
        height: 100vh !important;
        width: 100vw !important;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
    }

    .main-header {
        height: auto !important;
        min-height: 95px;
        padding: 10px 4vw !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        align-items: center;
    }

    .logo-area {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }

    .logo-area h1 {
        font-size: 1.3rem !important;
    }

    .logo-area .subtitle {
        font-size: 0.6rem !important;
        letter-spacing: 1px !important;
    }

    .time-display {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        font-size: 1.1rem !important;
    }

    .header-controls {
        grid-column: 1 / span 2;
        grid-row: 2;
        justify-self: center;
        padding: 0.25rem !important;
        border-radius: 12px !important;
        gap: 0.4rem !important;
    }

    .toggle-btn {
        padding: 0.3rem 0.7rem !important;
        font-size: 0.75rem !important;
        border-radius: 10px !important;
        gap: 0.3rem !important;
    }

    .page-container {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .page {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        pointer-events: none;
        display: none !important;
    }

    .page.active {
        position: relative !important;
        opacity: 1;
        pointer-events: auto;
        display: flex !important;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    /* Orders grid layout for mobile/tablet */
    .status-grid {
        flex-direction: column !important;
        height: 100% !important;
        padding: 1rem;
        gap: 1.2rem;
        overflow-y: auto !important;
    }

    .status-column {
        width: 100% !important;
        flex: none !important;
        padding: 1.2rem 1rem !important;
        border-radius: var(--radius-md);
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    }

    .column-header {
        margin-bottom: 1rem !important;
    }

    .column-header h3 {
        font-size: 1.4rem !important;
    }

    .orders-container {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
        max-height: 220px;
        overflow-y: auto !important;
        padding-right: 4px;
        gap: 0.6rem;
    }

    .order-card {
        padding: 0.6rem 0.4rem;
        border-radius: var(--radius-sm);
    }

    .order-number {
        font-size: 1.5rem !important;
    }

    .table-badge {
        font-size: 0.75rem;
        margin-top: 2px;
    }

    /* Promotions page mobile styles */
    .promotions-page {
        height: 100% !important;
        padding: 1rem;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .promo-title {
        font-size: 1.4rem;
        gap: 8px;
        margin-bottom: 5px;
    }

    .promo-subtitle {
        font-size: 0.75rem;
        letter-spacing: 2px;
        margin-bottom: 10px;
    }

    .promotions-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
        gap: 1.2rem;
        flex: 1;
        width: 100%;
        overflow-y: auto !important;
        padding-bottom: 20px;
        align-content: start;
        height: auto;
    }

    .promo-card {
        height: 220px;
    }

    .promo-info {
        padding: 1.5rem 0.8rem 0.6rem 0.8rem;
    }

    .promo-info h3 {
        font-size: 1.1rem;
    }

    .promo-info p {
        font-size: 0.8rem;
    }

    /* Scrolling ticker mobile styles */
    .scrolling-ticker {
        height: 6vh;
        min-height: 45px;
    }

    .ticker-item {
        font-size: 0.95rem;
        padding: 0 1.2rem;
    }
    
    /* Fullscreen notification scaling on mobile */
    .overlay-notification {
        min-width: 90% !important;
        width: 90% !important;
        padding: 2rem 1rem !important;
    }
    
    .overlay-icon {
        font-size: 3.5rem !important;
    }
    
    .overlay-text {
        font-size: 1.8rem !important;
    }
}

@media (max-width: 600px) {
    .promotions-grid {
        grid-template-columns: 1fr !important;
    }
}