/* SwiftCrew Animation System - Clean & Controlled */

/* Main Galaxy Background with #212832 */
body {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Galaxy Layers */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(2, 119, 189, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(2, 136, 209, 0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 20%, rgba(2, 119, 189, 0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 40% 80%, rgba(2, 136, 209, 0.06) 0%, transparent 40%);
    animation: galaxyFloat 20s ease-in-out infinite;
    z-index: -2;
}

@keyframes galaxyFloat {
    0%, 100% { 
        transform: translate(0%, 0%);
        opacity: 0.8;
    }
    25% { 
        transform: translate(-2%, -1%);
        opacity: 1;
    }
    50% { 
        transform: translate(1%, -2%);
        opacity: 0.9;
    }
    75% { 
        transform: translate(-1%, 1%);
        opacity: 1;
    }
}

/* Professional Header Styling */
.header {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 9999;
    animation: headerSlideDown 1s ease-out forwards;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.3s ease;
}

/* Header on scroll */
.header.scrolled {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Clean Header Right Section */
.header-right {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

/* Navigation Language Switcher - Part of Menu */
.nav-language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-lang-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.nav-lang-link.active {
    color: #0277BD;
    background: rgba(2, 119, 189, 0.1);
}

.nav-lang-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Enhanced CTA Button */
.btn-trial {
    background: linear-gradient(135deg, #0277BD 0%, #0288D1 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(2, 119, 189, 0.3);
    border: none;
    cursor: pointer;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    margin: 2px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

@keyframes headerSlideDown {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    60% {
        transform: translateY(10px);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header Elements Animation */
.logo-section {
    animation: fadeInLeft 1.2s ease-out 0.3s forwards;
    opacity: 0;
    transform: translateX(-50px);
}

.main-nav {
    animation: fadeInUp 1.2s ease-out 0.5s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.header-right {
    animation: fadeInRight 1.2s ease-out 0.7s forwards;
    opacity: 0;
    transform: translateX(50px);
}

@keyframes fadeInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes fadeInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Professional Navigation Links */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 400;
    font-size: 15px;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #0277BD;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.95);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: #0277BD;
}

.nav-link.active::after {
    width: 100%;
}

/* CTA Button Animation */
.btn-trial {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-trial::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-trial:hover::before {
    left: 100%;
}

.btn-trial:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(2, 119, 189, 0.4);
}

/* Modern Full-Screen Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 110px;
    left: 0;
    width: 100%;
    height: calc(100vh - 110px);
    height: calc(100dvh - 110px); /* Dynamic viewport height for mobile browsers */
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%); /* Matches header background */
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 9998; /* Below header so header stays visible */
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%); /* Slide from right */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Galaxy overlay for mobile menu */
.mobile-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(2, 119, 189, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(2, 136, 209, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 70%, rgba(2, 119, 189, 0.08) 0%, transparent 40%);
    animation: galaxyFloat 15s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0); /* Slide in from right */
}

/* Mobile Close Button - DISABLED (header toggle handles close) */
.mobile-close {
    display: none !important; /* Completely hidden */
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    transition: all 0.3s ease;
    opacity: 0;
    transform: rotate(180deg);
    z-index: 10000;
}

/* RTL Support for Close Button - Removed as it's now handled at the end of file */

.mobile-menu.active .mobile-close {
    opacity: 1;
    transform: rotate(0deg);
    transition-delay: 0.2s;
}

.mobile-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.mobile-menu.active .mobile-close:hover {
    transform: scale(1.1) rotate(0deg);
}

/* RTL hover state for close button */
html[dir="rtl"] .mobile-menu.active .mobile-close:hover {
    transform: scale(1.1) rotate(0deg);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px 0; /* Top margin for spacing from header edge */
    width: 100%;
    max-width: 500px;
    padding: 0 20px;
}

.mobile-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 20px;
    font-weight: 400;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 12px 20px;
    letter-spacing: 0.3px;
    width: 100%;
    text-align: center;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 0;
    height: 1px;
    background: rgba(2, 119, 189, 0.8);
    transition: all 0.4s ease;
}

.mobile-link:hover {
    color: white;
    transform: translateX(10px);
}

.mobile-link:hover::after {
    width: 100%;
}

.mobile-menu.active .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.active .mobile-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-link:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-link:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-link:nth-child(4) { transition-delay: 0.4s; }
.mobile-menu.active .mobile-link:nth-child(5) { transition-delay: 0.5s; }

/* Mobile Language Switcher */
.mobile-language {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
    padding: 0 20px;
}

.mobile-lang-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    padding: 6px 12px;
    border-radius: 4px;
}

.mobile-lang-link.active {
    color: #0277BD;
    background: rgba(2, 119, 189, 0.1);
}

.mobile-lang-link:hover {
    color: rgba(255, 255, 255, 0.9);
}

.mobile-menu.active .mobile-lang-link {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

/* Mobile CTA */
.mobile-cta {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 20px 0;
    padding: 0 20px;
}

.mobile-menu.active .mobile-cta {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
}

.mobile-cta .btn-trial {
    font-size: 18px;
    padding: 16px 32px;
    box-shadow: 0 8px 25px rgba(2, 119, 189, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        animation-duration: 0.8s;
    }
    
    /* Show mobile toggle */
    .mobile-toggle {
        display: flex;
    }
    
    /* Hide desktop navigation */
    .main-nav {
        display: none;
    }
    
    
    
    /* Mobile toggle animation */
    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Tablet responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .main-nav {
        gap: 30px;
    }
    
    .header-right {
        gap: 15px;
    }
}

/* Mobile link with badge */
.mobile-link-with-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mobile-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.mobile-badge.coming-soon {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border-color: rgba(76, 175, 80, 0.3);
}

/* Ensure mobile menu content is properly contained */
.mobile-menu > * {
    position: relative;
    z-index: 1;
}

/* Prevent scroll when menu is active */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* RTL Overrides - Keep mobile menu centered for BOTH LTR and RTL */
html[dir="rtl"] .mobile-menu {
    text-align: center !important;
    direction: ltr !important; /* Keep layout LTR for consistent centering */
}

html[dir="rtl"] .mobile-nav {
    text-align: center !important;
    align-items: center !important;
    direction: ltr !important;
}

html[dir="rtl"] .mobile-link {
    text-align: center !important;
    direction: rtl; /* Restore RTL for text content only */
}

html[dir="rtl"] .mobile-language {
    justify-content: center !important;
}

html[dir="rtl"] .mobile-cta {
    text-align: center !important;
}

/* LTR close button position (default) */
html[dir="ltr"] .mobile-close,
.mobile-close {
    right: 20px !important;
}

html[dir="ltr"] .mobile-menu.active .mobile-close {
    left: 20px !important;
}

/* RTL close button position */
html[dir="rtl"] .mobile-close {
    right: auto !important;
    left: 20px !important;
}

html[dir="rtl"] .mobile-menu.active .mobile-close {
    opacity: 1;
    transform: rotate(0deg);
    right: auto !important;
    left: 20px !important;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    body::before,
    body::after {
        animation: none;
    }
    
    .light-particle {
        animation: none;
        opacity: 0;
    }
}