/* Advanced Technical Upgrade Styles */

/* HTTPS Security Indicators */
.security-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(34, 197, 94, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 9999;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.security-badge.insecure {
    background: rgba(239, 68, 68, 0.9);
}

.security-badge::before {
    content: '🔒';
    font-size: 1rem;
}

.security-badge.insecure::before {
    content: '⚠️';
}

/* CDN Performance Indicators */
.performance-metrics {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.8rem;
    color: white;
    z-index: 9998;
    max-width: 200px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.performance-metrics.show {
    opacity: 1;
}

.performance-metrics h4 {
    margin: 0 0 0.5rem 0;
    color: #FFD700;
    font-size: 0.9rem;
}

.performance-metrics .metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.performance-metrics .metric-value {
    font-weight: 600;
}

.performance-metrics .metric-value.good {
    color: #22c55e;
}

.performance-metrics .metric-value.warning {
    color: #f59e0b;
}

.performance-metrics .metric-value.poor {
    color: #ef4444;
}

/* Database Status Indicator */
.db-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 9999;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.db-status::before {
    content: '💾';
    font-size: 1rem;
}

.db-status.syncing {
    background: rgba(245, 158, 11, 0.9);
}

.db-status.syncing::before {
    content: '🔄';
    animation: spin 1s linear infinite;
}

.db-status.error {
    background: rgba(239, 68, 68, 0.9);
}

.db-status.error::before {
    content: '❌';
}

/* Progressive Enhancement Loading */
.enhanced-loading {
    background: linear-gradient(
        90deg,
        rgba(255, 215, 0, 0.1) 0%,
        rgba(255, 215, 0, 0.3) 50%,
        rgba(255, 215, 0, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: enhancedShimmer 2s infinite;
}

@keyframes enhancedShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Advanced Image Optimization */
.optimized-image {
    transition: all 0.3s ease;
    will-change: transform;
}

.optimized-image:hover {
    transform: scale(1.02);
}

.image-placeholder {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    min-height: 200px;
}

/* Form Security Enhancements */
.secure-form {
    position: relative;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(20px);
}

.secure-form::before {
    content: '🔒 Secure & Encrypted';
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 0.8rem;
    color: rgba(34, 197, 94, 0.8);
    background: rgba(34, 197, 94, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.form-validation-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.form-success-message {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* CDN Resource Loading States */
.cdn-loading {
    position: relative;
    overflow: hidden;
}

.cdn-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.2),
        transparent
    );
    animation: cdnLoad 2s infinite;
}

@keyframes cdnLoad {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Advanced Accessibility for SEO */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #FFD700;
    color: #000;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .hero-section {
        background: #000000 !important;
    }
    
    .text-white {
        color: #ffffff !important;
    }
    
    .btn-primary {
        background: #ffffff !important;
        color: #000000 !important;
        border: 2px solid #000000 !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Optimization for SEO */
@media print {
    .navbar,
    .footer,
    .security-badge,
    .db-status,
    .performance-metrics,
    .calendly-inline-widget,
    #exitIntentModal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero-section,
    .section {
        background: white !important;
        color: black !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        page-break-after: avoid;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
    
    /* Add company info to print */
    .hero-section::after {
        content: "GoldLine Pros - Premium Digital Marketing Agency | goldlinepros.com";
        position: fixed;
        bottom: 20px;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 12px;
        color: #666;
    }
}

/* Performance Monitoring Overlay (Dev Mode) */
.perf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 1rem;
    z-index: 99999;
    max-width: 300px;
    border-radius: 0 0 8px 0;
    display: none;
}

.perf-overlay.show {
    display: block;
}

.perf-metric {
    margin-bottom: 0.5rem;
}

.perf-metric-label {
    color: #FFD700;
    font-weight: bold;
}

/* Advanced Button States */
.btn-enhanced {
    position: relative;
    overflow: hidden;
}

.btn-enhanced::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-enhanced:hover::before {
    left: 100%;
}

/* Critical Resource Loading Indicator */
.critical-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 215, 0, 0.3);
    z-index: 99999;
}

.critical-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: #FFD700;
    animation: criticalLoad 2s infinite;
}

@keyframes criticalLoad {
    0% { left: -30%; }
    100% { left: 100%; }
}

/* Mobile-First PWA Enhancements */
@media (max-width: 768px) {
    .security-badge,
    .db-status {
        bottom: 10px;
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }
    
    .performance-metrics {
        right: 10px;
        top: 60px;
        font-size: 0.7rem;
        padding: 0.75rem;
        max-width: 180px;
    }
    
    .skip-link {
        left: 3px;
        top: -35px;
        font-size: 0.8rem;
        padding: 6px;
    }
    
    .skip-link:focus {
        top: 3px;
    }
}

/* Dark Mode Support for System Preferences */
@media (prefers-color-scheme: dark) {
    .performance-metrics {
        background: rgba(0, 0, 0, 0.95);
        border-color: rgba(255, 215, 0, 0.4);
    }
}

/* Network Quality Adaptations */
@media (prefers-reduced-data: reduce) {
    /* Disable non-essential animations and effects */
    .constellation-canvas,
    .particles-canvas,
    .wave-effect {
        display: none !important;
    }
    
    /* Reduce image quality */
    img {
        image-rendering: optimizeSpeed;
    }
}

/* Advanced Focus Management */
.focus-trap {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Loading States for Dynamic Content */
.content-loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.05);
    border-radius: 8px;
    margin: 1rem 0;
}

.content-loading::after {
    content: '⏳ Loading enhanced features...';
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Microinteractions for Better UX */
.micro-interaction {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.micro-interaction:hover {
    transform: translateY(-1px);
}

.micro-interaction:active {
    transform: translateY(0);
}

/* Advanced Grid Layouts */
.enhanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .enhanced-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
}

/* Critical Web Vitals Optimization */
.above-fold {
    content-visibility: visible;
}

.below-fold {
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
}

/* Advanced Typography for Readability */
.enhanced-text {
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern CSS Features */
.modern-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Container Query Support (Future-Proofing) */
@container (min-width: 400px) {
    .container-responsive {
        padding: 2rem;
    }
}

@container (max-width: 399px) {
    .container-responsive {
        padding: 1rem;
    }
}

/* Advanced Animation Performance */
.gpu-optimized {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Scroll-Driven Animations */
@supports (animation-timeline: scroll()) {
    .scroll-animated {
        animation: slideInUp linear;
        animation-timeline: scroll();
        animation-range: entry 0% entry 50%;
    }
}
