/* === Base Reset & Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Tajawal:wght@400;500;700;900&display=swap');

:root {
    --bg-color: #050505;
    --primary: #f0c14b;
    --primary-glow: rgba(240, 193, 75, 0.4);
    --surface: rgba(25, 25, 25, 0.6);
    --surface-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --danger: #ff4757;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Tajawal', 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* === Animated Background === */
.bg-animation {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(240, 193, 75, 0.08), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.03), transparent 25%);
    animation: pulseBg 15s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* === Header / Hero Section === */
header {
    padding: 30px 20px;
    text-align: center;
    position: relative;
}

.logo-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 15px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, var(--primary), transparent);
    animation: rotateBorder 5s linear infinite;
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    background: #000;
}

@keyframes rotateBorder {
    100% { transform: rotate(360deg); }
}

.header-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 5px;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-subtitle {
    font-size: 14px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: 'Outfit', sans-serif;
}

/* === Ultra-Premium Cinematic Splash Screen === */
.splash-screen-v4 {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s ease;
    overflow: hidden;
}

.splash-bg-image {
    position: absolute;
    top: -5%; left: -5%; width: 110%; height: 110%;
    background: url('images/hot_5_latte_1782579523920.png') center/cover no-repeat;
    filter: blur(20px) grayscale(50%);
    animation: slowZoom 8s ease-out forwards;
    z-index: 1;
}

.splash-overlay-dark {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(5,5,5,0.7), rgba(5,5,5,0.95));
    z-index: 2;
}

@keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.splash-content-v4 {
    position: relative;
    z-index: 3;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: floatUp 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

.splash-title-v4 {
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 8px;
    margin: 0;
    text-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    gap: 15px;
}

.gold-text {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(240, 193, 75, 0.4);
}

.splash-divider {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 15px 0;
    animation: expandLine 1s 0.5s cubic-bezier(0.8, 0, 0.2, 1) forwards;
}

@keyframes expandLine {
    100% { width: 150px; }
}

.splash-subtitle-v4 {
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 4px;
    font-size: 0.95rem;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeIn 1s 1s forwards;
}

@keyframes fadeIn {
    100% { opacity: 1; }
}

.splash-loading-bar {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    animation: fadeIn 1s 1.2s forwards;
}

.loading-progress {
    width: 0;
    height: 100%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    animation: fillBar 2.5s cubic-bezier(0.1, 0.7, 0.1, 1) forwards;
}

@keyframes fillBar {
    0% { width: 0; }
    100% { width: 100%; }
}

/* === Floating Navbar (Redesigned Premium) === */
.nav-container {
    position: sticky;
    top: 15px;
    z-index: 100;
    margin: 0 15px 30px;
}

.nav-tabs {
    display: flex;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.nav-tabs::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.tab-btn {
    flex: 1;
    min-width: 100px;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.tab-btn ion-icon {
    font-size: 1.4rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.tab-btn.active {
    background: rgba(240, 193, 75, 0.1);
    border: 1px solid rgba(240, 193, 75, 0.3);
    color: var(--primary);
}

.tab-btn.active ion-icon {
    transform: translateY(-2px);
    color: var(--primary);
    filter: drop-shadow(0 2px 8px rgba(240, 193, 75, 0.6));
}

.tab-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    transition: width 0.3s ease;
}

.tab-btn.active::before {
    width: 30px;
}

/* === Dynamic Grid Layout === */
.menu-section {
    display: none;
    padding: 0 20px 100px;
    animation: fadeInSection 0.5s ease forwards;
}

.menu-section.active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

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

/* === Glassmorphism Item Card === */
.item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.item-card.show {
    opacity: 1;
    transform: translateY(0);
}

.item-card:hover {
    border-color: rgba(240, 193, 75, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
}

.item-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.item-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.item-card:hover .item-image {
    transform: scale(1.1) rotate(2deg);
}

.badge {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(240, 193, 75, 0.3);
    z-index: 2;
}

.item-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-header {
    margin-bottom: 8px;
}

.item-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 2px;
}

.item-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 11px;
    color: #888;
}

.meta-info {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-info ion-icon {
    color: var(--primary);
}

.item-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-price {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.currency {
    font-family: 'Tajawal', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
}

.add-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn ion-icon {
    font-size: 18px;
}

.item-card:hover .add-btn {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* === Cinematic Modal === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #111;
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    padding: 30px 20px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
}

.modal-overlay.active .modal-box {
    transform: scale(1) translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 18px;
}

.modal-icon {
    font-size: 48px;
    color: #25D366; /* WhatsApp Color */
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 25px;
}

.branch-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.branch-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    padding: 15px;
    border-radius: 16px;
    color: #fff;
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.branch-btn ion-icon {
    font-size: 24px;
    color: var(--primary);
}

.branch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.branch-btn.whatsapp-style:hover {
    background: #25D366;
    border-color: #25D366;
    color: #000;
}
.branch-btn.whatsapp-style:hover ion-icon {
    color: #000;
}

@media (min-width: 768px) {
    .menu-section.active {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}
