/* ============================================
   HOUSES PAGE STYLES
   Estilos específicos para la página de Houses
   ============================================ */

/* Variables de colores de Houses */
:root {
    --wisdom-color: #1B4F72;
    --wisdom-light: #3498DB;
    --fidelity-color: #196F3D;
    --fidelity-light: #27AE60;
    --joy-color: #D4AC0D;
    --joy-light: #F1C40F;
    --devotion-color: #B03A2E;
    --devotion-light: #E74C3C;
}

/* ============================================
   TÍTULOS DE SECCIÓN - ESTILOS GLOBALES
   ============================================ */
.section-title {
    font-size: 2.5em;
    text-align: center;
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-weight: 700;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--primary-yellow);
    margin: 20px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2em;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Hero Section */
.houses-hero {
    height: 80vh;
    background: 
        linear-gradient(135deg, rgba(25, 54, 96, 0.85), rgba(45, 74, 115, 0.75)),
        url('../img/hero_houses.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    margin-top: 120px;
    overflow: hidden;
}

.houses-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(25, 54, 96, 0.3), rgba(45, 74, 115, 0.3));
}

.houses-hero .hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 20px;
    text-align: center;
    width: 100%;
}

.houses-hero h1 {
    font-size: 4.5em;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    text-align: center;
    width: 100%;
}

.houses-hero p {
    font-size: 2em;
    color: var(--primary-yellow);
    font-weight: 600;
    margin-bottom: 40px;
    text-align: center;
    width: 100%;
}

.hero-shields {
    margin-top: 30px;
    text-align: center;
    width: 100%;
}

.main-shield {
    max-width: 200px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: floatShield 3s ease-in-out infinite;
    display: block;
    margin: 0 auto;
}

@keyframes floatShield {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Prevenir flash de contenido sin estilo */
.fade-in {
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Intro Section */
.houses-intro {
    padding: 80px 0;
    background: var(--light-gray);
}

.intro-text {
    font-size: 1.2em;
    line-height: 1.9;
    color: var(--dark-gray);
    text-align: center;
    max-width: 900px;
    margin: 30px auto 0;
}

.intro-text strong {
    color: var(--primary-blue);
    font-weight: 700;
}

/* Houses Main Grid 2x2 */
.houses-grid-section {
    padding: 80px 0;
    background: white;
}

.quick-link-scores {
    text-align: center;
    margin: 30px 0;
}

.link-scores {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-blue);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(25, 54, 96, 0.3);
}

.link-scores:hover {
    background: var(--secondary-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(25, 54, 96, 0.4);
}

.houses-main-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 50px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.house-main-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.house-main-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
}

.house-main-card.wisdom::before { background: var(--wisdom-color); }
.house-main-card.fidelity::before { background: var(--fidelity-color); }
.house-main-card.joy::before { background: var(--joy-color); }
.house-main-card.devotion::before { background: var(--devotion-color); }

.house-main-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

.house-shield {
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
    position: relative;
}

.house-shield img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.house-main-card:hover .house-shield img {
    transform: scale(1.1);
}

.house-title {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

.house-main-card.wisdom .house-title { color: var(--wisdom-color); }
.house-main-card.fidelity .house-title { color: var(--fidelity-color); }
.house-main-card.joy .house-title { color: var(--joy-color); }
.house-main-card.devotion .house-title { color: var(--devotion-color); }

.house-sister {
    font-size: 1.1em;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 20px;
}

.house-mascot-info {
    margin: 20px 0;
    padding: 15px;
    background: var(--light-gray);
    border-radius: 10px;
}

.mascot-name {
    font-size: 1.3em;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
}

.mascot-meaning {
    font-size: 0.95em;
    color: var(--text-secondary);
    line-height: 1.6;
}

.house-color-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    color: white;
    margin-top: 15px;
}

.house-main-card.wisdom .house-color-badge { background: var(--wisdom-light); }
.house-main-card.fidelity .house-color-badge { background: var(--fidelity-light); }
.house-main-card.joy .house-color-badge { background: var(--joy-light); }
.house-main-card.devotion .house-color-badge { background: var(--devotion-light); }

/* ============================================
   BOTÓN DE VIDEO
   ============================================ */
.video-btn-house {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1em;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

.video-btn-house::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.video-btn-house:hover::before {
    width: 300px;
    height: 300px;
}

.video-btn-house span {
    position: relative;
    z-index: 1;
}

.house-main-card.wisdom .video-btn-house { background: var(--wisdom-light); }
.house-main-card.fidelity .video-btn-house { background: var(--fidelity-light); }
.house-main-card.joy .video-btn-house { background: var(--joy-light); color: #333; }
.house-main-card.devotion .video-btn-house { background: var(--devotion-light); }

.video-btn-house:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.video-btn-house:active {
    transform: translateY(-1px);
}

/* ============================================
   MODAL DE VIDEO - FORMATO VERTICAL MEJORADO
   ============================================ */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

/* Contenedor para videos VERTICALES (9:16) */
.video-container-vertical {
    position: relative;
    width: auto;
    max-width: 90%;
    max-height: 90vh;
    background: #000;
    border-radius: 15px;
    overflow: visible;
    animation: scaleIn 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-wrapper-vertical {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    overflow: hidden;
}

.video-wrapper-vertical video {
    width: auto;
    height: 70vh;
    max-height: 90vh;
    max-width: 100%;
    object-fit: contain;
    border-radius: 15px;
}

/* BOTÓN CERRAR MEJORADO */
.close-btn {
    position: absolute;
    top: -60px;
    right: -10px;
    background: #e74c3c;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.close-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: #c0392b;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

/* TEXTO INSTRUCTIVO */
.modal-instructions {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    white-space: nowrap;
    animation: fadeInUpModal 0.5s ease 0.5s both;
}

.modal-instructions span {
    display: inline-block;
    margin: 0 5px;
}

.instruction-key {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animaciones para el modal */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeInUpModal {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Objectives Section */
.objectives-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.objectives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.objective-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.objective-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(25, 54, 96, 0.2);
}

.objective-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.objective-card h3 {
    color: var(--primary-blue);
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: 700;
}

.objective-card p {
    color: var(--dark-gray);
    line-height: 1.7;
}

/* Leadership Section */
.leadership-section {
    padding: 80px 0;
    background: white;
}

.leaders-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin: 50px 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.leader-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(25, 54, 96, 0.2);
    transition: all 0.3s ease;
    border: 3px solid var(--primary-blue);
}

.leader-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(25, 54, 96, 0.3);
}

.leader-photo-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 4px solid var(--primary-yellow);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.leader-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder-text {
    color: var(--text-secondary);
    font-size: 0.9em;
    text-align: center;
    padding: 20px;
}

.leader-role {
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.leader-name {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--primary-blue);
}

/* Coaches Grid - ESPACIADO MEJORADO */
.coaches-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 50px;
    margin-bottom: 60px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.coach-house-section {
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.wisdom-bg { background: linear-gradient(135deg, var(--wisdom-color), var(--wisdom-light)); }
.fidelity-bg { background: linear-gradient(135deg, var(--fidelity-color), var(--fidelity-light)); }
.joy-bg { background: linear-gradient(135deg, var(--joy-color), var(--joy-light)); }
.devotion-bg { background: linear-gradient(135deg, var(--devotion-color), var(--devotion-light)); }

.coach-house-title {
    color: white;
    font-size: 1.6em;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
}

.coaches-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.coach-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-align: center;
}

.coach-tarjeta {
    width: 200px;
    border: #1B4F72 2px solid;
    border-radius: 10px;
}

.coach-card:hover {
    background: white;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.coach-avatar {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.coach-name {
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 1.1em;
    margin-bottom: 5px;
}

.coach-title {
    font-size: 0.85em;
    color: var(--text-secondary);
    font-style: italic;
}

/* Captains Section - ESPACIADO MEJORADO */
.captains-section {
    margin-top: 80px;
    padding: 50px;
    background: var(--light-gray);
    border-radius: 20px;
}

.captains-title {
    text-align: center;
    color: var(--primary-blue);
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 700;
}

.captains-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1em;
    margin-bottom: 50px;
}

.captains-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.captain-placeholder {
    background: white;
    padding: 40px 25px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid;
    transition: all 0.3s ease;
}

.captain-placeholder:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.wisdom-border { border-color: var(--wisdom-color); }
.fidelity-border { border-color: var(--fidelity-color); }
.joy-border { border-color: var(--joy-color); }
.devotion-border { border-color: var(--devotion-color); }

.captain-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    font-weight: 700;
    color: white;
    border: 4px solid;
    overflow: hidden;
}

/* Bordes de color para avatares de captains */
.wisdom-bg.captain-avatar { border-color: var(--wisdom-color); }
.joy-bg.captain-avatar { border-color: var(--joy-color); }
.devotion-bg.captain-avatar { border-color: var(--devotion-color); }
.fidelity-bg.captain-avatar { border-color: var(--fidelity-color); }

/* Estilos para imágenes de capitanes */
.captain-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.captain-placeholder:hover .captain-img {
    transform: scale(1.1);
}

.captain-label {
    font-weight: 700;
    font-size: 1.3em;
    margin-bottom: 10px;
}

.wisdom-border .captain-label { color: var(--wisdom-color); }
.fidelity-border .captain-label { color: var(--fidelity-color); }
.joy-border .captain-label { color: var(--joy-color); }
.devotion-border .captain-label { color: var(--devotion-color); }

.captain-info {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1em;
}

/* Activities Section */
.activities-section {
    padding: 80px 0;
    background: var(--light-gray);
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 50px;
}

.activity-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-top: 4px solid var(--primary-blue);
}

.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(25, 54, 96, 0.2);
}

.activity-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.activity-card h3 {
    color: var(--primary-blue);
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 700;
}

.activity-card p {
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* Scores CTA */
.scores-cta {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    text-align: center;
    color: white;
}

.cta-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
    font-weight: 700;
}

.cta-content p {
    font-size: 1.4em;
    margin-bottom: 40px;
    opacity: 0.95;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.2em;
}

/* ============================================
   RESPONSIVE DESIGN - MEJORADO
   ============================================ */

/* Tablets grandes */
@media (max-width: 968px) {
    .houses-main-grid-2x2 {
        grid-template-columns: 1fr !important;
        max-width: 500px;
        gap: 30px;
    }

    .objectives-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .coaches-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 50px;
    }

    .captains-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 35px;
    }

    .leaders-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .video-container-vertical {
        max-width: 95%;
    }

    .video-wrapper-vertical video {
        height: 65vh;
    }

    .close-btn {
        top: -55px;
        width: 45px;
        height: 45px;
        font-size: 24px;
    }

    .modal-instructions {
        font-size: 12px;
        bottom: -45px;
    }
}

/* Tablets y móviles medianos */
@media (max-width: 768px) {
    .houses-hero {
        height: 70vh;
        margin-top: 90px;
    }

    .houses-hero h1 {
        font-size: 3em;
    }

    .houses-hero p {
        font-size: 1.5em;
    }

    .main-shield {
        max-width: 180px;
    }

    .houses-main-grid-2x2 {
        grid-template-columns: 1fr !important;
        max-width: 450px;
        gap: 25px;
    }

    .house-main-card {
        padding: 30px 20px;
    }

    .objectives-grid,
    .activities-grid {
        grid-template-columns: 1fr;
    }
    
    .coaches-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 40px;
    }

    .captains-section {
        margin-top: 60px;
        padding: 40px 25px;
    }

    .captains-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .captain-placeholder {
        padding: 35px 20px;
    }

    .leaders-container {
        grid-template-columns: 1fr;
    }

    .cta-content h2 {
        font-size: 2em;
    }

    .cta-content p {
        font-size: 1.1em;
    }

    .video-wrapper-vertical video {
        height: 60vh;
    }

    .close-btn {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 24px;
        background: rgba(231, 76, 60, 0.95);
    }

    .modal-instructions {
        bottom: 20px;
        font-size: 11px;
        padding: 8px 15px;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .houses-hero h1 {
        font-size: 2.2em;
    }

    .houses-hero p {
        font-size: 1.2em;
    }

    .main-shield {
        max-width: 150px;
    }

    .houses-main-grid-2x2 {
        grid-template-columns: 1fr !important;
        gap: 20px;
        max-width: 100%;
        padding: 0 10px;
    }

    .house-main-card {
        padding: 25px 15px;
    }

    .house-shield {
        width: 140px;
        height: 140px;
    }

    .house-title {
        font-size: 1.6em;
    }

    .objective-icon,
    .activity-icon {
        font-size: 2.5em;
    }

    .leader-photo-container {
        width: 120px;
        height: 120px;
    }

    .captain-avatar {
        width: 100px;
        height: 100px;
    }

    .video-btn-house {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .video-wrapper-vertical video {
        height: 55vh;
    }

    .close-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .modal-instructions {
        bottom: 15px;
        font-size: 10px;
        white-space: normal;
        max-width: 90%;
    }

    .instruction-key {
        padding: 2px 6px;
        font-size: 10px;
    }

    .captains-section {
        margin-top: 50px;
        padding: 30px 15px;
    }

    .captains-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .captain-placeholder {
        padding: 30px 15px;
    }

    .coaches-list {
        gap: 15px;
    }

    .coach-tarjeta {
        width: 150px;
    }

    .coaches-grid {
        gap: 25px;
        margin-bottom: 30px;
    }
}