/**
 * Home View Styles
 * Homepage layout with hero section and mythology cards
 *
 * NOTE: This file complements home-page.css. Use .home-view prefix
 * for specificity where needed to avoid conflicts.
 */

.home-view {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ============================================
   HERO SECTION - Scoped to .home-view
   Inherits base styles from home-page.css
   ============================================ */

/* Only apply these hero overrides when inside .home-view context */
.home-view .hero-section {
    /* Inherits from home-page.css, only add specific overrides here */
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Hero title animation - scoped to avoid conflict with home-page.css */
.home-view .hero-title {
    animation: homeViewFadeInUp 0.6s ease-out;
}

.hero-icon {
    display: inline-block;
    animation: homeViewFloat 3s ease-in-out infinite;
}

@keyframes homeViewFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes homeViewFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero subtitle - only add animation, inherit other styles from home-page.css */
.home-view .hero-subtitle {
    animation: homeViewFadeInUp 0.6s ease-out 0.1s both;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--color-text-secondary, #adb5bd);
    line-height: 1.8;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: homeViewFadeInUp 0.6s ease-out 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: homeViewFadeInUp 0.6s ease-out 0.3s both;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--color-primary, #8b7fff);
    color: white;
    box-shadow: 0 4px 16px rgba(var(--color-primary-rgb, 139, 127, 255), 0.4);
}

.btn-primary:hover {
    background: var(--color-primary-hover, #7a6fee);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb, 139, 127, 255), 0.5);
}

.btn-secondary {
    background: rgba(var(--color-primary-rgb, 139, 127, 255), 0.15);
    color: var(--color-primary, #8b7fff);
    border: 1px solid rgba(var(--color-primary-rgb, 139, 127, 255), 0.3);
}

.btn-secondary:hover {
    background: rgba(var(--color-primary-rgb, 139, 127, 255), 0.25);
    border-color: var(--color-primary, #8b7fff);
    transform: translateY(-2px);
}

/* ============================================
   MYTHOLOGY GRID SECTION - Scoped to .home-view
   Base mythology-card styles are in home-page.css
   ============================================ */

.mythology-grid-section {
    margin-bottom: 4rem;
}

/* Section title specific to home-view (distinct from dynamic-views.css .section-title) */
.home-view .section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--color-text-primary, #f8f9fa) 0%, var(--color-text-secondary, #adb5bd) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Use .mythology-grid within .home-view to avoid conflicts */
.home-view .mythology-grid {
    display: grid;
    /* Compact grid: 200px min for 4+ columns on desktop */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/*
 * NOTE: .mythology-card base styles are defined in home-page.css
 * Only add home-view specific overrides here with higher specificity
 */
.home-view .mythology-card {
    /* Inherits from home-page.css, minimal overrides */
    position: relative;
}

.mythology-card-icon {
    font-size: 2.25rem; /* Compact icon size */
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.mythology-card-title {
    font-size: 1.125rem; /* Compact title size */
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.mythology-card-description {
    font-size: 0.95rem;
    color: var(--color-text-secondary, #adb5bd);
    line-height: 1.6;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.mythology-card-arrow {
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.mythology-card:hover .mythology-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   FEATURES SECTION
   ============================================ */

.features-section {
    margin-bottom: 4rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: rgba(var(--color-bg-card-rgb, 26, 31, 58), 0.4);
    border: 1px solid rgba(var(--color-border-primary-rgb, 42, 47, 74), 0.6);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(var(--color-bg-card-rgb, 26, 31, 58), 0.6);
    border-color: rgba(var(--color-primary-rgb, 139, 127, 255), 0.4);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-text-primary, #f8f9fa);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--color-text-secondary, #adb5bd);
    line-height: 1.6;
}

/* ============================================
   LOADING STATES - Home view specific
   Base .loading-container is in dynamic-views.css
   ============================================ */

.loading-submessage {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Fade animations - namespaced to avoid conflicts */
@keyframes homeViewFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes homeViewFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.home-view .loading-fade-in {
    animation: homeViewFadeIn 0.4s ease-out;
}

.home-view .loading-fade-out {
    animation: homeViewFadeOut 0.3s ease-out;
}

/* Skeleton Cards - Home view specific loading placeholders */
.mythology-card-skeleton {
    position: relative;
    background: rgba(var(--color-bg-card-rgb, 26, 31, 58), 0.4);
    border: 1px solid rgba(var(--color-border-primary-rgb, 42, 47, 74), 0.6);
    border-radius: 16px;
    padding: 2rem;
    overflow: hidden;
}

.skeleton-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 1rem;
    background: rgba(147, 112, 219, 0.1);
}

.skeleton-title {
    height: 28px;
    width: 70%;
    margin-bottom: 1rem;
    border-radius: 4px;
    background: rgba(147, 112, 219, 0.1);
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    background: rgba(147, 112, 219, 0.1);
}

.skeleton-text-short {
    width: 60%;
}

.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        rgba(147, 112, 219, 0.05) 0%,
        rgba(147, 112, 219, 0.2) 50%,
        rgba(147, 112, 219, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: homeViewSkeletonShimmer 2s infinite linear;
}

@keyframes homeViewSkeletonShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   RESPONSIVE DESIGN - Scoped to .home-view
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .home-view {
        padding: 1.5rem;
    }

    /* Scoped to avoid conflict with home-page.css responsive */
    .home-view .mythology-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.25rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .home-view {
        padding: 1rem;
    }

    .home-view .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .home-view .mythology-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

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

/* Small Mobile Portrait - 2 columns */
@media (max-width: 480px) {
    .home-view .section-title {
        font-size: 1.75rem;
    }

    .home-view .mythology-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .mythology-card-title {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
    }
}

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

@media (max-width: 896px) and (orientation: landscape) {
    .home-view {
        padding: 0.5rem;
    }

    .home-view .section-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    /* 4-column grid for mythology cards in landscape */
    .home-view .mythology-grid,
    .mythology-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem;
    }

    /* Features grid - 4 columns */
    .features-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem;
    }

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

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

    .mythology-card-title {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .mythology-card-description {
        display: none;
    }

    .mythology-card-arrow {
        display: none;
    }

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

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

    .feature-card h3 {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }

    .feature-card p {
        font-size: 0.75rem;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Compact hero section */
    .hero-section {
        padding: 1rem;
    }

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

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

    .hero-description {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY - Scoped to .home-view
   ============================================ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .home-view .hero-title,
    .home-view .hero-subtitle,
    .hero-description,
    .hero-actions {
        animation: none;
    }

    .hero-icon {
        animation: none;
    }

    .feature-card {
        transition: none;
    }

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

/* High contrast mode */
@media (prefers-contrast: high) {
    .feature-card {
        border-width: 2px;
    }
}
