/* VARIABLES Y RESETEO */
:root {
    --color-primary: #1E88E5; /* Azul - Confianza */
    --color-secondary: #43A047; /* Verde - Convivencia */
    --color-accent: #FFB300; /* Amarillo Energético */
    --color-accent-dark: #F57C00; /* Naranja Energético */
    --color-danger: #e53935; /* Rojo Alerta */
    
    --text-main: #2d3748;
    --text-muted: #718096;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    text-decoration: none;
    background: var(--color-secondary);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #2E7D32;
    transform: translateY(-2px);
}

/* 1. HERO SECTION */
.hero {
    display: flex;
    flex-direction: column;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    text-align: center;
    min-height: 80vh;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.badge {
    background: var(--color-accent);
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.hero h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.highlight-text {
    color: var(--color-primary);
    position: relative;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(30, 136, 229, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(30, 136, 229, 0.6);
}

.hero-image img {
    max-width: 100%;
    width: 350px;
}

/* COMUNES */
section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* 2. ¿QUÉ ES SER UN BUEN CIUDADANO DIGITAL? */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.info-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    flex: 1 1 300px;
    max-width: 500px;
    text-align: left;
    transition: transform 0.3s ease;
    border-top: 5px solid;
}

.info-card:hover {
    transform: translateY(-10px);
}

.good-card {
    border-top-color: var(--color-secondary);
}

.bad-card {
    border-top-color: var(--color-danger);
}

.info-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.icon-green { color: var(--color-secondary); }
.icon-red { color: var(--color-danger); }

.info-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.info-card ul {
    list-style: none;
}

.info-card li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
}

.good-card li i { font-size: 1.2rem; margin:0; color: var(--color-secondary); }
.bad-card li i { font-size: 1.2rem; margin:0; color: var(--color-danger); }

/* 3. PROBLEMAS EN INTERNET */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.problem-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-accent-dark);
    transition: all 0.3s ease;
}

.problem-card:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.02);
}

.problem-icon {
    font-size: 2.5rem;
    color: var(--color-accent-dark);
    margin-bottom: 1rem;
}

.problem-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.problem-card .desc {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.example {
    background: #FFF3E0;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #E65100;
}

.consequence {
    background: #FFEBEE;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #B71C1C;
}

/* 4. VIDEOS EDUCATIVOS */
.videos-section {
    background: #E8F5E9;
    border-radius: var(--radius-lg);
    margin: 4rem auto;
    max-width: 100%;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.video-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.video-card h3 {
    margin-bottom: 1rem;
    color: var(--color-secondary);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspecto */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
}

/* 5. ACTIVIDADES INTERACTIVAS */
.actividades-section {
    background: var(--color-primary);
    color: white;
    padding: 5rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 4rem;
}

.actividades-section .section-title {
    color: white;
}

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

.activity-card {
    background: white;
    color: var(--text-main);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.act-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.act-num {
    background: var(--color-accent);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
}

.activity-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Botones genéricos de acción */
.action-btn {
    border: none;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    color: white;
}
.btn-blue { background: var(--color-primary); }
.btn-green { background: var(--color-secondary); }

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Actividad 2 / Error Post */
.simulated-post {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1rem;
    background: #f8fafc;
}
.post-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #cbd5e1;
}
.time {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.post-content {
    font-size: 1rem;
    margin-bottom: 1rem;
}
.post-actions {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.like-btn, .share-btn, .report-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.like-btn:hover { background: #e2e8f0; color: #3b82f6;}
.share-btn:hover { background: #e2e8f0; }

.report-btn {
    color: var(--color-danger);
    background: #ffebee;
}
.report-btn:hover {
    background: #ffcdd2;
}

/* Actividad 3 / Checklist */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.check-container {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 1rem;
}

.check-container input {
    margin-top: 5px;
    width: 18px;
    height: 18px;
    accent-color: var(--color-secondary);
}

.progress-bar-container {
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: var(--color-secondary);
    transition: width 0.4s ease;
}

.status-text {
    font-size: 0.9rem;
    text-align: center;
    font-weight: 600;
}

/* 6. EMPATÍA DIGITAL */
.empatia-section {
    background: url('https://images.unsplash.com/photo-1516321497487-e288fb19713f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1400&q=80') center/cover;
    position: relative;
    border-radius: var(--radius-lg);
    padding: 6rem 2rem;
    color: white;
    text-align: center;
    margin-bottom: 4rem;
}

.empatia-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30, 136, 229, 0.85); /* Azul con transparencia */
    border-radius: var(--radius-lg);
}

.empatia-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.empatia-content h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.empatia-content h3 { font-style: italic; font-weight: 300; font-size: 1.6rem; margin-bottom: 2rem; }
.empatia-content p { font-size: 1.2rem; }

/* 7. CONSEJOS PRÁCTICOS */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.tip-card {
    text-align: center;
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
}

.bg-blue { background: var(--color-primary); }
.bg-red { background: var(--color-danger); }
.bg-green { background: var(--color-secondary); }
.bg-yellow { background: var(--color-accent); }

.tip-card h4 { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--text-main); }
.tip-card p { color: var(--text-muted); font-size: 0.95rem; }

/* 8. RETO FINAL (GAMIFICACIÓN) */
.reto-section {
    text-align: center;
    margin-bottom: 4rem;
}

.reto-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 0 auto;
    border: 4px solid var(--color-accent);
}

.reto-card h2 {
    color: var(--color-accent-dark);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.promise-box {
    background: #FFF8E1;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin: 2rem 0;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    color: #F57F17;
}

.promise-box input {
    width: 30px;
    height: 30px;
    accent-color: #F57F17;
    cursor: pointer;
}

.final-btn {
    width: 100%;
    justify-content: center;
}

.final-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

footer {
    background: #1e293b;
    color: white;
    text-align: center;
    padding: 2rem;
}

/* ANIMACIONES (JS CONTROLADO) */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}
.fade-in.visible {
    opacity: 1;
}

.slide-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease-out;
}
.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s ease-out;
}
.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* PULSE ANIMATION PARA EL BOTON DENUNCIAR */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(229, 57, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

.pulse-anim {
    animation: pulse-red 2s infinite;
}

/* INPUT NAME */
.input-name {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    text-align: center;
    font-family: inherit;
    transition: border-color 0.3s;
}
.input-name:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* CERTIFICADO MODAL */
.certificate-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    overflow-y: auto;
}
.certificate-overlay.active {
    display: flex;
}
.certificate-container {
    background: white;
    width: 100%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    margin: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    text-align: center;
}
.close-cert {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer; color: var(--text-muted);
}
.cert-border {
    border: 10px solid var(--color-primary);
    padding: 10px;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}
.cert-content {
    border: 4px solid var(--color-accent);
    padding: 2rem 1.5rem;
    border-radius: 8px;
    background: #fff;
    background-image: radial-gradient(#FFB300 0.5px, transparent 0.5px);
    background-size: 15px 15px;
}
.gold-medal {
    font-size: 3rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}
.cert-header h2 {
    font-size: 2rem;
    color: var(--text-main);
    letter-spacing: 1px;
}
.cert-header h3 {
    font-size: 1.3rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}
.cert-body p {
    font-size: 1.1rem;
    color: var(--text-muted);
}
.student-name-display {
    font-size: 2.2rem;
    color: var(--color-secondary);
    margin: 1rem 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    border-bottom: 2px solid #cbd5e1;
    display: inline-block;
    padding: 0 1.5rem;
}
.cert-signatures {
    display: flex;
    justify-content: space-around;
    margin-top: 3rem;
}
.sig {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.sig hr {
    width: 150px;
    border: none;
    border-top: 2px solid var(--text-main);
}
.cert-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.btn-print {
    background: var(--color-secondary);
    color: white; border: none; padding: 1rem 2rem;
    border-radius: var(--radius-md); font-size: 1.2rem;
    cursor: pointer; font-weight: 600; transition: transform 0.2s;
}
.btn-print:hover { transform: scale(1.05); }

/* CUSTOM VIDEO PLAYERS AESTHETICS */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent-dark));
}
.custom-video-thumb {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: block;
    text-decoration: none;
    background-size: cover;
    background-position: center;
    background-color: transparent;
}
.thumb-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 51, 153, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease;
}
.custom-video-thumb:hover .thumb-overlay {
    background: rgba(0, 51, 153, 0.1);
}
.play-circle {
    width: 80px; height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    color: var(--color-primary);
    font-size: 2.5rem;
    padding-left: 8px; /* Optical center */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.custom-video-thumb:hover .play-circle {
    transform: scale(1.1);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    color: var(--color-accent-dark);
}
.video-hint {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 1rem;
    font-weight: 500;
}


/* RESPONSIVE DESIGNS */
@media (min-width: 768px) {
    .hero {
        flex-direction: row;
        text-align: left;
    }
    .hero-content {
        flex: 1;
    }
    .hero-image {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    .hero h1 {
        font-size: 3.5rem;
    }
}

/* OPCIONES DE IMPRESIÓN */
@media print {
    body * { visibility: hidden; }
    .certificate-container, .certificate-container * {
        visibility: visible;
    }
    .certificate-container {
        position: absolute;
        left: 0; top: 0; width: 100%; padding: 0; box-shadow: none; border:none;
    }
    .cert-actions, .close-cert { display: none !important; }
}
