/* ==========================================================================
   mitemario.org - Estilos de Convivencia y Amistad
   Diseñado para niños de primaria (7-8 años): amigable, claro y accesible
   ========================================================================== */

/* Variables locales de la sección */
:root {
    --conv-amber: #FF9F43;
    --conv-coral: #EE5253;
    --conv-teal: #10AC84;
    --conv-yellow: #FFD32A;
    --conv-bg-light: #FFF9F4;
    --conv-card-border: #FFE2CD;
    
    /* Semáforo */
    --light-off: #2C3E50;
    --light-red-glow: #FF3838;
    --light-yellow-glow: #FFB302;
    --light-green-glow: #0BE881;
}

/* Vista del menú de convivencia */
.convivencia-view {
    max-width: 1050px;
    margin: 0 auto;
    padding: 10px 15px 40px;
}

#card-convivencia-semaforo {
    width: 100%;
    max-width: 560px;
    min-width: 0;
    justify-self: center;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-color: #e56b35;
    background: linear-gradient(180deg, #ffffff 0%, #fff8f2 100%);
}

#card-convivencia-semaforo h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
}

#card-convivencia-semaforo .btn {
    max-width: 100%;
    white-space: normal;
}

.convivencia-hero {
    background: linear-gradient(135deg, #FFF0E6 0%, #FFE3D1 100%);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--conv-card-border);
    padding: 28px 32px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
}

.convivencia-hero-text h2 {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    color: #D35400;
    margin-bottom: 8px;
}

.convivencia-hero-text p {
    font-size: 1.1rem;
    color: var(--text-dark);
    max-width: 720px;
    line-height: 1.5;
}

.convivencia-hero-badge {
    background: white;
    border-radius: 20px;
    padding: 14px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 2px dashed #FFA07A;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 130px;
}

.convivencia-hero-badge .hero-badge-icon {
    font-size: 2.5rem;
    margin-bottom: 4px;
}

.convivencia-hero-badge .hero-badge-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    color: #E67E22;
}

/* Barra superior de navegación interna de la actividad */
.convivencia-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 24px;
}

.convivencia-nav-tabs {
    display: flex;
    gap: 10px;
    background: #FFFFFF;
    padding: 6px;
    border-radius: 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.conv-tab-btn {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.conv-tab-btn:hover {
    color: var(--text-dark);
    background: #FFF4ED;
}

.conv-tab-btn:focus-visible,
.semaforo-light:focus-visible,
.btn-perspective:focus-visible,
.btn-radar-choice:focus-visible {
    outline: 3px solid #243b53;
    outline-offset: 3px;
}

.conv-tab-btn.active {
    background: linear-gradient(135deg, #FF9F43 0%, #EE5253 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(238, 82, 83, 0.25);
}

/* Contenedores de pestañas */
.conv-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.conv-tab-content.active {
    display: block;
}

/* ==========================================================================
   PESTAÑA 1: EXPLORADOR DEL SEMÁFORO INTERACTIVO
   ========================================================================== */
.semaforo-interactive-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

/* Columna izquierda: La caja del Semáforo */
.semaforo-column {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.semaforo-column h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.semaforo-column .semaforo-instruction {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Carcasa del semáforo */
.semaforo-housing {
    width: 150px;
    background: linear-gradient(180deg, #374151 0%, #1F2937 100%);
    border-radius: 40px;
    padding: 20px 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    position: relative;
    border: 4px solid #111827;
}

/* Viseras del semáforo */
.semaforo-light-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.semaforo-light-wrapper::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 8px;
    right: 8px;
    height: 14px;
    background: #111827;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    z-index: 1;
}

.semaforo-light {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #1F2937;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.6);
    user-select: none;
}

.semaforo-light:hover {
    transform: scale(1.05);
}

.semaforo-light .light-icon {
    font-size: 2.2rem;
    filter: grayscale(80%) opacity(50%);
    transition: all 0.3s ease;
}

.semaforo-light .light-text {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Estados Apagados */
.light-red {
    background: radial-gradient(circle at 35% 35%, #7F1D1D 0%, #450A0A 100%);
}
.light-yellow {
    background: radial-gradient(circle at 35% 35%, #78350F 0%, #451A03 100%);
}
.light-green {
    background: radial-gradient(circle at 35% 35%, #064E3B 0%, #022C22 100%);
}

/* Estados Encendidos con Resplandor (Glow) */
.semaforo-light.active.light-red {
    background: radial-gradient(circle at 40% 35%, #FF7675 0%, #D63031 70%, #9B111E 100%);
    box-shadow: 0 0 35px #FF3838, 0 0 60px rgba(255, 56, 56, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.7);
    transform: scale(1.08);
}
.semaforo-light.active.light-red .light-icon {
    filter: none;
    transform: scale(1.1);
}
.semaforo-light.active.light-red .light-text {
    color: #FFFFFF;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.semaforo-light.active.light-yellow {
    background: radial-gradient(circle at 40% 35%, #FFEAA7 0%, #FDCB6E 70%, #D49B00 100%);
    box-shadow: 0 0 35px #FDCB6E, 0 0 60px rgba(253, 203, 110, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.8);
    transform: scale(1.08);
}
.semaforo-light.active.light-yellow .light-icon {
    filter: none;
    transform: scale(1.1);
}
.semaforo-light.active.light-yellow .light-text {
    color: #451A03;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.semaforo-light.active.light-green {
    background: radial-gradient(circle at 40% 35%, #55EFC4 0%, #00B894 70%, #008566 100%);
    box-shadow: 0 0 35px #00B894, 0 0 60px rgba(0, 184, 148, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.8);
    transform: scale(1.08);
}
.semaforo-light.active.light-green .light-icon {
    filter: none;
    transform: scale(1.1);
}
.semaforo-light.active.light-green .light-text {
    color: #FFFFFF;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Poste del semáforo */
.semaforo-pole {
    width: 28px;
    height: 38px;
    background: linear-gradient(90deg, #4B5563 0%, #1F2937 50%, #111827 100%);
    border-radius: 0 0 6px 6px;
}

.semaforo-base {
    width: 80px;
    height: 12px;
    background: #111827;
    border-radius: 10px;
}

/* Columna derecha: El panel de contenido según la luz seleccionada */
.semaforo-detail-column {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 26px 28px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
}

/* Selector de perspectiva (Lo que doy vs Lo que permito) */
.perspective-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 2px dashed #F1F2F6;
}

.perspective-label {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.perspective-buttons {
    display: flex;
    gap: 8px;
}

.btn-perspective {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: #F8FAFC;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-perspective:hover {
    border-color: #FFA07A;
    color: var(--text-dark);
}

.btn-perspective.active {
    background: #FFF0E6;
    border-color: #FF9F43;
    color: #D35400;
    font-weight: 800;
}

/* Encabezado del color activo */
.detail-color-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.detail-color-header.header-red {
    background: linear-gradient(135deg, #FFE8E8 0%, #FFD6D6 100%);
    border-left: 6px solid #FF3838;
}

.detail-color-header.header-yellow {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF0BA 100%);
    border-left: 6px solid #FFB302;
}

.detail-color-header.header-green {
    background: linear-gradient(135deg, #E6FAF4 0%, #C4F7E6 100%);
    border-left: 6px solid #00B894;
}

.color-header-badge {
    font-size: 2.5rem;
    line-height: 1;
}

.color-header-title h4 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.header-red .color-header-title h4 { color: #C0392B; }
.header-yellow .color-header-title h4 { color: #B7791F; }
.header-green .color-header-title h4 { color: #008566; }

.color-header-title p {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* Tarjetas con ejemplos de conductas */
.conductas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.conducta-item {
    background: #F8FAFC;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #E2E8F0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.conducta-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.conducta-item .conducta-icon {
    font-size: 1.8rem;
    min-width: 38px;
    text-align: center;
}

.conducta-item .conducta-text {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

/* Caja de consejo práctico: "¿Qué hacer ante este color?" */
.color-action-box {
    border-radius: 16px;
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.color-action-box.action-red {
    background: #FFF5F5;
    border: 2px solid #FED7D7;
}

.color-action-box.action-yellow {
    background: #FFFAF0;
    border: 2px solid #FEEBC8;
}

.color-action-box.action-green {
    background: #F0FFF4;
    border: 2px solid #C6F6D5;
}

.action-box-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.action-box-content h5 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 4px;
}

.action-red .action-box-content h5 { color: #C53030; }
.action-yellow .action-box-content h5 { color: #C05621; }
.action-green .action-box-content h5 { color: #22543D; }

.action-box-content p {
    font-size: 0.94rem;
    color: var(--text-dark);
    line-height: 1.45;
}

/* ==========================================================================
   PESTAÑA 2: JUEGO "MISIÓN RADAR DEL RECREO"
   ========================================================================== */
.radar-game-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
    max-width: 800px;
    margin: 0 auto;
}

.radar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.radar-step-badge {
    background: #FFF0E6;
    color: #D35400;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #FFD8BE;
}

.radar-score-badge {
    background: #E6FAF4;
    color: #008566;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #A3E9D2;
}

.radar-progress-bar {
    width: 100%;
    height: 10px;
    background: #EDF2F7;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 26px;
}

.radar-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF9F43 0%, #00B894 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.radar-scenario-box {
    background: linear-gradient(135deg, #F8FAFC 0%, #EDF2F7 100%);
    border: 2px solid #CBD5E1;
    border-radius: 20px;
    padding: 24px 28px;
    text-align: center;
    margin-bottom: 26px;
}

.radar-scenario-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.radar-scenario-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--text-dark);
    line-height: 1.4;
    max-width: 650px;
    margin: 0 auto;
}

.radar-question-prompt {
    font-size: 1.1rem;
    font-weight: 800;
    color: #4A5568;
    text-align: center;
    margin-bottom: 18px;
}

/* Opciones de respuesta: Los 3 botones del semáforo */
.radar-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.btn-radar-choice {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 16px 14px;
    border-radius: 18px;
    border: 3px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.btn-radar-choice:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
}

.btn-radar-choice .choice-icon {
    font-size: 2rem;
}

.btn-choice-red {
    background: #FFF5F5;
    color: #C53030;
    border-color: #FEB2B2;
}
.btn-choice-red:hover:not(:disabled) {
    background: #FED7D7;
    border-color: #FC8181;
}

.btn-choice-yellow {
    background: #FFFAF0;
    color: #C05621;
    border-color: #FBD38D;
}
.btn-choice-yellow:hover:not(:disabled) {
    background: #FEEBC8;
    border-color: #F6AD55;
}

.btn-choice-green {
    background: #F0FFF4;
    color: #22543D;
    border-color: #9AE6B4;
}
.btn-choice-green:hover:not(:disabled) {
    background: #C6F6D5;
    border-color: #68D391;
}

/* Feedback tras responder */
.radar-feedback-box {
    display: none;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 22px;
    text-align: left;
    animation: fadeIn 0.3s ease;
}

.radar-feedback-box.feedback-correct {
    background: #F0FFF4;
    border: 2px solid #48BB78;
    color: #22543D;
}

.radar-feedback-box.feedback-retry {
    background: #FFF5F5;
    border: 2px solid #F56565;
    color: #742A2A;
}

.feedback-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-desc {
    font-size: 0.98rem;
    line-height: 1.45;
}

.feedback-tip {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 0, 0, 0.15);
    font-size: 0.92rem;
    font-weight: 700;
}

.radar-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
}

/* Pantalla final de victoria en el Radar */
.radar-congrats-box {
    text-align: center;
    padding: 20px 10px;
}

.congrats-trophy {
    font-size: 4.5rem;
    margin-bottom: 14px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.radar-congrats-box h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #008566;
    margin-bottom: 10px;
}

.radar-congrats-box p {
    font-size: 1.15rem;
    color: var(--text-dark);
    max-width: 580px;
    margin: 0 auto 24px;
    line-height: 1.5;
}

/* ==========================================================================
   PESTAÑA 3: GUÍA DE RESPUESTAS VALIENTES & ANTIBULLYING
   ========================================================================== */
.guia-valiente-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.guia-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 26px 30px;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--border-color);
}

.guia-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.guia-card-icon {
    font-size: 2.4rem;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guia-card-title h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.guia-card-title span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 700;
}

.phrase-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.phrase-card {
    background: #F8FAFC;
    border-radius: 14px;
    padding: 16px;
    border-left: 5px solid #FF9F43;
}

.phrase-card.phrase-red {
    border-left-color: #FF3838;
    background: #FFF5F5;
}

.phrase-card.phrase-yellow {
    border-left-color: #FFB302;
    background: #FFFAF0;
}

.phrase-card.phrase-green {
    border-left-color: #00B894;
    background: #F0FFF4;
}

.phrase-card .phrase-when {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.phrase-card .phrase-quote {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.35;
}

/* Cuadro especial: ¿Chivarse o Proteger? */
.dilemma-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 14px;
}

.dilemma-col {
    border-radius: 16px;
    padding: 18px 20px;
}

.dilemma-chivarse {
    background: #FFF5F5;
    border: 2px dashed #FEB2B2;
}

.dilemma-proteger {
    background: #F0FFF4;
    border: 2px solid #68D391;
}

.dilemma-col h4 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dilemma-chivarse h4 { color: #C53030; }
.dilemma-proteger h4 { color: #22543D; }

.dilemma-col p {
    font-size: 0.94rem;
    line-height: 1.45;
    color: var(--text-dark);
}

/* ==========================================================================
   RESPONSIVIDAD Y AJUSTES MÓVILES
   ========================================================================== */
@media (max-width: 860px) {
    .semaforo-interactive-container {
        grid-template-columns: 1fr;
    }
    
    .semaforo-column {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
        text-align: left;
    }
    
    .semaforo-housing {
        flex-direction: row;
        width: auto;
        height: 130px;
        padding: 14px 20px;
    }
    
    .semaforo-light-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .semaforo-light {
        width: 80px;
        height: 80px;
    }
    
    .semaforo-light .light-icon {
        font-size: 1.6rem;
    }
    
    .semaforo-light .light-text {
        font-size: 0.65rem;
    }
    
    .semaforo-pole, .semaforo-base {
        display: none;
    }
}

@media (max-width: 600px) {
    .convivencia-hero {
        flex-direction: column;
        text-align: center;
        padding: 22px 18px;
    }
    
    .convivencia-top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .convivencia-nav-tabs {
        flex-direction: column;
        border-radius: 20px;
    }
    
    .conv-tab-btn {
        justify-content: center;
    }
    
    .semaforo-column {
        flex-direction: column;
        text-align: center;
    }
    
    .semaforo-housing {
        flex-direction: column;
        width: 140px;
        height: auto;
    }
    
    .radar-options-grid {
        grid-template-columns: 1fr;
    }
    
    .dilemma-compare {
        grid-template-columns: 1fr;
    }
}
