/* ===== VARIABLES Y BASE ===== */
:root {
    --gryffindor-red: #ae0001;
    --gryffindor-gold: #eeba30;
    --hufflepuff-yellow: #ecb939;
    --hufflepuff-black: #54524f;
    --ravenclaw-blue: #222f5b;
    --ravenclaw-silver: #5d5d5d;
    --slytherin-green: #2a623d;
    --slytherin-silver: #5d5d5d;
    --magic-purple: #663399;
    --dark-navy: #1a1a2e;
    --mystical-gold: #ffd700;
    --parchment: #f4f1e8;
    --shadow-black: rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(to bottom, 
        #000428 0%,           /* Azul muy oscuro casi negro arriba */
        #004e92 30%,          /* Azul profundo */
        #663399 60%,          /* Púrpura mágico vibrante */
        #8e44ad 80%,          /* Púrpura más claro */
        #2c003e 100%          /* Púrpura muy oscuro abajo */
    );
    color: var(--parchment);
    line-height: 1.6;
    min-height: 100vh;
    background-attachment: fixed;
}

.magical-container {
    position: relative;
    overflow-x: hidden;
}

/* ===== EFECTOS MÁGICOS DE FONDO ===== */
.magical-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(174, 0, 1, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(102, 51, 153, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    background: linear-gradient(180deg, rgba(174, 0, 1, 0.2) 0%, transparent 100%);
    border-bottom: 2px solid var(--mystical-gold);
    position: relative;
}

.hogwarts-crest {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--mystical-gold);
    animation: magical-glow 3s ease-in-out infinite alternate;
}

@keyframes magical-glow {
    0% { text-shadow: 0 0 20px var(--mystical-gold); }
    100% { text-shadow: 0 0 30px var(--mystical-gold), 0 0 40px var(--gryffindor-gold); }
}

.main-title {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--mystical-gold), var(--gryffindor-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px var(--shadow-black);
}

.subtitle {
    font-size: 1.2rem;
    font-style: italic;
    opacity: 0.9;
    color: var(--parchment);
}

/* ===== NAVEGACIÓN ===== */
.navigation {
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.navigation a {
    color: var(--parchment);
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navigation a:hover {
    border-color: var(--mystical-gold);
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== SECCIÓN HERO ===== */
.hero-section {
    padding: 4rem 2rem;
    text-align: center;
    background: radial-gradient(ellipse at center, rgba(174, 0, 1, 0.15) 0%, transparent 70%);
    margin: 2rem 0;
    border-radius: 20px;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--mystical-gold);
    text-shadow: 2px 2px 4px var(--shadow-black);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.cta-button {
    background: linear-gradient(45deg, var(--gryffindor-red), var(--gryffindor-gold));
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(174, 0, 1, 0.4);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(174, 0, 1, 0.6);
}

/* ===== SECCIONES GENERALES ===== */
section {
    margin: 4rem 0;
    padding: 2rem;
}

section h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--mystical-gold);
    text-shadow: 2px 2px 4px var(--shadow-black);
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--mystical-gold), transparent);
    margin: 0.5rem auto;
}

/* ===== GRIDS ===== */
.story-grid,
.characters-grid,
.houses-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.story-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.characters-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.houses-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* ===== CARDS ===== */
.story-card,
.character-card {
    background: rgba(0, 0, 0, 0.6);
    padding: 2rem;
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.story-card:hover,
.character-card:hover {
    transform: translateY(-5px);
    border-color: var(--mystical-gold);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.story-card h3,
.character-card h3 {
    color: var(--gryffindor-gold);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.character-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* ===== CASAS DE HOGWARTS ===== */
.house-card {
    background: rgba(0, 0, 0, 0.7);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.house-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--house-primary), var(--house-secondary));
}

.gryffindor {
    --house-primary: var(--gryffindor-red);
    --house-secondary: var(--gryffindor-gold);
    border: 2px solid var(--gryffindor-red);
}

.hufflepuff {
    --house-primary: var(--hufflepuff-yellow);
    --house-secondary: var(--hufflepuff-black);
    border: 2px solid var(--hufflepuff-yellow);
}

.ravenclaw {
    --house-primary: var(--ravenclaw-blue);
    --house-secondary: var(--ravenclaw-silver);
    border: 2px solid var(--ravenclaw-blue);
}

.slytherin {
    --house-primary: var(--slytherin-green);
    --house-secondary: var(--slytherin-silver);
    border: 2px solid var(--slytherin-green);
}

.house-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.house-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--house-primary);
}

.house-colors {
    height: 20px;
    margin-top: 1rem;
    background: linear-gradient(90deg, var(--house-primary) 50%, var(--house-secondary) 50%);
    border-radius: 10px;
}

/* ===== FOOTER ===== */
.footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    text-align: center;
    border-top: 2px solid var(--mystical-gold);
    margin-top: 4rem;
}

.footer p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.magical-elements {
    font-size: 1.5rem;
    margin-top: 1rem;
    letter-spacing: 1rem;
    opacity: 0.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .navigation ul {
        gap: 1rem;
    }
    
    .navigation a {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    section {
        padding: 1rem;
    }
    
    .story-grid,
    .characters-grid,
    .houses-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .navigation ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}