/* ===========================
   DESIGN OPTIMIZATIONS
   Performance & Visual Polish
   =========================== */

/* ===========================
   1. PERFORMANCE OPTIMIZATIONS
   =========================== */

/* GPU acceleration for animations */
.service-card,
.testimonial-card,
.pricing-card,
.team-card,
.btn,
.hero-text,
.nav-menu a {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 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;
    }
}

/* ===========================
   2. VISUAL HIERARCHY IMPROVEMENTS
   =========================== */

/* Enhanced section spacing */
section {
    padding: clamp(60px, 10vw, 100px) 0;
}

/* Better visual separation */
section:nth-child(odd) {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

section:nth-child(even) {
    background: linear-gradient(180deg, #fafbfc 0%, #f8f9fa 100%);
}

/* Improved readability */
p {
    max-width: 75ch;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.8;
}

/* Better heading hierarchy */
h2 {
    margin-bottom: 1.5rem;
    font-weight: 700;
}

h3 {
    margin-bottom: 1.25rem;
    font-weight: 600;
}

/* ===========================
   3. ENHANCED CARD DESIGNS
   =========================== */

.service-card,
.pricing-card,
.team-card {
    background: white;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 4px 20px rgba(0, 119, 190, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 119, 190, 0.05);
    position: relative;
    overflow: hidden;
}

.service-card::before,
.pricing-card::before,
.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.service-card:hover::before,
.pricing-card:hover::before,
.team-card:hover::before {
    transform: scaleX(1);
}

/* Glassmorphism effect on hover */
.service-card:hover,
.pricing-card:hover,
.team-card:hover {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 40px rgba(0, 119, 190, 0.15),
        0 0 0 1px rgba(0, 119, 190, 0.1);
}

/* ===========================
   4. BUTTON STYLE REFINEMENTS
   =========================== */

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 119, 190, 0.25);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(0, 119, 190, 0.35);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 119, 190, 0.1);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 8px 25px rgba(0, 119, 190, 0.25);
}

/* ===========================
   5. NAVIGATION POLISH
   =========================== */

.header {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 8px 30px rgba(0, 119, 190, 0.12);
}

/* Logo refinement */
.logo img {
    filter: drop-shadow(0 2px 8px rgba(0, 119, 190, 0.15));
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.logo-text {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================
   6. HERO SECTION OPTIMIZATIONS
   =========================== */

.hero {
    min-height: 100vh;
    position: relative;
}

/* Better overlay for readability */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 10, 39, 0.85) 0%,
        rgba(0, 119, 190, 0.75) 50%,
        rgba(0, 201, 255, 0.65) 100%
    );
    z-index: 1;
}

/* Improved text contrast */
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    text-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto 2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* ===========================
   7. SPACING & RHYTHM
   =========================== */

/* Consistent vertical rhythm */
.section-padding {
    padding: clamp(60px, 10vw, 100px) 0;
}

.section-header {
    margin-bottom: clamp(40px, 8vw, 80px);
}

/* Better content spacing */
.content-block {
    margin-bottom: clamp(30px, 5vw, 60px);
}

/* ===========================
   8. FORM DESIGN POLISH
   =========================== */

.form-control {
    font-size: 16px;
    padding: 16px 20px;
    border: 2px solid #e8ecf1;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 
        0 0 0 4px rgba(0, 119, 190, 0.08),
        0 4px 12px rgba(0, 119, 190, 0.12);
    outline: none;
}

.form-control::placeholder {
    color: #a0aec0;
}

/* ===========================
   9. IMAGE OPTIMIZATIONS
   =========================== */

/* Aspect ratio boxes */
.img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.img-wrapper::before {
    content: '';
    display: block;
    padding-top: 66.67%; /* 3:2 aspect ratio */
}

.img-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-wrapper:hover img {
    transform: scale(1.08);
}

/* Image loading state */
img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
}

/* ===========================
   10. ICON STYLING
   =========================== */

.icon-box {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 119, 190, 0.1), rgba(0, 201, 255, 0.1));
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.icon-box:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-4px) rotate(5deg);
    box-shadow: 0 12px 24px rgba(0, 119, 190, 0.25);
}

/* ===========================
   11. TESTIMONIAL CARDS
   =========================== */

.testimonial-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 119, 190, 0.08);
    position: relative;
    border-left: 4px solid var(--primary-color);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 30px;
    font-size: 120px;
    font-family: Georgia, serif;
    color: rgba(0, 119, 190, 0.08);
    line-height: 1;
}

/* ===========================
   12. STATS/COUNTERS
   =========================== */

.stat-item {
    text-align: center;
    padding: 30px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 119, 190, 0.2);
}

.stat-number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-body);
    font-weight: 500;
}

/* ===========================
   13. CTA SECTIONS
   =========================== */

.cta-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: clamp(60px, 10vw, 100px) 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.5;
}

.cta-section h2,
.cta-section p {
    color: white;
}

/* ===========================
   14. FOOTER POLISH
   =========================== */

.footer {
    background: linear-gradient(180deg, #0a0e27 0%, #1a1e3a 100%);
    padding: 60px 0 30px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

/* ===========================
   15. MOBILE OPTIMIZATIONS
   =========================== */

@media (max-width: 768px) {
    /* Reduce animations on mobile */
    .service-card:hover,
    .pricing-card:hover,
    .team-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    /* Optimize spacing */
    section {
        padding: clamp(40px, 8vw, 60px) 0;
    }
    
    /* Improve touch targets */
    .btn {
        min-height: 48px;
        min-width: 48px;
    }
    
    /* Optimize hero */
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    /* Stack navigation */
    .hero-buttons {
        flex-direction: column;
        gap: 16px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
}

/* ===========================
   16. PRINT OPTIMIZATIONS
   =========================== */

@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* ===========================
   17. LOADING STATES
   =========================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 119, 190, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===========================
   18. ACCESSIBILITY IMPROVEMENTS
   =========================== */

/* Focus visible styles */
*:focus-visible {
    outline: 3px solid rgba(0, 119, 190, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border-width: 3px;
    }
    
    .service-card,
    .pricing-card,
    .team-card {
        border: 2px solid var(--primary-color);
    }
}
