/* ConnectIQ Modal Framework - Dark Blue Tint + Bouncy Momentum Scrollbars */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: relative;
    background: rgba(59, 130, 246, 0.08);
    backdrop-filter: blur(40px) saturate(200%) contrast(120%);
    -webkit-backdrop-filter: blur(40px) saturate(200%) contrast(120%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    max-width: 90vw;
    max-height: 75vh;
    overflow: hidden;
    transform: scale(0.85) translateY(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 32px 64px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.modal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 25%),
        radial-gradient(circle at 80% 80%, rgba(34, 211, 238, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 40% 70%, rgba(59, 130, 246, 0.06) 0%, transparent 30%),
        linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, transparent 50%, rgba(34, 211, 238, 0.04) 100%);
    border-radius: 24px;
    pointer-events: none;
    z-index: 1;
}

.modal-container::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        145deg,
        rgba(59, 130, 246, 0.15) 0%,
        transparent 25%,
        transparent 75%,
        rgba(34, 211, 238, 0.1) 100%
    );
    border-radius: 26px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-container:hover::after {
    opacity: 1;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-container.large { 
    width: 900px; 
}

/* ENHANCED BOUNCY SCROLL CONTENT WITH DARK BLUE TINT */
.modal-content {
    position: relative;
    z-index: 2;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 75vh;
    /* Webkit momentum scrolling for iOS bouncy effect */
    -webkit-overflow-scrolling: touch;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.6) rgba(59, 130, 246, 0.1);
}

/* Enhanced Custom Scrollbar for Webkit browsers */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    margin: 10px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, 
        rgba(34, 211, 238, 0.8) 0%, 
        rgba(59, 130, 246, 0.6) 50%,
        rgba(34, 211, 238, 0.8) 100%
    );
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 
        0 2px 10px rgba(34, 211, 238, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, 
        rgba(34, 211, 238, 1) 0%, 
        rgba(59, 130, 246, 0.8) 50%,
        rgba(34, 211, 238, 1) 100%
    );
    box-shadow: 
        0 4px 20px rgba(34, 211, 238, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.modal-content::-webkit-scrollbar-corner {
    background: transparent;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 40px 24px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(59, 130, 246, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(20px);
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 40px;
    right: 40px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 20%, 
        rgba(255, 255, 255, 0.2) 80%, 
        transparent 100%
    );
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 255, 255, 0.85) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: rgba(59, 130, 246, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-close:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.95);
}

.modal-body {
    padding: 32px 40px 40px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    position: relative;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 14px 0;
    padding: 18px 20px;
    background: rgba(59, 130, 246, 0.06);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%
    );
}

.feature-list li:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.feature-list .check {
    color: #22d3ee;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(34, 211, 238, 0.4);
    font-size: 16px;
}

.feature-list .title {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 4px;
}

.feature-list .description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.stat-card {
    background: rgba(59, 130, 246, 0.08);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 24px 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(34, 211, 238, 0.6) 0%, 
        rgba(59, 130, 246, 0.8) 50%, 
        rgba(34, 211, 238, 0.6) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-number {
    font-size: 38px;
    font-weight: 800;
    background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

.stat-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.alert {
    padding: 18px 24px;
    border-radius: 14px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
    opacity: 0.6;
}

.alert.success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.alert.info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* HIGH SPECIFICITY SPACEY DARK NAVY BUTTONS - Enhanced for glass theme */
button.modal-btn, .modal-btn {
    padding: 12px 24px !important;
    border-radius: 25px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    border: 2px solid rgba(34, 211, 238, 0.6) !important;
    font-size: 14px !important;
    background: rgba(26, 35, 50, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    color: #22d3ee !important;
    box-shadow: 
        0 0 20px rgba(34, 211, 238, 0.2) !important,
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
    overflow: hidden !important;
    font-family: inherit !important;
}

button.modal-btn:hover, .modal-btn:hover {
    background: rgba(42, 52, 71, 0.9) !important;
    border-color: rgba(34, 211, 238, 0.8) !important;
    box-shadow: 
        0 0 30px rgba(34, 211, 238, 0.4) !important,
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px) !important;
    color: #67e8f9 !important;
}

button.modal-btn:active, .modal-btn:active {
    transform: translateY(0) !important;
    box-shadow: 
        0 0 20px rgba(34, 211, 238, 0.3) !important,
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

button.modal-btn::before, .modal-btn::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(34, 211, 238, 0.3), 
        transparent
    ) !important;
    transition: left 0.6s ease !important;
}

button.modal-btn:hover::before, .modal-btn:hover::before {
    left: 100% !important;
}

/* Subtle texture overlay for extra glass effect */
.modal-container .modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(59, 130, 246, 0.03) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.3;
}

/* MOBILE RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .modal-container {
        max-width: 95vw;
        max-height: 80vh;
        margin: 20px;
        width: 100%;
        border-radius: 20px;
    }
    
    .modal-content {
        max-height: 80vh;
    }
    
    .modal-header {
        padding: 20px 20px 16px 20px;
    }
    
    .modal-title {
        font-size: 22px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-list li {
        padding: 16px 18px;
    }
    
    /* Enhanced mobile scrollbar */
    .modal-content::-webkit-scrollbar {
        width: 6px;
    }
    
    .modal-content::-webkit-scrollbar-thumb {
        border-radius: 6px;
    }
}

/* SMALL MOBILE PHONES */
@media (max-width: 480px) {
    .modal-container {
        max-width: 98vw;
        max-height: 85vh;
        margin: 10px;
        border-radius: 16px;
    }
    
    .modal-content {
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 16px 16px 12px 16px;
    }
    
    .modal-title {
        font-size: 20px;
        gap: 8px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    /* Ultra-compact mobile scrollbar */
    .modal-content::-webkit-scrollbar {
        width: 4px;
    }
    
    .modal-content::-webkit-scrollbar-track {
        margin: 5px 0;
    }
}

/* HIGH DPI / RETINA DISPLAYS */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .modal-content::-webkit-scrollbar-thumb {
        box-shadow: 
            0 1px 5px rgba(34, 211, 238, 0.4),
            inset 0 0.5px 0 rgba(255, 255, 255, 0.2);
    }
}
/* Enhanced smooth scrolling for desktop mice */
.modal-content {
    scroll-behavior: smooth;
}

/* Momentum-style easing for programmatic scrolls */
@media (hover: hover) and (pointer: fine) {
    .modal-content {
        scroll-behavior: smooth;
        transition: scroll-top 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
}
