/* ============================================================================
   MeetLoyd Visual Enhancement Layer

   This file ADDS visual polish to the existing styles.css
   It does NOT replace anything — it enhances.

   Add this file AFTER styles.css:
   <link rel="stylesheet" href="/css/styles.css">
   <link rel="stylesheet" href="/css/enhancements.css">
   ============================================================================ */

/* ============================================================================
   1. ENHANCED BACKGROUNDS
   ============================================================================ */

/* Richer radial glow */
.bg-glow {
    background:
        radial-gradient(ellipse 80% 50% at 30% 10%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 70% 60%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 50% 30% at 50% 90%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
}

/* Slightly more visible grid */
.bg-grid {
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ============================================================================
   2. NAVIGATION ENHANCEMENTS
   ============================================================================ */

.nav {
    background: rgba(10, 10, 11, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.nav.scrolled {
    background: rgba(10, 10, 11, 0.92);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Logo glow on hover */
.logo:hover .logo-icon {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

/* Nav links subtle underline on hover */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ============================================================================
   3. BUTTON ENHANCEMENTS
   ============================================================================ */

/* Primary button glow */
.btn-primary {
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(6, 182, 212, 0.2);
    transition: all 0.25s cubic-bezier(0.33, 1, 0.68, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(6, 182, 212, 0.3),
        0 0 60px rgba(139, 92, 246, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Secondary button enhancement */
.btn-secondary {
    transition: all 0.25s cubic-bezier(0.33, 1, 0.68, 1);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
}

/* Ghost button glow on hover */
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ============================================================================
   4. CARD ENHANCEMENTS
   ============================================================================ */

/* Base card improvements */
.card {
    position: relative;
    transition: all 0.3s cubic-bezier(0.33, 1, 0.68, 1);
    isolation: isolate; /* Prevent stacking context issues */
}

/* Gradient overlay on hover */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(6, 182, 212, 0.15);
}

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

/* Ensure card content stays above the overlay */
.card > * {
    position: relative;
    z-index: 1;
}

/* Highlighted card top border glow */
.card-highlight::after {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-violet), transparent);
}

/* Solution cards */
.solution-card {
    transition: all 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}

.solution-card:hover {
    transform: translateY(-6px);
    border-color: rgba(6, 182, 212, 0.25);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.25),
        0 0 30px rgba(6, 182, 212, 0.08);
}

/* ============================================================================
   5. HERO SECTION ENHANCEMENTS
   ============================================================================ */

/*
   IMPORTANT: Only target explicit hero classes, NOT section:first-of-type
   The generic selector was causing black gaps on pages with different structures
*/

.hero,
.page-hero,
.solution-hero {
    position: relative;
}

.hero::before,
.page-hero::before,
.solution-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 600px;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(6, 182, 212, 0.15) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Make sure hero content is above the glow */
.hero > .container,
.page-hero > .container,
.solution-hero > .container {
    position: relative;
    z-index: 1;
}

/* ============================================================================
   6. BADGE ENHANCEMENTS
   ============================================================================ */

/* Protocol badges glow */
.protocol-badge,
.badge-gradient,
.hero-badge {
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

/* Stats gradient text enhancement */
.stat-value,
.big-number {
    text-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
}

/* ============================================================================
   7. SECTION DIVIDERS
   ============================================================================ */

/* Ensure sections create proper stacking contexts */
.section,
section {
    position: relative;
    isolation: isolate;
}

/* Add subtle glow at section transitions */
.section-dark,
[class*="section-"]:not(:first-child) {
    position: relative;
}

.section-dark::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.2), transparent);
}

/* ============================================================================
   8. FORM & INPUT ENHANCEMENTS
   ============================================================================ */

.input,
input[type="text"],
input[type="email"],
textarea {
    transition: all 0.25s ease;
}

.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: var(--accent-cyan);
    box-shadow:
        0 0 0 3px rgba(6, 182, 212, 0.1),
        0 0 20px rgba(6, 182, 212, 0.1);
}

/* ============================================================================
   9. TABLE ENHANCEMENTS
   ============================================================================ */

.table tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(6, 182, 212, 0.03);
}

.highlight-col {
    background: rgba(6, 182, 212, 0.05) !important;
    border-left: 2px solid rgba(6, 182, 212, 0.3);
    border-right: 2px solid rgba(6, 182, 212, 0.3);
}

/* ============================================================================
   10. QUOTE & VISION SECTION ENHANCEMENTS
   ============================================================================ */

blockquote,
.vision-quote,
.quote-block {
    position: relative;
}

blockquote::before,
.vision-quote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: -10px;
    font-size: 4rem;
    font-family: var(--font-serif);
    color: rgba(6, 182, 212, 0.2);
    line-height: 1;
}

/* ============================================================================
   11. TRUST/SECURITY BADGES
   ============================================================================ */

.trust-item,
.security-card,
.enterprise-badge {
    transition: all 0.25s ease;
}

.trust-item:hover,
.security-card:hover {
    background: rgba(6, 182, 212, 0.05);
    border-color: rgba(6, 182, 212, 0.2);
}

/* ============================================================================
   12. TEAM PREVIEW CARD (Homepage)
   ============================================================================ */

.team-preview,
.team-card,
.demo-card {
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ============================================================================
   13. STEP NUMBERS
   ============================================================================ */

.step-number,
.number {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

/* ============================================================================
   14. FOOTER ENHANCEMENTS
   ============================================================================ */

.footer,
footer {
    position: relative;
}

.footer::before,
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.15), transparent);
}

/* Footer links hover */
.footer-links a:hover,
footer a:hover {
    color: var(--accent-cyan);
}

/* ============================================================================
   15. SMOOTH ANIMATIONS
   ============================================================================ */

/* Fade in on load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply to hero content */
.hero .container > *,
.page-hero .container > *,
.solution-hero .container > * {
    animation: fadeInUp 0.6s ease-out backwards;
}

.hero .container > *:nth-child(1) { animation-delay: 0.1s; }
.hero .container > *:nth-child(2) { animation-delay: 0.2s; }
.hero .container > *:nth-child(3) { animation-delay: 0.3s; }
.hero .container > *:nth-child(4) { animation-delay: 0.4s; }
.hero .container > *:nth-child(5) { animation-delay: 0.5s; }

/* ============================================================================
   16. LINK HOVER EFFECTS
   ============================================================================ */

a:not(.btn):not(.nav-links a):not(.logo):not(.card):not(.solution-card) {
    transition: color 0.2s ease;
}

/* CTA links with arrow */
a[href*="→"],
.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

a[href*="→"]:hover,
.cta-link:hover {
    gap: 8px;
}

/* ============================================================================
   17. SELECTION STYLING
   ============================================================================ */

::selection {
    background: rgba(6, 182, 212, 0.3);
    color: #fff;
}

/* ============================================================================
   18. FOCUS STATES (Accessibility)
   ============================================================================ */

:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
}

/* ============================================================================
   19. SCROLLBAR STYLING
   ============================================================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.3);
}

/* ============================================================================
   20. MOBILE MENU ENHANCEMENTS
   ============================================================================ */

.nav-mobile-menu {
    background: rgba(15, 15, 18, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-mobile-menu a {
    position: relative;
    padding-left: 0;
    transition: all 0.2s ease;
}

.nav-mobile-menu a:hover {
    color: var(--accent-cyan);
    padding-left: 8px;
}

.nav-mobile-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width 0.2s ease;
}

.nav-mobile-menu a:hover::before {
    width: 4px;
}

/* ============================================================================
   21. RESPONSIVE ADJUSTMENTS
   ============================================================================ */

/* Tablet and below */
@media (max-width: 1024px) {
    /* Reduce hero glow height on smaller screens */
    .hero::before,
    .page-hero::before,
    .solution-hero::before {
        height: 400px;
    }

    /* Slightly reduce card hover lift */
    .card:hover,
    .solution-card:hover {
        transform: translateY(-4px);
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    /* Reduce background glow intensity on mobile (performance) */
    .bg-glow {
        background:
            radial-gradient(ellipse 100% 60% at 50% 10%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
            radial-gradient(ellipse 80% 40% at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    }

    /* Smaller hero glow */
    .hero::before,
    .page-hero::before,
    .solution-hero::before {
        height: 300px;
        background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(6, 182, 212, 0.12) 0%, transparent 60%);
    }

    /* Disable card hover transforms on touch devices (can feel janky) */
    .card:hover,
    .solution-card:hover {
        transform: none;
    }

    /* Keep the glow effect but no movement */
    .card:active,
    .solution-card:active {
        border-color: rgba(6, 182, 212, 0.3);
        box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
    }

    /* Reduce button hover effects on mobile */
    .btn-primary:hover {
        transform: none;
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.4),
            0 0 30px rgba(6, 182, 212, 0.25);
    }

    .btn-secondary:hover {
        transform: none;
    }

    /* Simpler quote styling on mobile */
    blockquote::before,
    .vision-quote::before {
        font-size: 3rem;
        top: -15px;
        left: -5px;
    }

    /* Reduce animation intensity on mobile */
    .hero .container > *,
    .page-hero .container > *,
    .solution-hero .container > * {
        animation: fadeInUp 0.4s ease-out backwards;
    }

    /* Faster animation delays */
    .hero .container > *:nth-child(1) { animation-delay: 0.05s; }
    .hero .container > *:nth-child(2) { animation-delay: 0.1s; }
    .hero .container > *:nth-child(3) { animation-delay: 0.15s; }
    .hero .container > *:nth-child(4) { animation-delay: 0.2s; }
    .hero .container > *:nth-child(5) { animation-delay: 0.25s; }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Further reduce glow for performance */
    .bg-glow {
        background: radial-gradient(ellipse 100% 50% at 50% 10%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    }

    /* Minimal hero glow */
    .hero::before,
    .page-hero::before,
    .solution-hero::before {
        height: 200px;
        opacity: 0.8;
    }

    /* Hide decorative quote marks on very small screens */
    blockquote::before,
    .vision-quote::before {
        display: none;
    }

    /* Simpler section dividers */
    .section-dark::before {
        left: 5%;
        right: 5%;
    }

    footer::before,
    .footer::before {
        left: 5%;
        right: 5%;
    }
}

/* ============================================================================
   22. TOUCH DEVICE OPTIMIZATIONS
   ============================================================================ */

/* Detect touch devices and disable hover transforms */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .solution-card:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }

    /* Use active state instead for touch feedback */
    .card:active {
        border-color: rgba(6, 182, 212, 0.3);
        background: rgba(6, 182, 212, 0.03);
    }

    .btn-primary:active {
        box-shadow:
            0 2px 10px rgba(0, 0, 0, 0.4),
            0 0 20px rgba(6, 182, 212, 0.3);
    }
}

/* ============================================================================
   23. REDUCED MOTION (Accessibility)
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .card:hover,
    .solution-card:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* ============================================================================
   24. HIGH CONTRAST MODE SUPPORT
   ============================================================================ */

@media (prefers-contrast: high) {
    .card,
    .solution-card {
        border-width: 2px;
    }

    .btn-primary {
        border: 2px solid var(--accent-cyan);
    }

    .nav {
        border-bottom-width: 2px;
    }
}
