/* ========================================
   CNSC Portal - Animaciones y Estilos v2
   Portal de Apoyo Concurso Docente CNSC
   ======================================== */

:root {
    --institutional: #1a365d;
    --institutional-light: #2b4a7d;
    --hope: #2f855a;
    --hope-dark: #22543d;
    --light: #f7fafc;
    --accent: #ed8936;
}

body { font-family: 'Inter', sans-serif; }

/* ========== ANIMACIONES ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(47, 133, 90, 0.5); }
    50% { box-shadow: 0 0 25px rgba(47, 133, 90, 0.8); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* ========== CLASES ANIMACIÓN ========== */
.animate-fade-in-up { animation: fadeInUp 0.7s ease-out forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.7s ease-out forwards; }
.animate-fade-in-right { animation: fadeInRight 0.7s ease-out forwards; }
.animate-fade-in-scale { animation: fadeInScale 0.6s ease-out forwards; }
.animate-pulse { animation: pulse 2.5s infinite; }
.animate-float { animation: float 3.5s ease-in-out infinite; }
.animate-glow { animation: glow 2s ease-in-out infinite; }

.delay-100 { animation-delay: 0.1s; opacity: 0; }
.delay-200 { animation-delay: 0.2s; opacity: 0; }
.delay-300 { animation-delay: 0.3s; opacity: 0; }
.delay-400 { animation-delay: 0.4s; opacity: 0; }
.delay-500 { animation-delay: 0.5s; opacity: 0; }
.delay-600 { animation-delay: 0.6s; opacity: 0; }

/* ========== HOVER EFFECTS ========== */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.15); }

.hover-scale { transition: transform 0.3s ease; }
.hover-scale:hover { transform: scale(1.05); }

.hover-glow { transition: box-shadow 0.4s ease; }
.hover-glow:hover { box-shadow: 0 0 30px rgba(47, 133, 90, 0.5); }

/* ========== CARDS ========== */
.gradient-card {
    background: linear-gradient(135deg, #1a365d 0%, #2f855a 100%);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.image-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.image-card img {
    transition: transform 0.6s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-card:hover img { transform: scale(1.1); }

/* ========== BOTONES FLOTANTES ========== */
.floating-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.whatsapp-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.5);
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-btn:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.7);
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--institutional), var(--institutional-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    box-shadow: 0 4px 20px rgba(26, 54, 93, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.chat-toggle-btn:hover { transform: scale(1.1); }

/* ========== NARRACIÓN ========== */
.narrate-btn {
    background: linear-gradient(135deg, var(--institutional), var(--hope));
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(26, 54, 93, 0.3);
    cursor: pointer;
    border: none;
}

.narrate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(26, 54, 93, 0.4);
}

.narrate-btn.playing {
    animation: pulse 1.2s infinite;
    background: linear-gradient(135deg, var(--hope), var(--accent));
}

/* ========== TIMER ========== */
.timer-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
}

.timer-display {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.95), rgba(47, 133, 90, 0.95));
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ========== PROGRESO ========== */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(0,0,0,0.1);
    z-index: 9999;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--institutional), var(--hope), var(--accent));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    transition: width 0.3s ease;
}

/* ========== CHATBOT ========== */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    animation: fadeInUp 0.4s ease-out;
}

.chat-window.active { display: flex; }

.chat-header {
    background: linear-gradient(135deg, var(--institutional), var(--institutional-light));
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-bubble {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: fadeInUp 0.3s ease-out;
}

.chat-bubble.bot {
    background: white;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
    align-self: flex-start;
}

.chat-bubble.user {
    background: linear-gradient(135deg, var(--institutional), var(--hope));
    color: white;
    border-bottom-right-radius: 6px;
    align-self: flex-end;
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: white;
    border-radius: 20px;
    width: fit-content;
}

.typing-indicator span {
    width: 10px;
    height: 10px;
    background: #a0aec0;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

.chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chat-input-form {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f1f5f9;
    border-radius: 25px;
    padding: 6px 6px 6px 20px;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 0.95rem;
    outline: none;
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--institutional), var(--hope));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-send-btn:hover { transform: scale(1.1); }

/* ========== SIMULACRO BTN ========== */
.simulacro-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--hope), var(--hope-dark));
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 6px 25px rgba(47, 133, 90, 0.4);
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.simulacro-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 35px rgba(47, 133, 90, 0.5);
}

/* ========== SCROLLBAR ========== */
.custom-scrollbar::-webkit-scrollbar { width: 8px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #f1f1f1; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: linear-gradient(var(--institutional), var(--hope)); border-radius: 4px; }

/* ========== SEPARADORES ========== */
.section-divider {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--hope), transparent);
    margin: 3rem 0;
    animation: shimmer 3s infinite;
    background-size: 200% 100%;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .chat-window { width: calc(100vw - 40px); right: 20px; height: 450px; }
    .timer-display { font-size: 1rem; padding: 10px 16px; }
    .floating-buttons { bottom: 16px; right: 16px; }
    .whatsapp-btn, .chat-toggle-btn { width: 54px; height: 54px; font-size: 24px; }
}
