/* FSG Brokers - Custom Styles */

* {
    box-sizing: border-box;
}

body {
    background-color: #030508;
    color: #E2E8F0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Responsive Typography */
@media (max-width: 640px) {
    html { font-size: 14px; }
}
@media (min-width: 641px) and (max-width: 1024px) {
    html { font-size: 15px; }
}
@media (min-width: 1025px) {
    html { font-size: 16px; }
}
@media (min-width: 1920px) {
    html { font-size: 18px; }
}
@media (min-width: 3840px) {
    html { font-size: 24px; }
}
  
.cyber-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    bottom: -50%;
    left: -50%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, transparent 60%);
}

@media (max-width: 768px) {
    .cyber-grid {
        background-size: 20px 20px;
    }
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

.holo-card {
    background: rgba(9, 14, 26, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.holo-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.1), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
    pointer-events: none;
}

.holo-card:hover::before {
    left: 150%;
    transition: 0.7s;
}

.core-container { 
    transform-style: preserve-3d; 
    perspective: 1200px; 
}

.ring-3d { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform-style: preserve-3d; 
    border-radius: 50%; 
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1); 
}

.neon-text-blue { text-shadow: 0 0 10px rgba(0, 240, 255, 0.8); }
.neon-text-purple { text-shadow: 0 0 15px rgba(189, 0, 255, 0.8); }
.neon-text-gold { text-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #030508; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #00F0FF; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* Mobile Menu Animations */
.mobile-menu-enter {
    animation: slideIn 0.3s ease-out;
}

/* Mobile Menu Styles */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Ensure mobile menu is clickable */
@media (max-width: 1023px) {
    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed !important;
        inset: 0 !important;
        z-index: 60 !important;
        background-color: #030508 !important;
        overflow-y: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Mobile menu button */
    .mobile-menu-button {
        z-index: 70 !important;
        position: relative !important;
        display: block !important;
        visibility: visible !important;
        cursor: pointer !important;
        pointer-events: auto !important;
    }
    
    /* Ensure button is visible on mobile */
    @media (max-width: 1023px) {
        .mobile-menu-button {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
        }
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* Force mobile menu visibility */
@media (max-width: 1023px) {
    .lg\\:hidden {
        display: block !important;
    }
    
    /* Ensure hamburger button is always visible on mobile */
    #mobile-menu-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        z-index: 70 !important;
        position: relative !important;
    }
    
    /* Ensure menu overlay is properly styled */
    #mobile-menu-overlay,
    #mobile-menu-overlay-fallback {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 60 !important;
        background-color: #030508 !important;
        overflow-y: auto !important;
    }
    
    /* Style for fallback menu */
    #mobile-menu-overlay-fallback {
        padding-top: 4rem;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 1rem;
        cursor: pointer; /* برای backdrop */
    }
    
    #mobile-menu-overlay-fallback > div {
        cursor: default; /* محتوای منو */
        pointer-events: auto;
    }
    
    #mobile-menu-overlay-fallback button {
        cursor: pointer !important;
        transition: all 0.3s ease;
        pointer-events: auto;
    }
    
    #mobile-menu-overlay-fallback button:hover {
        opacity: 0.8;
    }
    
    /* دکمه بستن */
    #mobile-menu-close-btn {
        position: relative;
        z-index: 61 !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        background: rgba(0, 240, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        outline: none !important;
        transition: all 0.2s ease !important;
    }
    
    #mobile-menu-close-btn:hover {
        background-color: rgba(0, 240, 255, 0.2) !important;
        border-color: rgba(0, 240, 255, 0.5) !important;
        transform: scale(1.05);
    }
    
    #mobile-menu-close-btn:active {
        transform: scale(0.95);
        background-color: rgba(0, 240, 255, 0.3) !important;
    }
    
    /* مطمئن شو که دکمه بستن قابل کلیک است */
    #mobile-menu-close-btn * {
        pointer-events: none;
    }
    
    /* مطمئن شو که دکمه همبرگر در navbar هم کار می‌کند */
    #mobile-menu-toggle {
        position: relative;
        z-index: 70 !important;
    }
    
    /* وقتی منو باز است، دکمه همبرگر باید X نشان دهد */
    #mobile-menu-overlay-fallback[style*="display: block"] ~ nav #mobile-menu-toggle svg,
    body:has(#mobile-menu-overlay-fallback[style*="display: block"]) #mobile-menu-toggle svg {
        /* این کار نمی‌کند، باید با JS انجام شود */
    }
    
    /* Hide on desktop */
    @media (min-width: 1024px) {
        #mobile-menu-toggle,
        #mobile-menu-overlay {
            display: none !important;
        }
    }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .holo-card:hover::before {
        left: -100%;
    }
}

/* TV & Large Display Optimizations */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
}

@media (min-width: 3840px) {
    .container {
        max-width: 3200px;
    }
}

/* Prevent text selection on mobile for better UX */
@media (max-width: 768px) {
    button, a {
        -webkit-tap-highlight-color: transparent;
    }
}
