/**
 * Home Page Styles
 * Beautiful landing page design for Eyes of Azrael
 */

/* ============================================
   HERO SECTION
   ============================================ */

.home-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.hero-section {
    text-align: center;
    padding: 6rem 2rem 4rem;
    background: linear-gradient(
        135deg,
        rgba(var(--color-primary-rgb, 139, 127, 255), 0.08) 0%,
        rgba(var(--color-secondary-rgb, 255, 126, 182), 0.05) 50%,
        rgba(var(--color-accent-rgb, 255, 217, 61), 0.03) 100%
    );
    border-radius: 24px;
    margin: 2rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(var(--color-primary-rgb, 139, 127, 255), 0.15);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 30%, rgba(var(--color-primary-rgb, 139, 127, 255), 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(var(--color-secondary-rgb, 255, 126, 182), 0.08) 0%, transparent 40%);
    animation: heroGlow 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes heroGlow {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(10px, 10px) rotate(180deg);
    }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(
        135deg,
        var(--color-primary, #8b7fff) 0%,
        var(--color-secondary, #ff7eb6) 50%,
        var(--color-accent, #ffd93d) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(var(--color-primary-rgb, 139, 127, 255), 0.3);
    letter-spacing: -0.03em;
    line-height: 1.1;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--color-text-secondary, #adb5bd);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

/* ============================================
   HERO SEARCH
   ============================================ */

.hero-search {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    justify-content: center;
}

.search-input-large {
    flex: 1;
    min-width: 250px;
    padding: 1.25rem 1.75rem;
    font-size: 1.1rem;
    font-family: 'Inter', -apple-system, sans-serif;
    background: rgba(var(--color-bg-card-rgb, 26, 31, 58), 0.9);
    backdrop-filter: blur(10px);
    color: var(--color-text-primary, #f8f9fa);
    border: 2px solid rgba(var(--color-primary-rgb, 139, 127, 255), 0.3);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.search-input-large:focus {
    outline: none;
    border-color: var(--color-primary, #8b7fff);
    box-shadow:
        0 4px 30px rgba(var(--color-primary-rgb, 139, 127, 255), 0.4),
        0 0 0 4px rgba(var(--color-primary-rgb, 139, 127, 255), 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: rgba(var(--color-bg-card-rgb, 26, 31, 58), 1);
}

.search-input-large::placeholder {
    color: var(--color-text-muted, #6c757d);
}

.hero-search .btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    white-space: nowrap;
}

/* ============================================
   MYTHOLOGIES GRID
   ============================================ */

.mythologies-grid {
    display: grid;
    /* Compact grid: 200px min for 4+ columns on desktop */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 2rem 1.5rem;
    margin: 0;
}

.mythology-card {
    background: rgba(var(--color-bg-card-rgb, 26, 31, 58), 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--color-border-primary-rgb, 42, 47, 74), 0.6);
    border-radius: 12px;
    padding: 1.25rem; /* Compact padding */
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mythology-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--color-primary, #8b7fff) 0%,
        var(--color-secondary, #ff7eb6) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.mythology-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(
        135deg,
        rgba(var(--color-primary-rgb, 139, 127, 255), 0.3),
        rgba(var(--color-secondary-rgb, 255, 126, 182), 0.2)
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.mythology-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(var(--color-primary-rgb, 139, 127, 255), 0.5);
    box-shadow:
        0 12px 48px rgba(var(--color-primary-rgb, 139, 127, 255), 0.25),
        0 0 0 1px rgba(var(--color-primary-rgb, 139, 127, 255), 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: rgba(var(--color-bg-card-rgb, 26, 31, 58), 0.95);
}

.mythology-card:hover::before,
.mythology-card:hover::after {
    opacity: 1;
}

.myth-icon {
    font-size: 2.5rem; /* Compact icon size */
    line-height: 1;
    filter: drop-shadow(0 4px 12px currentColor);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mythology-card:hover .myth-icon {
    transform: scale(1.1) rotate(3deg);
    filter:
        drop-shadow(0 6px 16px currentColor)
        drop-shadow(0 0 20px currentColor);
}

.myth-name {
    font-size: 1.125rem; /* Compact name size */
    font-weight: 700;
    color: var(--color-text-primary, #f8f9fa);
    margin: 0;
    letter-spacing: -0.02em;
}

.myth-count {
    font-size: 0.95rem;
    color: var(--color-text-secondary, #adb5bd);
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(var(--color-primary-rgb, 139, 127, 255), 0.1);
    border-radius: 12px;
    border: 1px solid rgba(var(--color-primary-rgb, 139, 127, 255), 0.2);
}

.mythology-card:hover .myth-count {
    background: rgba(var(--color-primary-rgb, 139, 127, 255), 0.2);
    border-color: rgba(var(--color-primary-rgb, 139, 127, 255), 0.4);
}

/* ============================================
   FEATURED SECTION
   ============================================ */

.featured-section {
    padding: 4rem 2rem;
    margin: 2rem 0;
}

.featured-section h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(
        135deg,
        var(--color-primary, #8b7fff) 0%,
        var(--color-secondary, #ff7eb6) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
}

/* Loading state */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 2rem;
}

.loading-message {
    font-size: 1.2rem;
    color: var(--color-text-secondary, #adb5bd);
}

/* ============================================
   STATISTICS SECTION (Optional Enhancement)
   ============================================ */

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    padding: 3rem 2rem;
    margin: 2rem;
    background: rgba(var(--color-bg-card-rgb, 26, 31, 58), 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(var(--color-border-primary-rgb, 42, 47, 74), 0.6);
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(
        135deg,
        var(--color-primary, #8b7fff) 0%,
        var(--color-accent, #ffd93d) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--color-text-secondary, #adb5bd);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 1.5rem 3rem;
        margin: 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .hero-search {
        flex-direction: column;
        gap: 1rem;
    }

    .search-input-large,
    .btn-large {
        width: 100%;
    }

    .mythologies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 2rem 1rem;
    }

    .mythology-card {
        padding: 1.25rem;
    }

    .myth-icon {
        font-size: 2.5rem;
    }

    .myth-name {
        font-size: 1.1rem;
    }

    .featured-section {
        padding: 3rem 1rem;
    }

    .entity-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
        padding: 0 1rem;
    }
}

/* Mobile Portrait: 2 columns (375px-480px viewport) */
@media (max-width: 480px) {
    .hero-section {
        padding: 3rem 1rem 2rem;
    }

    .mythologies-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1.5rem 0.75rem;
    }

    .mythology-card {
        padding: 1rem;
    }

    .myth-icon {
        font-size: 2rem;
    }

    .myth-name {
        font-size: 0.95rem;
    }

    .myth-count {
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
    }

    .entity-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 0 0.75rem;
    }

    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 2rem 1rem;
        margin: 1rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }
}

/* ============================================
   MOBILE LANDSCAPE - 4 COLUMNS
   ============================================ */

@media (max-width: 896px) and (orientation: landscape) {
    /* Hero section compact */
    .hero-section {
        padding: 1.5rem 1rem 1rem;
        margin: 0.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .hero-search {
        flex-direction: row;
        gap: 0.5rem;
    }

    /* 4-column mythologies grid */
    .mythologies-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem;
        padding: 1rem 0.5rem;
    }

    /* Compact mythology cards */
    .mythology-card {
        padding: 0.75rem;
    }

    .myth-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .myth-name {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .myth-count {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    /* 4-column entity grid */
    .entity-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    /* Stats section compact */
    .stats-section {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem;
        padding: 1rem;
        margin: 0.5rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* Featured section compact */
    .featured-section {
        padding: 1.5rem 0.5rem;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    .hero-section::before,
    .mythology-card,
    .myth-icon,
    .search-input-large {
        animation: none;
        transition: none;
    }

    .mythology-card:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mythology-card {
        border-width: 3px;
        border-color: currentColor;
    }

    .search-input-large {
        border-width: 3px;
    }
}
