/* =========================================
   1. FONTS & IMPORTS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Montserrat:wght@400;600;700&display=swap');

:root {
    --font-body: 'Lato', sans-serif;
    --font-title: 'Montserrat', sans-serif;
    --swiss-red: #d00000;
    --swiss-dark: #212529;
    --swiss-blue: #0d6efd;
    --navbar-height: 50px;
}

body {
    font-family: var(--font-body);
    padding-top: var(--navbar-height);
    color: #333;
    width: 100%;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6, .navbar-brand, .hero-title, .section-title {
    font-family: var(--font-title);
}

/* =========================================
   2. NAVBAR (Slim & Vertically Centered)
   ========================================= */
.navbar {
    height: var(--navbar-height);
    padding: 0 !important;
}

.navbar .container {
    height: 100%;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    height: 100%;
    display: flex;
    align-items: center;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.navbar-nav {
    height: 100%;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 400;
    height: 100%;
    display: flex;
    align-items: center;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.text-swiss {
    color: var(--swiss-red);
    font-weight: 800;
}

/* =========================================
   3. LANGUAGE SWITCHER (Compact)
   ========================================= */
#langDropdown {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-menu {
    min-width: 160px;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    padding: 0.25rem 0;
    margin-top: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 6px 15px;
    font-size: 0.85rem;
}

.flag-icon {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 1px rgba(0,0,0,0.3);
    margin-right: 8px;
}

/* RTL Support */
html[dir="rtl"] .flag-icon { margin-right: 0; margin-left: 8px; }
html[dir="rtl"] .dropdown-item { flex-direction: row-reverse; }
html[dir="rtl"] #langDropdown { flex-direction: row-reverse; }

/* =========================================
   4. HERO SECTIONS (Static Images)
   ========================================= */
.hero-banner {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--swiss-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 50px;
    width: 100%;
}

.hero-banner::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 20, 40, 0.55);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 15px;
}

.hero-home { min-height: 100vh; }
.hero-page { height: 60vh; min-height: 350px; }

.hero-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* =========================================
   5. COMPONENTS
   ========================================= */
.feature-box {
    position: relative;
    padding: 25px;
    border: 1px solid #f0f0f0;
    background: #fff;
    height: 100%;
    transition: all 0.3s ease;
}

.feature-box:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}

.icon-circle {
    width: 60px;
    height: 60px;
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--swiss-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* =========================================
   6. MOBILE MENU FIXES
   ========================================= */
@media (max-width: 991px) {
    .navbar-collapse {
        background-color: #ffffff;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        padding: 1rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        z-index: 1000;
    }

    .navbar-nav .nav-link {
        height: auto;
        padding: 10px 0 !important;
        border-bottom: 1px solid #f8f9fa;
    }

    .navbar-nav .dropdown-menu {
        border: none;
        box-shadow: none;
        padding-left: 1rem;
        background-color: #f8f9fa;
        margin-top: 5px;
    }
}

/* =========================================
   7. SECURITY / HONEYPOT STYLES
   ========================================= */
.input-buffer-offset {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 1px;
    width: 1px;
    overflow: hidden;
    opacity: 0;
}

/* =========================================
   8. FORM STYLING (Swiss Chic)
   ========================================= */
.form-control, .form-select {
    background-color: #f9f9f9;
    border: 1px solid #8c8c8c;
    border-radius: 4px;
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease-in-out;
}

.form-control:hover, .form-select:hover {
    border-color: #555;
    background-color: #fff;
}

.form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--swiss-red);
    box-shadow: 0 0 0 4px rgba(208, 0, 0, 0.15);
    outline: none;
}

.form-control::placeholder { color: #999; opacity: 1; }

/* =========================================
   9. PAGE LOADER (Global)
   ========================================= */
#page-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #ffffff;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out;
}

.loader-spinner {
    width: 60px; height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--swiss-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* =========================================
   10. HERO VIDEO SECTION (Consolidated)
   ========================================= */
.hero-video-wrapper {
    position: relative;
    width: 100%;
    
    /* HEIGHT LOGIC: Default to 85% of screen height */
    height: 85vh;
    height: 85svh; /* 'svh' handles mobile browser bars better */
    min-height: 500px;
    
    overflow: hidden;
    background-color: #000;
    cursor: pointer;

    /* FLEX CENTERING (Works on Mobile & Desktop) */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center Vertically */
    align-items: center;     /* Center Horizontally */
}

/* The actual video element */
#hero-video {
    position: absolute;
    top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    z-index: 1;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 2;
    pointer-events: none;
}

/* Text Content */
.hero-video-content {
    position: relative;
    z-index: 3;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    padding: 0 15px;
}

.hero-video-content .btn { pointer-events: auto; }

/* Play/Pause Icon */
.play-indicator {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    font-size: 5rem;
    color: rgba(255,255,255,0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

/* Paused State */
.hero-video-wrapper.paused .play-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.hero-video-wrapper.paused #hero-video { opacity: 0.4; }


/* =========================================
   11. MOBILE & LANDSCAPE ADJUSTMENTS
   ========================================= */

/* General Mobile Font Tweaks */
@media (max-width: 768px) {
    .hero-title { font-size: 1.4rem; }
    .hero-subtitle { font-size: 1.1rem; }
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        hyphens: auto;
    }
}

/* 
   LANDSCAPE SAFETY FIX:
   If screen height is small (phone sideways), we DISABLE vertical centering.
   We force the text to start below the navbar so it doesn't get cut off.
*/
@media (max-height: 500px) {
    .hero-video-wrapper {
        height: auto !important;
        min-height: 100vh;
        
        /* Stop centering vertically */
        justify-content: flex-start; 
        
        /* Push content down below Navbar + extra space */
        padding-top: 80px; 
        padding-bottom: 50px;
    }

    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        hyphens: auto;
    }
}

/* =========================================
   12. HOME PAGE UTILITIES
   ========================================= */

/* Creates a vertical divider between columns on Desktop only */
@media (min-width: 768px) {
    .divide-md > div:not(:last-child) {
        border-right: 1px solid #eee;
    }
}

/* Hover Effect for Service Cards */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(0,0,0,.1) !important;
}

/* Letter Spacing Utility */
.letter-spacing-2 {
    letter-spacing: 2px;
}

/* =========================================
   13. NAVBAR ACTIVE STATES
   ========================================= */

/* The Active Link */
.navbar-nav .nav-link.active {
    color: var(--swiss-red) !important;
    font-weight: 700;
    /* Optional: Add a subtle bottom border to show it's selected */
    border-bottom: 2px solid var(--swiss-red);
}

/* Ensure the Dropdown Parent stays active when a child is selected */
.navbar-nav .nav-item.dropdown .nav-link.active {
    color: var(--swiss-red) !important;
}

/* Submenu items active state */
.dropdown-item.active, .dropdown-item:active {
    background-color: var(--swiss-red);
    color: #fff;
}