:root {
    /* LUXURY PALETTE (Elite Navy) */
    --bg-dark: #020b1a;          /* Rich Royal Navy */
    --bg-panel: #0b162c;         /* Lighter Navy Panel */
    --primary-gold: #D4AF37;     /* Metallic Gold */
    --primary-gold-dim: #aa8c2c;
    --accent-crimson: #a80017;   /* Deep Red (Iraq Flag) */
    --accent-green: #005c2f;     /* Deep Green (Iraq Flag) */
    --text-main: #f1f5f9;        /* Bright Blue-White */
    --text-muted: #94a3b8;       /* Blue-Grey */
    
    /* Variables fixed for forms */
    --text: var(--text-main);
    --muted: var(--text-muted);

    /* Glassmorphism */
    --glass-bg: rgba(11, 22, 44, 0.7); /* Navy Glass */
    --glass-border: rgba(212, 175, 55, 0.2); 
    --glass-highlight: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-heading: 'Cinzel', serif; 
    --font-body: 'Inter', system-ui, sans-serif;

    /* Effects */
    --glow-gold: 0 0 25px rgba(212, 175, 55, 0.25);
    --shadow-card: 0 15px 40px -10px rgba(2, 11, 26, 0.6);
}

::selection {
    background: var(--primary-gold) !important;
    color: #000000 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #000000 !important; /* Force override gradient text */
}

/* TOPBAR BUTTON UPGRADE (Universal Premium Look) */
.topbar .btn {
    font-size: 0.85rem;
    padding: 0 20px;
    height: 40px; 
    border-radius: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Arabic Button Tweaks */
.topbar .btn[href*="ar"] {
    font-family: 'Cairo', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    padding-bottom: 2px; /* Visual centering for Arabic */
}

.topbar .btn.primary {
    /* 2D Premium Gradient (Cleaner) */
    background: linear-gradient(135deg, #F9D976 0%, #D4AF37 100%); 
    border: 1px solid rgba(255,255,255,0.2); /* Subtle rim */
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3); /* Soft Glow */
    color: #000 !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.topbar .btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
    background: linear-gradient(135deg, #ffe58f 0%, #e6bd45 100%); /* Brighter on hover */
}

.topbar .btn.primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
}

.topbar .btn.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff !important;
    box-shadow: none;
}

.topbar .btn.ghost:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold) !important;
}

.topbar .btn.ghost:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent;
}

/* --- CLIENT PORTAL (THE VAULT) --- */
.portal-body {
    /* Hex Pattern + Vault Gradient */
    background-color: #050505;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.15), transparent 60%),
        linear-gradient(to bottom, #020b1a, #000),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4af37' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}

.portal-card {
    width: 90%; /* Mobile friendly */
    max-width: 380px; /* Reduced from 420px */
    padding: 32px; /* Reduced from 40px */
    text-align: center;
    background: rgba(10, 20, 35, 0.9); /* More Opaque */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 20px 60px rgba(0,0,0,0.9), inset 0 0 0 1px rgba(212, 175, 55, 0.1);
    border-radius: 12px;
}

.portal-input {
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--primary-gold);
    font-family: 'Courier New', monospace; /* Vault Vibe */
    letter-spacing: 4px;
    text-align: center;
    font-size: 1.2rem;
    margin: 24px 0;
    transition: all 0.3s;
    border-radius: 4px;
}

.portal-input:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
    outline: none;
}

/* DASHBOARD GRID */
.portal-dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 24px;
}

@media (max-width: 900px) {
    .portal-dashboard-grid { 
        grid-template-columns: 1fr; 
        margin-top: 20px;
    }
}

.dashboard-stat {
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 8px;
    border-left: 2px solid var(--primary-gold);
    margin-bottom: 16px;
    transition: background 0.3s;
}

.dashboard-stat:hover {
    background: rgba(212, 175, 55, 0.05);
}

.status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.status-active { background: rgba(0, 255, 0, 0.05); color: #00ff00; border: 1px solid rgba(0, 255, 0, 0.3); box-shadow: 0 0 10px rgba(0,255,0,0.1); }
.status-pending { background: rgba(255, 165, 0, 0.05); color: orange; border: 1px solid rgba(255, 165, 0, 0.3); }

/* Activity Log Styles */
.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 32px; height: 32px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-gold);
    font-size: 0.9rem;
}

/* Accessibility: Skip to content link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary-gold);
    color: #000;
    padding: 10px 20px;
    z-index: 10001;
    font-weight: bold;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus states */
:focus-visible {
    outline: 2px solid var(--primary-gold);
    outline-offset: 4px;
}

/* Luxury Midnight Mode (10k+ Premium) */
[data-theme="black"] {
    --bg-dark: #000000;          /* Infinite Black */
    --bg-panel: #050505;         /* Void Black Panel */
    --text-main: #ffffff;        /* Crisp White */
    --text-muted: #b0b0b0;       /* Platinum Grey */
    
    /* Premium Glass: Darker, Glossier, Stronger Gold Frame */
    --glass-bg: linear-gradient(160deg, rgba(20, 20, 20, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    --glass-border: rgba(212, 175, 55, 0.6); /* Stronger 60% Opacity Gold Border */
    --glass-highlight: rgba(255, 215, 0, 0.08);

    /* The "Premium" Glow: Gold Ambient Light + Inner Rim */
    --shadow-card: 
        0 0 0 1px rgba(212, 175, 55, 0.15), /* Subtle outer rim */
        0 20px 60px -15px rgba(212, 175, 55, 0.08); /* Dimmer Ambient Glow */
}

/* Override Body Gradient for Midnight Mode (Fixed: Much Dimmer) */
[data-theme="black"] body {
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.06), transparent 70%), /* 6% Opacity (Was 12%) */
        radial-gradient(circle at 50% 100%, rgba(212, 175, 55, 0.02), transparent 50%); /* 2% Opacity */
}

/* Rich Dark Navbar for Midnight */
[data-theme="black"] .topbar {
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

/* Override Card Padding for Tighter, Luxury Feel */
[data-theme="black"] .card, 
[data-theme="black"] .panel, 
[data-theme="black"] .item, 
[data-theme="black"] details {
    padding: 24px; /* Reduced from 32px (User request: "Too big") */
    border-width: 1px; /* Ensure visible frame */
    box-shadow: var(--shadow-card), inset 0 0 20px rgba(212, 175, 55, 0.02); /* Luxury Inner Depth */
}

/* PAGE TRANSITION */
@keyframes fadeInPage {
    from { opacity: 0; filter: blur(5px); }
    to { opacity: 1; filter: blur(0); }
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    width: 100%;
    overflow-x: hidden;
}

/* Global Link Resets (Prevent Purple) */
a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
a:visited {
    color: inherit; /* Prevents purple visited links */
}
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--primary-gold);
    outline-offset: 4px;
}

body {
    background-color: var(--bg-dark);
    /* ... existing body styles ... */
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.8; /* Increased from 1.6 to match Arabic structure */
    overflow-x: hidden;
    width: 100%;
    position: relative;
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(10, 30, 60, 0.4), transparent 50%), /* Navy Glow */
        radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.08), transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(168, 0, 23, 0.08), transparent 40%);
    min-height: 100vh;
    
    /* Page Fade In */
    opacity: 0; /* Start invisible */
    animation: fadeInPage 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}


/* Typography */
h1, h2, h3, .brand b, .stat b {
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
}

/* Layout */
.container {
    max-width: 1400px; /* Increased from 1200px */
    margin: 0 auto;
    padding: 0 24px;
}

/* COMPONENTS: Cards & Panels */
.card, .panel, .notice, .item, details {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Bolder Frame Logic: 1px Border + 1px Inner Shadow Rim */
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(255, 255, 255, 0.03); 
    border-radius: 16px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.4s ease, 
                border-color 0.4s ease;
}

.item:hover, .card:hover {
    transform: translateY(-8px);
    border-color: var(--primary-gold);
    box-shadow: 0 20px 50px -10px rgba(212, 175, 55, 0.2), inset 0 0 30px rgba(212, 175, 55, 0.05); /* Luxury Lift & Inner Glow */
}

/* NOTICE specific styling */
.notice {
    padding: 16px; 
    border-left: 3px solid var(--primary-gold); 
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.05), transparent);
}

/* HEADER */
.topbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(2, 11, 26, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    height: 120px;
    display: flex;
    align-items: center;
    overflow: visible !important;
}

.topbar .container {
    padding: 0 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    position: relative;
    transition: all 0.4s ease;
}

/* The Gold Aura behind the logo */
.brand::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 70px;
    transform: translate(-50%, -50%);
    z-index: -1;
    pointer-events: none;
}

.brand-logo {
    height: 180px; 
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.8));
    animation: logoFloat 6s infinite ease-in-out;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 20px; 
    margin-right: 0 !important; /* Fixed at 0 */
    margin-left: 0; 
    z-index: 1001;
    will-change: transform, filter;
}

footer .brand-logo {
    height: 180px;
    margin-top: 0;
}

.brand:hover .brand-logo {
    transform: scale(1.1); 
    filter: drop-shadow(0 20px 40px rgba(212, 175, 55, 0.3)) brightness(1.1);
}

.brand-text {
    display: flex;
    flex-direction: column;
    white-space: nowrap; 
    position: relative;
    padding-left: 16px; /* Spacing from divider to text */
    margin-left: 0;
}

[dir="rtl"] .brand-text {
    padding-left: 0;
    padding-right: 16px;
}

/* REFINED PROFESSIONAL DIVIDER */
.brand-text::before {
    content: '';
    position: absolute;
    inset-inline-start: 0; 
    top: 10%; /* BALANCED */
    height: 80%; /* BALANCED */
    width: 1px; /* Ultra-thin precision */
    /* Fade tips for elegance */
    background: linear-gradient(
        to bottom, 
        transparent 0%, 
        rgba(212, 175, 55, 0.4) 15%, 
        var(--primary-gold) 50%, 
        rgba(212, 175, 55, 0.4) 85%, 
        transparent 100%
    );
    opacity: 1;
}

/* Footer Reset */
footer .brand {
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
}

footer .brand-text {
    border: none;
    padding-left: 0; /* Remove padding since logo is gone */
    margin-left: 0;
}

footer .brand-text::before {
    display: none; /* Remove Vertical Line */
}

[dir="rtl"] footer .brand-text {
    padding-left: 0;
    padding-right: 0; /* Remove padding since logo is gone */
}

.brand b {
    font-size: 1.8rem; /* Increased from 1.4rem */
    background: linear-gradient(135deg, #fff 20%, var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.brand small {
    font-size: 0.9rem; /* Increased from 0.7rem */
    color: var(--primary-gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--font-body);
}

/* HERO SECTION */
.hero {
    padding: 160px 0 20px; /* Reduced bottom padding from 60px */
    position: relative;
    background-image: linear-gradient(to bottom, rgba(2, 11, 26, 0.95), rgba(2, 11, 26, 0.8)), url('../hero-bg.webp');
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 16px; /* Reduced from 32px */
    background: linear-gradient(to right, #ffffff 40%, var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* GOD TIER READABILITY SHADOW */
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.9)); 
    text-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.sub {
    font-size: 1.25rem;
    color: #e2e8f0;
    max-width: 650px;
    margin-bottom: 24px; /* Reduced from 40px */
    font-weight: 400;
}

/* ... existing styles ... */

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 16px; /* Reduced from 24px */
    color: white;
    position: relative;
    display: inline-block;
}



/* NAVIGATION LINKS */
.links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.links a:not(.btn) {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.1rem; /* Increased from 0.95rem */
    font-weight: 600; /* Bolder */
    position: relative;
    transition: color 0.3s ease;
    white-space: nowrap;
}

/* God Tier Service Image Styling */
.god-tier-image {
    width: 100%;
    height: 220px; /* Exact match to .item min-height */
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: block;
}

.god-tier-image:hover {
    transform: translateY(-10px) scale(1.02); /* Matching .item:hover */
    border-color: var(--primary-gold);
    box-shadow: 0 30px 60px -15px rgba(212, 175, 55, 0.25), inset 0 0 40px rgba(212, 175, 55, 0.08);
    z-index: 10;
}

.links a:not(.btn):hover {
    color: var(--primary-gold);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.6); /* Text Glow */
}

.links a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px; /* Thicker line */
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent); /* Luxury Gradient Line */
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 10px var(--primary-gold);
}

.links a:not(.btn):hover::after {
    width: 100%;
}

/* BUTTONS */
.btn {
    padding: 0 20px;
    height: 48px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    isolation: isolate;
    white-space: nowrap;
    flex: 0 0 auto;
    max-width: fit-content;
    user-select: none;
    transform: translateZ(0);
}

.btn:visited {
    color: inherit;
}

/* Ensure text is above any effects */
.btn span, .btn b {
    z-index: 2;
    position: relative;
}

/* Specific Font Fix for Language Buttons */
.btn[href*="ar/"], .btn[href*="index.html"] {
    font-family: 'Inter', 'Cairo', sans-serif;
}
.btn[href*="ar/index.html"] {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding-top: 0;
}

/* GOD TIER Glow Animation for Primary Button */
@keyframes buttonGlow {
    0% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.2); transform: translateY(0); }
    50% { box-shadow: 0 0 40px rgba(212, 175, 55, 0.5); transform: translateY(-1px); }
    100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.2); transform: translateY(0); }
}

.btn.primary {
    background: linear-gradient(110deg, #aa8c2c 0%, #D4AF37 25%, #FFD700 50%, #D4AF37 75%, #aa8c2c 100%);
    background-size: 200% auto;
    color: #050505 !important;
    border: 1px solid #D4AF37;
    animation: buttonGlow 3s infinite ease-in-out;
}

.btn.primary:hover {
    background-position: right center;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.5), inset 0 0 0 1px rgba(255,255,255,0.3);
    transform: translateY(-2px);
    color: #000 !important;
}

.btn.outline {
    background: transparent;
    color: var(--primary-gold) !important;
    border: 1px solid var(--primary-gold);
}

.btn.outline:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    color: var(--primary-gold) !important;
}

.btn.ghost {
    background: transparent;
    color: var(--text-muted) !important;
    border: 1px solid var(--glass-border);
}

.btn.ghost:hover {
    border-color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.05);
    color: var(--primary-gold) !important;
}

/* 1. Button Press Effect (Stable CSS Only) */
.btn:active, button:active {
    transform: scale(0.98) translateZ(0);
}

/* HERO SECTION */
.hero {
    padding: 200px 0 100px; /* Increased top padding */
    position: relative;
    /* Hero Wallpaper from Brand Pack */
    background-image: linear-gradient(to bottom, rgba(2, 11, 26, 0.95), rgba(2, 11, 26, 0.8)), url('../hero-bg.webp');
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 32px;
    background: linear-gradient(to right, #ffffff 40%, var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.sub {
    font-size: 1.25rem;
    color: #e2e8f0; /* Brighter for readability */
    max-width: 650px;
    margin-bottom: 40px;
    font-weight: 400; /* Increased weight */
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Center content */
    gap: 12px;
    padding: 10px 24px;
    border-radius: 100px;
    
    /* Majestic Gradient Border */
    background: 
        linear-gradient(var(--bg-dark), var(--bg-dark)) padding-box,
        linear-gradient(135deg, var(--primary-gold-dim), var(--primary-gold), #fff, var(--primary-gold-dim)) border-box;
    border: 1px solid transparent;
    
    /* Text Styling */
    color: var(--text-main);
    font-family: var(--font-heading); /* Cinzel */
    font-size: 0.75rem; /* Slightly smaller for mobile stability */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    
    /* Luxury Glow */
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.8), 0 0 20px rgba(212, 175, 55, 0.15);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    white-space: nowrap; /* Prevent ugly wrapping */
    max-width: 100%;
}

/* Shine Effect */
.badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-20deg);
    animation: badgeShine 6s infinite;
}

@keyframes badgeShine {
    0%, 80% { left: -100%; }
    100% { left: 200%; }
}

.badge .dot {
    width: 8px;
    height: 8px;
    background: var(--primary-gold);
    border-radius: 0; /* Diamond Shape */
    transform: rotate(45deg);
    box-shadow: 0 0 10px var(--primary-gold);
    animation: pulse-gold 2s infinite;
    flex-shrink: 0; /* Don't squash the diamond */
    margin-top: -1px; /* Optical center adjustment */
}

.kbd {
    color: var(--text-main);
    border-bottom: 1px solid var(--primary-gold);
    padding-bottom: 2px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 80px;
    align-items: center;
}

/* STATS PANEL */
.stats {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

.stat {
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border-left: 3px solid var(--primary-gold);
}

.stat b {
    color: var(--primary-gold);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 6px;
}

.stat span {
    font-size: 0.9rem;
    color: #f1f5f9;
    display: block; /* Ensure block layout */
    min-height: 2.8em; /* Reserve space for 2 lines to prevent layout shift */
}

/* SECTIONS */
.section {
    padding: 45px 0; /* Set to 45px as requested */
}

.section h2 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    color: white;
    position: relative;
    display: inline-block;
}

.section h2::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: var(--primary-gold);
    margin-top: 10px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.lead {
    color: var(--text-muted);
    margin-bottom: 60px;
    font-size: 1.2rem;
    max-width: 700px;
}

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Balanced 3-column layout */
    gap: 32px;
}

/* God Tier Floating Image (Card-less) */
.floating-service-img {
    width: 100%;
    height: 240px; 
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
    /* LUXURY SMOOTH TRANSITION */
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important; 
    cursor: pointer;
    position: relative;
    display: block; 
    will-change: transform; 
}

/* Subtle Semi-triangle ratio (PC Only) */
@media (min-width: 1251px) {
    .grid img.floating-service-img:nth-child(1),
    .grid img.floating-service-img:nth-child(3) {
        margin-top: 30px; 
    }
}

.grid img.floating-service-img:nth-child(2) {
    margin-top: 0;
}

.floating-service-img:hover {
    transform: translateY(-25px) scale(1.15) !important; 
    filter: drop-shadow(0 30px 60px rgba(212, 175, 55, 0.5)) brightness(1.1) !important;
    z-index: 999 !important;
}


.item {
    padding: 32px;
    min-height: 200px; /* Adjusted to match image-card */
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* God Tier Image Card Specifics */
.item.image-card {
    padding: 12px;
    background: var(--glass-bg); /* Match dark blue of other cards */
    align-items: center;
    min-height: 200px; /* Increased from 165px for better fit */
}

.item.image-card img {
    width: 100%;
    height: 100%;
    max-height: 170px; /* Increased to fill more space */
    object-fit: contain;
    transition: transform 0.6s ease;
}

/* Remove caption styling as text is being removed */
.item.image-card .image-caption {
    display: none;
}

.item.image-card .image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    transform: translateY(10px);
    opacity: 0.8;
    transition: all 0.4s ease;
}

.item:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--primary-gold);
    box-shadow: 0 30px 60px -15px rgba(212, 175, 55, 0.4);
    z-index: 30;
}

.item.image-card:hover img {
    transform: scale(1.1);
}

.item.image-card:hover .image-caption {
    transform: translateY(0);
    opacity: 1;
    color: var(--primary-gold);
}

.item b {
    color: var(--text-main);
    font-size: 1.3rem;
    margin-bottom: 12px;
    display: block;
    font-family: var(--font-heading);
}

/* FORMS */
.form {
    margin-top: 20px;
}

.form label {
    display: block;
    font-size: 0.85rem;
    color: var(--primary-gold);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form input, .form textarea {
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}

.form input:focus, .form textarea:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* FAQ OPTIMIZATION */
details {
    padding: 20px 24px;
    margin-bottom: 16px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden; /* Required for clean animation */
    transition: background 0.3s ease, border-color 0.3s ease;
}

details:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(212, 175, 55, 0.3);
}

details[open] {
    background: rgba(212, 175, 55, 0.05);
    border-color: var(--primary-gold);
}

details summary {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    user-select: none;
}

details summary::-webkit-details-marker {
    display: none;
}

/* Custom Arrow Icon */
details summary::after {
    content: '';
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--primary-gold);
    border-bottom: 2px solid var(--primary-gold);
    transform: rotate(45deg);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin-left: 12px; /* LTR spacing */
}

/* RTL Arrow Support */
[dir="rtl"] details summary::after {
    margin-left: 0;
    margin-right: 12px;
}

details[open] summary::after {
    transform: rotate(225deg); /* Rotate to point up */
}

/* Content Animation */
details p {
    margin-top: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInSlide 0.4s forwards 0.1s;
}

@keyframes fadeInSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* FOOTER */
footer {
    border-top: 1px solid var(--glass-border);
    background: #020202;
    padding: 80px 0 40px;
    margin-top: 0;
    width: 100%;
    position: relative;
}


.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Balanced ratio */
    gap: 80px;
    align-items: center;
    justify-content: space-between; /* PC Split Alignment */
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--primary-gold);
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1); /* "Signature" Ease */
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* HAMBURGER */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--primary-gold);
    font-size: 1.5rem;
    cursor: pointer;
}

/* DUAL MENU VISIBILITY LOGIC */
.mobile-only {
    display: none !important;
}

/* MOBILE */
@media (max-width: 1250px) {
    /* Mobile Navbar Optimization */
    .topbar {
        height: 120px; /* Increased for larger logo */
    }

    .brand-logo {
        height: 180px; /* Standardized to 180px */
        margin-top: 15px; 
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }

    .hero h1 { font-size: clamp(2rem, 8vw, 2.8rem); } /* Safer scaling */
    .hero-grid { grid-template-columns: 1fr; }
    
    /* Mobile Footer & Contact Fixes */
    .footer-grid { 
        grid-template-columns: 1fr !important; /* Stack vertically */
        gap: 40px; 
        text-align: center; /* Center all text */
        justify-content: center !important; /* Force center on mobile */
    }

    .footer-brand, .footer-links-container {
        align-items: center !important;
        text-align: center !important;
        justify-content: center !important;
    }
    
    .footer-links-container .muted {
        text-align: center !important;
    }
    
    .small {
        justify-content: center !important;
    }
    
    /* Ensure ALL Grids stack */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }
    
    .floating-service-img {
        height: 200px !important; /* Proper size for mobile stacking */
        margin-top: 0 !important; /* Remove triangle offset on mobile */
    }
    
    /* Ensure Contact Grid stacks */
    #contact .grid, #process .grid, #services .grid {
        grid-template-columns: 1fr !important;
    }
    
    .form-row { grid-template-columns: 1fr; }
    
    /* Input Fix for Mobile */
    .form input, .form textarea {
        max-width: 100% !important;
        min-width: 0 !important; /* Allow shrinking */
    }
    
    /* Card Padding Fix for Mobile */
    .card, .panel, .item, details {
        padding: 24px !important; /* Consistent padding */
    }
    
    .container {
        padding: 0 24px; /* Maintain safe gutter */
    }
    
    /* Mobile Footer Links Alignment */
    .footer-links-container {
        align-items: center !important; /* Center align on mobile */
        padding-top: 0 !important; /* Remove PC alignment gap */
    }
    
    .footer-links-container .small {
        justify-content: center !important; /* Center links */
    }
    
    .footer-links-container .muted {
        text-align: center !important; /* Center text */
    }
    
        /* Fix Mobile Sidebar (Floating Panel Upgrade) */
    .links {
        display: flex; 
        visibility: hidden; 
        flex-direction: column;
        position: fixed; /* FIXED positioning */
        top: 20px; /* Floating Offset */
        bottom: 20px; /* Floating Offset */
        right: 20px; /* Floating Offset */
        left: auto;
        width: 70%; 
        max-width: 280px; 
        height: auto; 
        max-height: calc(100vh - 40px); /* Account for top/bottom offset */
        border-radius: 20px; /* Smooth Floating Look */
        
        /* Theme-Aware Background with Glassmorphism */
        background-color: var(--bg-dark); /* Solid Fallback */
        background: var(--glass-bg); /* Glass Overlay */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        
        /* PHYSICAL BOUNDARIES */
        border: 1px solid rgba(212, 175, 55, 0.2); /* Full Border */
        border-left: 2px solid var(--primary-gold); /* Accent */

        box-shadow: -15px 0 40px rgba(0,0,0,0.9), 0 0 0 100vw rgba(0,0,0,0.8); 
        
        padding: max(80px, env(safe-area-inset-top) + 20px) 32px 40px;
        transform: translateX(110%); /* Ensure full exit */
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
        z-index: 99999; /* Highest priority */
        overflow-y: auto; 
        overscroll-behavior: contain; /* Prevent body scroll chaining */
        -webkit-overflow-scrolling: touch; /* iOS Smooth Scroll */
    }
    
        .links::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(180deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
            pointer-events: none;
        }
    
        .links.open {
            visibility: visible; 
            transform: translateX(0);
            animation: none;
        }    

    .links a {
        font-size: 1.1rem;
        width: fit-content; /* FIX: Glow only under text */
        color: white;
        padding: 8px 0; /* Reduce padding since it's fit-content */
        margin-bottom: 24px; /* Space between items */
        position: relative;
        text-align: left;
    }

        /* GOLD GLOW UNDERLINE (Strictly under text) */
        .links a:not(.btn)::after {
            content: '';
            position: absolute;
            bottom: -4px;
            left: 0;
            width: 100%; /* Matches text width due to fit-content */
            height: 2px; /* Increased height */
            background: var(--primary-gold);
            box-shadow: 0 0 10px var(--primary-gold); /* Stronger permanent glow */
            opacity: 0.8; /* Increased base opacity */
            transition: all 0.3s ease;
            transform: scaleX(1); 
            transform-origin: right;
        }
    
        .links a:not(.btn):hover::after {
            opacity: 1;
            box-shadow: 0 0 20px var(--primary-gold), 0 0 40px var(--primary-gold); /* Even more intense */
            height: 3px;
            transform-origin: left;
        }
    .links a.btn {
        width: 100%; /* Buttons can stay full width of the drawer */
        margin-top: 10px;
    }
    
    .links a.btn {
        margin-top: 12px;
        text-align: center;
        justify-content: center;
        border: 1px solid var(--primary-gold); 
        width: auto; /* Allow natural width */
        min-width: 180px; /* Ensure decent tap target */
        max-width: 100%;
        align-self: center; /* Center in the drawer */
        padding: 0 24px;
    }

    .hamburger {
        display: block;
    }
}

/* Address Box Optimization */
.address-box {
    border: 1px solid var(--primary-gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), transparent);
    transition: all 0.3s ease;
}
.address-box:hover {
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    transform: translateY(-5px);
}

/* Contact Section Gap Fix */
#contact {
    padding-bottom: 40px;
}

/* RTL SUPPORT (Arabic) */
[dir="rtl"] {
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;
}

[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: var(--font-body);
}

/* Only apply drawer styles to mobile menu in RTL */
[dir="rtl"] .links.mobile-only {
    right: auto;
    left: 0; /* Drawer on Left for Arabic */
    border-left: none;
    border-right: 2px solid var(--primary-gold); /* Visible Gold Border */
    transform: translateX(-100%); /* Start off-screen Left */
    box-shadow: 15px 0 40px rgba(0,0,0,0.8);
}

[dir="rtl"] .links.mobile-only.open {
    transform: translateX(0);
}

[dir="rtl"] .links.open {
    transform: translateX(0);
}

[dir="rtl"] .brand {
    /* Natural flow: Logo Right, Text Left */
    gap: 16px;
}

[dir="rtl"] .brand-logo {
    margin-right: 0 !important;
    margin-left: -20px !important; /* Specific -20px Adjustment for Arabic */
}

[dir="rtl"] .links a:not(.btn)::after {
    left: auto;
    right: 0;
}

[dir="rtl"] .notice, [dir="rtl"] .stat {
    border-left: none;
    border-right: 3px solid var(--primary-gold);
}

[dir="rtl"] details summary::after {
    right: auto;
    left: 0;
}

[dir="rtl"] details summary {
    padding-right: 0;
    padding-left: 20px;
}

[dir="rtl"] .form-row {
    direction: rtl;
}

[dir="rtl"] .hero h1 {
    background: linear-gradient(to left, #ffffff 40%, var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Flip margins for spacing */
[dir="rtl"] .brand { gap: 16px; }
[dir="rtl"] .btn { gap: 10px; }
[dir="rtl"] .badge { gap: 10px; }

/* TEXT CONTENT (Legal Pages) */
.text-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.text-content h1 {
    font-size: 2.5rem;
    margin-bottom: 24px;
    background: linear-gradient(90deg, #fff, var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-content h3 {
    color: var(--primary-gold);
    margin-top: 40px;
    margin-bottom: 16px;
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 8px;
}

.text-content h4 {
    color: white;
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.text-content ul {
    list-style-position: inside;
    margin-bottom: 24px;
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.text-content li {
    margin-bottom: 8px;
}

/* GOD TIER SCROLLBAR */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #020202;
    border-left: 1px solid rgba(255,255,255,0.05);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-gold-dim), var(--primary-gold));
    border-radius: 5px;
    border: 2px solid #020202; /* Creates padding effect */
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-gold), #fff);
}

/* GOLD TEXT SHIMMER */
@keyframes shine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.brand b {
    background: linear-gradient(120deg, #fff 30%, var(--primary-gold) 50%, #fff 70%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 6s linear infinite;
}

/* Hero Badge Pulse */
.badge .dot {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(212, 175, 55, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* ENHANCED CARD HOVER (More pronounced) */
.item:hover, .card:hover {
    transform: translateY(-10px) scale(1.02); /* Stronger Lift & Scale */
    border-color: var(--primary-gold);
    box-shadow: 
        0 30px 60px -15px rgba(212, 175, 55, 0.25), /* Deeper Shadow */
        inset 0 0 40px rgba(212, 175, 55, 0.08); /* Stronger Inner Glow */
    z-index: 10; /* Ensure it pops over others */
}

/* THEME SWITCH TRANSITION */
body.animating-theme {
    opacity: 1 !important; /* Prevent fallback to 0 */
    animation: themeSwitch 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes themeSwitch {
    0% { opacity: 1; filter: blur(0); }
    50% { opacity: 0.8; filter: blur(4px); } /* Blur out */
    100% { opacity: 1; filter: blur(0); } /* Focus back */
}

/* Special Blurred Hero Background for Main Site */
.hero-blurred-bg {
    position: relative;
}

.hero-blurred-bg::before {
    content: '';
    position: absolute;
    top: 140px; /* Adjusted to sit right under the 160px navbar overlap */
    left: 0;
    width: 100%;
    height: 500px; /* Reduced to prevent overlap */
    background-image: url('../5.png');
    background-size: contain; /* Ensure full image is visible */
    background-repeat: no-repeat;
    background-position: center top;
    filter: blur(0px); /* NO BLUR on the eagle itself for maximum impact */
    z-index: -2;
    opacity: 1; /* Full opacity */
    pointer-events: none;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.hero-blurred-bg::after {
    content: '';
    position: absolute;
    top: 140px;
    left: 0;
    width: 100%;
    height: 500px; /* Match height */
    /* Luxury radial fade to blend edges into dark theme */
    background: radial-gradient(circle at center, transparent 30%, var(--bg-dark) 80%);
    z-index: -1;
    pointer-events: none;
}

/* 404 Page Specific Styling */
.page-404 {
    position: relative;
    /* No overflow: hidden here to allow scrolling if needed, but background is fixed */
}

.page-404::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../og.png'); /* Relative to css file */
    background-size: cover;
    background-position: center;
    filter: blur(8px); /* The requested blur */
    z-index: -2;
    transform: scale(1.1); /* Prevent blurred edges from showing white */
}

.page-404::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Dark overlay for readability */
    z-index: -1;
}


/* Professional Theme Toggle (Rectangular) */
.theme-toggle {
    height: 48px;
    width: auto;
    min-width: 48px;
    padding: 0 16px !important;
    border-radius: 8px; /* Matching other buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
}

.theme-toggle:hover {
    background: rgba(212, 175, 55, 0.08);
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

/* Footer Brand Alignment Fix */
footer .brand {
    display: flex;
    align-items: center; /* Vertically center logo and text */
    gap: 8px;
    margin-bottom: 24px;
}

footer .brand-logo {
    height: 100px; /* Match standard size or adjust if needed */
    margin-top: -5px; /* Slight lift to align optically with text */
}

footer .brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center vertically */
}


@media (max-width: 768px) {
    .god-tier-image {
        max-width: 90% !important; /* Force larger on mobile */
    }
}



#services {
    padding-top: 45px !important;
}


@media (max-width: 1250px) {
    .item {
        min-height: auto !important; /* Allow natural height on mobile */
        padding: 24px !important;
    }
}


@media (max-width: 1250px) {
    .footer-links-container {
        padding-top: 0 !important; /* Remove PC alignment gap on mobile */
    }
}


/* FORCE MOBILE VIEW (Script Support for S25 Ultra/Large Phones) */
body.mobile-view .desktop-only { display: none !important; }
body.mobile-view .mobile-only { display: flex !important; }
body.mobile-view .hamburger { display: block !important; }

/* Apply Drawer Styles to Forced Mobile View */
body.mobile-view .links {
    /* Copy of critical drawer styles */
    display: flex; 
    visibility: hidden; 
    flex-direction: column;
    position: fixed;
    top: 20px; bottom: 20px; right: 20px; left: auto;
    width: 70%; max-width: 280px;
    height: auto; max-height: calc(100vh - 40px);
    border-radius: 20px;
    
    /* Theme-Aware Background */
    background-color: var(--bg-dark);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid rgba(212, 175, 55, 0.2);
    border-left: 2px solid var(--primary-gold); 
    box-shadow: -15px 0 40px rgba(0,0,0,0.9);
    padding: max(80px, env(safe-area-inset-top) + 20px) 32px 40px;
    transform: translateX(110%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    z-index: 99999;
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
}

body.mobile-view .links.open {
    visibility: visible;
    transform: translateX(0);
}

body.mobile-view .links a {
    font-size: 1.1rem;
    width: fit-content;
    padding: 8px 0;
    margin-bottom: 24px;
    text-align: left;
}

body.mobile-view .links a.btn {
    width: 100%;
    text-align: center;
}

/* RTL Support for Forced Mobile */
[dir='rtl'] body.mobile-view .links {
    right: auto; left: 0;
    border-left: none; border-right: 2px solid var(--primary-gold);
    transform: translateX(-100%);
}
[dir='rtl'] body.mobile-view .links.open {
    transform: translateX(0);
}


/* Fix Hero Background Visibility on Mobile (S25 Ultra) */
@media (max-width: 1250px) {
    .hero-blurred-bg::before {
        height: 80vh !important; /* Allow it to be taller */
        background-size: cover !important; /* Fill width */
        mask-image: linear-gradient(to bottom, black 70%, transparent 100%) !important; /* Fade later */
        -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%) !important;
        top: 0 !important; /* Start from very top */
    }
    
    .hero-blurred-bg::after {
        height: 80vh !important;
        top: 0 !important;
    }
}





/* --- HERO CONTENT OVERFLOW FIX (S25 Ultra) --- */
@media (max-width: 1250px) {
    /* 1. Wrap Buttons so they don't burst the screen */
    .hero-cta {
        flex-wrap: wrap !important;
        justify-content: center; /* Center them when stacked */
        width: 100%;
        gap: 12px !important; /* Reduce gap to fit better */
    }
    
    .hero-cta .btn {
        width: 100%; /* Make full width for better touch targets */
        max-width: 100%;
        justify-content: center;
        margin: 0 !important; /* Reset margins */
    }
    
    /* 2. Fix Badge Overflow */
    .badge {
        display: flex !important; /* Force block flex */
        white-space: normal !important; /* Allow text to wrap */
        height: auto !important; /* Allow growth */
        text-align: center;
        line-height: 1.4;
        max-width: 85vw !important; /* Force constraint */
        margin-left: auto;
        margin-right: auto;
    }
    
    /* 3. Safety for H1 */
    .hero h1 {
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
    }
    
    /* 4. Container Safety */
    .hero .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
        width: 100%;
        max-width: 100%;
        overflow: hidden; /* Clip internal overflows */
    }
}


/* --- DEEP SEARCH FIX: GRID BLOWOUT & FLEX WRAPPING --- */

/* 1. Prevent CSS Grid Blowout (The invisible force pushing width) */
.hero-grid > div {
    min-width: 0; /* Critical: Allows grid item to shrink below content size */
    max-width: 100%;
}

/* 2. Global Word Breaking (Prevent long words from forcing width) */
p, h1, h2, h3, span, .btn {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* 3. Badge Specific Safety */
.badge {
    max-width: 90vw !important; /* Never exceed screen width */
    white-space: normal !important; /* Force wrap */
    height: auto !important;
    flex-wrap: wrap; /* Wrap the dot and text if needed */
    text-align: center;
    justify-content: center;
}

/* 4. Hero CTA Safety */
@media (max-width: 1250px) {
    .hero-cta {
        flex-direction: column; /* Stack vertically on small screens */
        width: 100%;
    }
    .hero-cta .btn {
        width: 100%;
    }
}


/* --- NUCLEAR OPTION: FLEXBOX SWITCH (S25 Ultra Fix) --- */
@media (max-width: 1250px) {
    /* 1. Abandon Grid for Flexbox on Mobile (More Robust) */
    .hero-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 40px !important; /* Consistent gap */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. Target ALL Children (div AND aside) */
    .hero-grid > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important; /* Allow shrinking */
        flex-shrink: 1 !important;
    }

    /* 3. Specific Fix for the Aside Card */
    .hero-grid > aside.card {
        margin-top: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}


/* --- SAMSUNG INTERNET / WEBKIT CLIP BUG FIX --- */
/* Fixes 'extends outside screen' caused by badge animation bleeding through overflow:hidden */
.badge {
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translate3d(0, 0, 0); /* Force Hardware Acceleration */
}

/* Ensure sub-text doesn't overflow */
.sub {
    max-width: 100%;
    overflow-wrap: break-word;
}


/* --- ARABIC LUXURY & LAYOUT FIX --- */
[dir='rtl'] {
    /* Unified Arabic Typography: Tajawal (Refined & Modern) */
    --font-heading: 'Tajawal', 'Cairo', sans-serif;
    --font-body: 'Tajawal', 'Cairo', sans-serif;
    line-height: 1.6; /* Fix Cut Text */
}

[dir='rtl'] body {
    padding-bottom: 5px; /* Prevent Descender Clip */
}



[dir='rtl'] .brand-text {
    padding-right: 16px !important;
    padding-left: 0 !important;
    text-align: center; /* CENTERED SLOGAN FIX */
    align-items: center; /* CENTERED SLOGAN FIX */
}

[dir='rtl'] .brand-text::before {
    right: 0;
    left: auto;
}

/* Fix Hero Text Gradient in RTL */
[dir='rtl'] .hero h1 {
    background: linear-gradient(to left, #ffffff 40%, var(--primary-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.4; /* Arabic needs more height */
}


/* --- BRAND IDENTITY PROTECTION --- */
/* Ensure the Logo Text ALWAYS uses Cinzel (The 'Q' design) */
.brand b {
    font-family: 'Cinzel', serif !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
}

/* Ensure the Slogan uses the correct font per language */
[dir='rtl'] .brand small {
    font-family: 'Tajawal', sans-serif !important; 
    letter-spacing: 0 !important;
    font-size: 1.1rem !important; /* Increased size for visibility */
    font-weight: 700 !important;
    margin-top: 2px;
}

/* Fix Infinite Size / Overflow Issues */
.topbar, footer, .links.mobile-only {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.topbar .container, footer .container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.brand-text {
    max-width: calc(100vw - 150px); /* Prevent text from pushing navbar width */
    overflow: hidden;
}


/* --- ARABIC TYPOGRAPHY WEIGHTS --- */
/* Explicit Weight for Arabic Majestic Look */
[dir='rtl'] h1, [dir='rtl'] h2, [dir='rtl'] h3 {
    font-weight: 800 !important; /* Extra Bold for headlines */
    letter-spacing: 0 !important;
}

[dir='rtl'] p, [dir='rtl'] span, [dir='rtl'] .btn, [dir='rtl'] a {
    font-weight: 500 !important; /* Medium for better readability */
}

