/* 1. Imports MUST go at the absolute top of the file */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Orbitron:wght@400;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&display=swap');

/* Apply Arabic font when document is in RTL mode */
[dir="rtl"] {
    font-family: 'Cairo', sans-serif;
}

/* Language Toggle Button Styling */
.lang-btn {
    background-color: transparent;
    color: #a9993f;
    border: 1px solid #a9993f;
    border-radius: 20px;
    padding: 5px 15px;
    font-weight: 600;
    transition: all 0.3s ease;   
    background-color: #a9993f;
    color: #000;
    box-shadow: 0px 0px 8px #a9993f;
}

/* Adjust dropdown alignment when switched to RTL */
[dir="rtl"] .dropdown-menu {
    text-align: right;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* 1. Prevent Safari white gaps by matching background color */
html, body {
    background-color: #0b0c10 !important; /* Replace with your dark background color hex */
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Safari mobile viewport height fix */
}

/* 2. Extend dark background into mobile Safari header & bottom notches */
:root {
    color-scheme: dark; /* Signals Safari to render native UI bars in dark mode */
}
body {
    background-color: #0b0b0b;
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

.Nav-Text {
    font-size: 27px !important;
    color: #a9993f !important;
}

/* Main Container (Hero Section) */
.hero-container {
    position: relative;
    width: 100%;
    height: 100vh; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 80px; 
    background: radial-gradient(circle at center, #161616 0%, #0b0b0b 100%);
}

/* Typography Layer Parent */
.text-background-layer {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    display: flex;
    justify-content: center;
    z-index: 1; 
}

/* Wrapper to align the badge flush with the left side of the title */
.title-wrapper {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: max-content;
}
/* Prevent horizontal and vertical overflow caused by Safari toolbar calculations */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Ensure the body fits the dynamic mobile viewport height on Safari */
body {
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
}

/* Fix the mobile intro overlay height calculation for Safari */
@media (max-width: 768px) {
    #intro-overlay {
        height: 100vh !important;
        height: -webkit-fill-available !important; /* Safari-specific dynamic viewport fix */
        overflow: hidden !important;
        position: fixed !important;
        touch-action: none !important;             /* Prevents touch dragging/scrolling on mobile Safari */
    }
}
.navbar-container-fixed {
    position: fixed !important;
    top: 35px !important; 
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1050 !important;
    pointer-events: none;
}

/* Navbar Styling */
.NavBartwo {
    pointer-events: auto;
    background: linear-gradient(110deg, #0d1d85, #4274D9, #0d1d85);
    border-radius: 20px;
    border: 3px solid #8d722f !important;
    box-shadow: 0px 0px 15px #8d722f;
    padding: 12px 24px !important; 
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 95%; 
    max-width: 1400px;
}

/* Responsive Name Badge */
.name-badge {
    display: inline-block;
    background-color: #ffffff;
    color: #000000;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(0.85rem, 1.8vw, 1.8rem);
    padding: 6px 16px;
    border-radius: 4px;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    white-space: nowrap;
}

/* Giant Header */
.giant-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 11.5vw;
    font-weight: 500;
    letter-spacing: 4px;
    line-height: 0.95;
    color: #ffffff;
    text-transform: uppercase;
    width: 100%;
    text-align: left;
}

/* Person's Photo Positioning Layer */
.person-image-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2; 
    height: 80vh;
    display: flex;
    align-items: flex-end;
}

.person-img {
    height: 100%;
    object-fit: contain;
    pointer-events: none; 
}

/* Lower Paragraph Layout */
.content-footer {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-top: auto;
    z-index: 3; 
}

.desc-left, .desc-right {
    width: 35% !important;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem !important;
    line-height: 1.6 !important;
    font-weight: 300 !important; 
    color: #aaaaaa !important;
}

.desc-left { text-align: left !important; }
.desc-right { text-align: right !important; }

.ButtonAll {
    color: #b4a551 !important;
    background: linear-gradient(110deg ,#1932d3,  #243963 );
    width: 24vh;
    border: 2px solid #a9993f !important;
    box-shadow: 0px 0px 10px #a9993f;
    margin: 5px;
}

/* Mobile & Tablet Layout System */
@media (max-width: 992px) {
    .hero-container {
        padding: 30px 20px;
        height: 100vh;
        overflow: hidden;
    }

    .text-background-layer {
        position: absolute;
        top: 30%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;
        margin: 0;
    }

    .title-wrapper {
        align-items: center; 
        max-width: 100%;
    }

    .name-badge {
        font-size: 1.1rem;
        padding: 4px 14px;
        margin-bottom: 4px;
        white-space: nowrap;
    }

    .giant-title {
        font-size: 14vw;
        text-align: center;
        letter-spacing: 2px;
    }

    .person-image-container {
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        height: 55vh;
        width: 100%;
        justify-content: center;
        z-index: 2;
    }

    .person-img {
        height: 100%;
        object-fit: contain;
        mix-blend-mode: lighten; 
    }

    .content-footer {
        position: absolute;
        bottom: 20px;
        left: 0;
        width: 100%;
        padding: 0 20px;
        flex-direction: row !important;
        justify-content: space-between;
        z-index: 3;
    }

    .desc-left, .desc-right {
        width: 45% !important;
        font-size: 0.7rem !important;
        line-height: 1.4;
    }
    
    .desc-left { text-align: left !important; }
    .desc-right { text-align: right !important; }
}

/* ==================================================== */
/* OVERLAY & WHEEL REEL SELECTOR STYLES                 */
/* ==================================================== */

#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0b0b0b;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Left Spinning Wheel Container */
#wheel-container {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 12px;
    direction: rtl;
}

.wheel-pointer {
    color: #a9993f;
    font-size: 1.8rem;
    filter: drop-shadow(0px 0px 6px #a9993f);
    animation: pulsePointer 1s infinite alternate;
}

@keyframes pulsePointer {
    0% { transform: translateX(0px); }
    100% { transform: translateX(-5px); }
}

.wheel-viewport {
    width: 260px;
    height: 70px;
    overflow: hidden;
    background: rgba(11, 11, 11, 0.85);
    border: 2px solid #a9993f;
    border-radius: 12px;
    box-shadow: 0px 0px 20px rgba(169, 153, 63, 0.5);
    backdrop-filter: blur(8px);
    position: relative;
}

.wheel-strip {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
}

.wheel-item {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0px 0px 8px rgba(255, 255, 255, 0.3);
}

.target-item {
    color: #a9993f;
    font-size: 1.6rem;
    font-weight: 900;
    text-shadow: 0px 0px 12px #a9993f;
}

/* Floating language prompt box */
#language-select-box {
    position: absolute;
    text-align: center;
    color: #ffffff;
    z-index: 100001;
    background: rgba(11, 11, 11, 0.9);
    padding: 30px 40px;
    border-radius: 20px;
    border: 2px solid #a9993f;
    box-shadow: 0px 0px 25px #a9993f;
    backdrop-filter: blur(10px);
}

.select-title {
    font-family: 'Montserrat', 'Cairo', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #a9993f;
}

.hidden-element {
    display: none !important;
}

.overlay-dismissed {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 768px) {
    #wheel-container {
        left: 50%;
        top: 20%;
        transform: translate(-50%, 0);
    }
    .wheel-viewport {
        width: 220px;
        height: 60px;
    }
    .wheel-item {
        height: 60px;
        font-size: 1.2rem;
    }
    .target-item {
        font-size: 1.3rem;
    }
}


/* ==================================================== */
/* PREMIUM MOBILE OVERLAYS (Does NOT touch laptop version) */
/* ==================================================== */
@media (max-width: 768px) {

  /* 1. Fullscreen Video Background */
  #intro-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    overflow: hidden !important;
  }

  #intro-video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Spans full height without black bars */
    z-index: 1 !important;
  }

  /* 2. Floating Reel Pointer & Strip (Positioned sleekly above selector) */
/* 2. Floating Reel Pointer & Strip (Shifted slightly right) */
  #wheel-container {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    z-index: 10 !important;
    margin-bottom: 25px !important;

    /* Offset to shift slightly right */
    transform: translateX(16px) !important; 
  }

  .wheel-viewport {
    width: 240px !important;
    height: 55px !important;
    border-radius: 14px !important;
    background: rgba(11, 11, 11, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
  }

  .wheel-item {
    height: 55px !important;
    font-size: 1.15rem !important;
  }

  /* 3. Sleek Floating Glassmorphism Modal */
  #language-select-box {
    position: relative !important;
    z-index: 10 !important;
    width: 90% !important;
    max-width: 350px !important;
    padding: 28px 20px !important;
    background: rgba(11, 11, 11, 0.75) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1.5px solid rgba(169, 153, 63, 0.6) !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(169, 153, 63, 0.2) !important;
  }

/* 3. Sleek Floating Glassmorphism Modal */
  #language-select-box {
    position: relative !important;
    z-index: 10 !important;
    width: 85% !important;
    max-width: 310px !important;            /* Slightly more compact modal */
    padding: 20px 16px !important;          /* Reduced padding */
    background: rgba(11, 11, 11, 0.75) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1.5px solid rgba(169, 153, 63, 0.6) !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(169, 153, 63, 0.2) !important;
    text-align: center !important;
  }

  #language-select-box .select-title {
    font-size: 1.05rem !important;          /* Compact title text */
    font-weight: 700 !important;
    margin-bottom: 16px !important;
    color: #e2c044 !important;
  }

  #language-select-box .lang-options {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;         /* Perfectly centers the buttons */
    gap: 10px !important;
    width: 100% !important;
  }

  /* Specific override so generic .ButtonAll rules don't shrink these to 48% */
  #language-select-box .lang-options .ButtonAll {
    width: 85% !important;                   /* Sized nicely inside the modal */
    max-width: 220px !important;
    height: 38px !important;                 /* Made smaller/sleeker */
    font-size: 0.9rem !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
  }
}


@media (max-width: 768px) {

 .navbar, nav, .NavBartwo {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: auto !important;             /* Allows menu to expand dynamically */
    padding: 0 12px !important;
    margin-top: 10px !important;
    z-index: 9999 !important;
    box-sizing: border-box !important;
  }

  .navbar > div, 
  .navbar .container-fluid, 
  .navbar .container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;          /* Allows collapse container to drop below header */
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-height: 60px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .navbar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: calc(100% - 50px) !important;
    overflow: hidden !important;
  }

  .navbar-brand img, 
  .navbar-brand .profile-thumb {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
  }

  .Nav-Text, 
  .navbar-brand span,
  .navbar-brand {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .navbar-toggler {
    position: relative !important;
    padding: 4px 8px !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
  }

  /* --- INNER COLLAPSE (SINGLE LAYER - REMOVED DOUBLE BORDER) --- */
  .navbar-collapse {
    width: 100% !important;
    background: transparent !important;   /* Uses main navbar background */
    border: none !important;              /* Removes the inner doubled border */
    box-shadow: none !important;         /* Removes inner shadow */
    padding: 20px 0 15px 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .navbar-nav .nav-item, 
  .navbar-nav .nav-link {
    color: #ffd700 !important;           /* Clean gold links */
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    text-align: center !important;
    text-decoration: none !important;
    padding: 4px 0 !important;
    width: 100% !important;
    transition: all 0.2s ease !important;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link:focus {
    color: #ffffff !important;
    transform: scale(1.03);
  }

  .navbar-collapse .lang-toggle, 
  .navbar-collapse button:not(.navbar-toggler) {
    margin-top: 8px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid #ffd700 !important;
    border-radius: 20px !important;
    color: #64b5f6 !important;
    padding: 6px 16px !important;
  }


  /* ==========================================
     2. HERO MAIN CONTAINER
     ========================================== */
  .hero-container, main {
    position: relative !important;
    width: 100vw !important;
    min-height: 100vh !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }


  /* ==========================================
     3. TOP ZONE: SIDE-BY-SIDE CENTERED BUTTONS
     ========================================== */
  .content-footer, 
  .desc-right {
    position: absolute !important;
    top: 85px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    width: 92% !important;
    gap: 8px !important;
    z-index: 50 !important;
  }

  .content-footer .ButtonAll, 
  .desc-right .ButtonAll,
  .ButtonAll {
    display: flex !important;
    justify-content: center !important; /* Horizontally centers text */
    align-items: center !important;     /* Vertically centers text */
    text-align: center !important;
    width: 48% !important;
    max-width: 170px !important;
    height: 42px !important;
    font-size: 0.78rem !important;
    padding: 0 4px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }


  /* ==========================================
     4. BOTTOM ZONE: LARGER HERO COMPOSITE
     ========================================== */
  
  .text-background-layer,
  .title-wrapper {
    position: static !important;
    display: contents !important;
  }

  /* 4A. WHITE NAME BADGE (Moved Left & Higher Up) */
  .name-badge {
    position: absolute !important;
    bottom: 45vh !important;            /* Raised up to avoid head intersection */
    left: 10% !important;               /* Shifted to the left side */
    transform: none !important;
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
    white-space: nowrap !important;
    z-index: 20 !important;
  }

  /* 4B. PORTFOLIO TITLE (Expanded) */
  .giant-title {
    position: absolute !important;
    bottom: 30vh !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 2.8rem !important;        /* Increased size to fill width */
    letter-spacing: 2px !important;
    text-align: center !important;
    margin: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    z-index: 1 !important;
  }

  /* 4C. PORTRAIT PHOTO (Larger & Uses Blank Space) */
  .person-image-container {
    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 360px !important;        /* Substantially larger portrait */
    height: 52vh !important;            /* Takes up 52% of total screen height */
    display: flex !important;
    justify-content: center !important;
    align-items: flex-end !important;
    z-index: 10 !important;
    pointer-events: none !important;
  }

  .person-img {
    height: 100% !important;
    width: auto !important;
    object-fit: contain !important;
    object-position: bottom !important;
  }
}


/* ==================================================== */
/* MOBILE START BUTTON OVERLAY                          */
/* ==================================================== */
#mobile-start-container {
    display: none; /* Hidden by default on Laptop / Desktop */
}

@media (max-width: 768px) {
    #mobile-start-container {
        display: flex !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 100;
        background: rgba(0, 0, 0, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        justify-content: center;
        align-items: center;
        transition: opacity 0.4s ease, visibility 0.4s ease;
    }

    #mobileStartBtn {
        width: 80% !important;
        max-width: 280px !important;
        height: 52px !important;
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        border-radius: 14px !important;
        background: linear-gradient(135deg, #a9993f 0%, #ffd700 100%) !important;
        color: #000 !important;
        border: none !important;
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.4) !important;
        cursor: pointer;
    }

    /* Class added via JS to hide the start container smoothly */
    .start-container-hidden {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}