/* ==============================================================================
   Home Page UI Enhancements (home-enhancements.css)
   ==============================================================================
   Purpose: Additional polish and refinements for the home page UI.
   Focuses on micro-interactions, improved visual hierarchy, and subtle animations.

   This file works alongside style.css to provide enhanced home page styling.
   Load this after style.css for proper cascade.

   Author: UI Enhancement Implementation
   Date: February 2026
   ============================================================================== */

/* ==============================================================================
   MICRO-INTERACTIONS AND POLISH
   ============================================================================== */

/* Enhanced button interactions */
.btn__icon {
    transition: transform var(--transition-fast);
    display: inline-block;
}

.btn:hover .btn__icon {
    transform: translateX(3px);
}

/* Subtle pulse effect for primary CTA */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

.btn--cta:hover {
    animation: pulse 2s infinite;
}

/* ==============================================================================
   ENHANCED TYPOGRAPHY RHYTHM
   ============================================================================== */

/* Better paragraph spacing in cards */
.card__body p {
    margin-bottom: var(--space-3);
}

.card__body p:last-child {
    margin-bottom: 0;
}

/* Enhanced list styling in cards */
.card__features li {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    color: var(--color-gray-700);
}

/* ==============================================================================
   VISUAL POLISH ENHANCEMENTS
   ============================================================================== */

/* Subtle gradient overlays for depth */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.8));
    pointer-events: none;
}

/* Enhanced card shadows on hover */
.card--feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-primary);
    opacity: 0;
    border-radius: inherit;
    transition: opacity var(--transition-slow);
    pointer-events: none;
    z-index: -1;
    filter: blur(20px);
}

.card--feature:hover::before {
    opacity: 0.1;
}

/* ==============================================================================
   IMPROVED FOCUS STATES
   ============================================================================== */

/* Better keyboard navigation indicators */
.feature-float:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
}

.card--feature:focus-within {
    box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

/* ==============================================================================
   LOADING STATES AND FEEDBACK
   ============================================================================== */

/* Skeleton loading effect for dynamic content */
@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-loading {
    background: linear-gradient(
        90deg,
        var(--color-gray-200) 0%,
        var(--color-gray-100) 50%,
        var(--color-gray-200) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ==============================================================================
   RESPONSIVE REFINEMENTS
   ============================================================================== */

/* Better touch targets on mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        font-size: var(--font-size-base);
    }

    .card__link {
        display: inline-block;
        padding: var(--space-2) 0;
    }

    /* Improved mobile spacing */
    .hero__trust {
        margin-top: var(--space-4);
    }
}

/* Tablet-specific improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-container {
        gap: var(--space-12);
    }

    .features-grid.grid--cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==============================================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================================== */

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .feature-float {
        animation: none !important;
    }

    .btn--cta:hover {
        animation: none !important;
    }

    [data-animate] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==============================================================================
   DARK MODE ENHANCEMENTS
   ============================================================================== */

@media (prefers-color-scheme: dark) {
    body.theme-system .hero-section::before,
    body.theme-dark .hero-section::before {
        opacity: 0.08;
    }

    body.theme-system .feature-float,
    body.theme-dark .feature-float {
        background: rgba(39, 39, 42, 0.95);
        border-color: var(--color-gray-700);
    }

    body.theme-system .newsletter--enhanced,
    body.theme-dark .newsletter--enhanced {
        background: var(--color-gray-800);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
}

/* ==============================================================================
   PRINT OPTIMIZATIONS
   ============================================================================== */

@media print {
    /* Hide decorative elements */
    .hero-section::before,
    .hero-section::after,
    .section--cta::before {
        display: none;
    }

    /* Ensure content is readable */
    .hero__title,
    .section__title {
        color: black;
        page-break-after: avoid;
    }

    /* Show full content without truncation */
    .card__body {
        max-height: none;
    }
}

/* ==============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================== */

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .hero__brand {
        text-decoration: underline;
        text-decoration-thickness: 2px;
    }

    .feature-float {
        border-width: 2px;
    }

    .btn {
        font-weight: var(--font-weight-bold);
    }
}

/* Improved screen reader announcements */
.sr-only-focusable:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: var(--space-3);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--color-gray-900);
    color: var(--color-white);
    z-index: var(--z-tooltip);
    border-radius: var(--radius-base);
    box-shadow: var(--shadow-xl);
}

/* ==============================================================================
   END OF HOME PAGE ENHANCEMENTS
   ============================================================================== */