:root {
    /* Colores inspirados en el logo ARIF HUB */
    --primary: #007791; /* Azul petróleo del logo */
    --secondary: #0ea5e9; /* Turquesa brillante */
    --dark: #083344; /* Azul muy oscuro para contraste */
    --slate: #64748b;
    --light: #f0f9ff;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--dark);
    color: #1e293b;
    overflow-x: hidden;
}

/* Navegación Estilo PowerPoint */
.slide-nav {
    background: rgba(8, 51, 68, 0.95);
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #164e63;
}

.step {
    padding: 10px 18px;
    border-radius: 30px;
    border: 1px solid #164e63;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    transition: all 0.3s;
}

.step.active {
    background: var(--primary);
    color: white;
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(0, 119, 145, 0.4);
}

/* Estructura de Slides */
.presentation-wrapper {
    max-width: 1100px;
    margin: 50px auto;
    padding: 0 20px;
    min-height: 600px;
    position: relative;
    overflow: hidden; /* Evita que el contenido de slides inactivas interfiera */
}

.slide {
    display: none;
    background: white;
    border-radius: 24px;
    padding: 60px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: fadeInScale 0.4s ease-out;
    width: 100%;
    box-sizing: border-box;
}

.slide.active { 
    display: block; 
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.slide-title {
    font-size: 2.2rem;
    margin-top: 0;
    color: var(--dark);
    border-left: 6px solid var(--primary);
    padding-left: 20px;
    margin-bottom: 40px;
}

/* Layouts */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    font-size: 1.1rem;
}

.feature-list i {
    color: var(--primary);
    font-size: 1.4rem;
    margin-top: 3px;
}

/* Ventana de Log */
.log-window {
    background: #1e1e1e;
    color: #71daff;
    padding: 25px;
    border-radius: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.log-window::before {
    content: "ARIF_HUB_MONITOR.LOG";
    display: block;
    margin-bottom: 15px;
    color: #565c7e;
    font-size: 0.7rem;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

/* Formulario */
.project-form {
    background: var(--light);
    padding: 30px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input, select, textarea {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
}

/* Controles Inferiores */
.footer-controls {
    max-width: 1100px;
    margin: 30px auto 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-button {
    background: #164e63;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-button:hover:not(:disabled) {
    background: var(--primary);
    transform: translateY(-2px);
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 850px) {
    .content-grid { grid-template-columns: 1fr; }
    .slide { padding: 30px; }
}

svg { transition: transform 0.5s ease; }
.slide.active svg { transform: rotate(360deg); } /* Efecto sutil al entrar */

.typing {
    display: flex;
    gap: 4px;
    padding: 10px;
}
.typing span:nth-child(1) { animation-delay: -0.32s; }
.typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.typing span {
    width: 8px;
    height: 8px;
    background: #555;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

#chat-window {
    position: fixed; 
    bottom: 100px; 
    right: 30px; 
    width: 350px; 
    height: 450px; 
    background: white; 
    border-radius: 20px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.2); 
    flex-direction: column; 
    overflow: hidden; 
    z-index: 2000; 
    border: 1px solid #e2e8f0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none; /* Evita que se pueda interactuar cuando está invisible */
}

/* Nueva clase para cuando el chat esté abierto */
#chat-window.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    display: flex !important; /* Forzamos el flex que tenías */
}

/* Asegura que el texto no se salga de la burbuja */
.message-bot {
    background: #e2e8f0;
    padding: 12px;
    border-radius: 15px 15px 15px 0;
    font-size: 0.85rem;
    max-width: 80%;
    align-self: flex-start;
    margin-bottom: 10px;
    
    /* Reglas de oro para evitar desbordamientos */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap; /* Mantiene los saltos de línea */
    display: inline-block; /* Ajusta la burbuja al contenido */
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.opinion-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.opinion-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.05);
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.rating {
    color: #fbbf24; /* Color oro para las estrellas */
    font-size: 0.8rem;
    margin-bottom: 10px;
}

/* Corrección para el contenedor de la terminal interactiva */
#terminal-juego {
    max-height: 380px;
    overflow: hidden; /* Evita que la ventana negra se estire */
}

#terminal-output {
    scrollbar-width: thin; /* Barra de scroll sutil en Firefox */
    scrollbar-color: var(--primary) #1e1e1e;
}

/* Barra de scroll estética para navegadores basados en Chrome/Webkit */
#terminal-output::-webkit-scrollbar {
    width: 6px;
}
#terminal-output::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 10px;
}
#terminal-output::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}
#terminal-output::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}
/* ==========================================================================
   MODO NOCHE / LABORATORIO
   ========================================================================== */

/* Variables para el modo noche */
body.night-mode {
    background-color: #090d16; /* Fondo de página ultra oscuro */
    color: #f1f5f9;
}

/* Cambios de las slides al activar modo noche */
body.night-mode .slide {
    background: #111827; /* Fondo de la tarjeta en oscuro */
    box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 25px rgba(14, 165, 233, 0.1);
    color: #cbd5e1;
}

body.night-mode .slide-title {
    color: #f8fafc;
    border-left-color: var(--secondary);
}

/* Elementos específicos que pasan a formato oscuro */
body.night-mode h3, 
body.night-mode h4,
body.night-mode .slide strong {
    color: #ffffff;
}

body.night-mode .project-form,
body.night-mode style {
    background: #1f2937;
}

body.night-mode input, 
body.night-mode select, 
body.night-mode textarea {
    background: #111827;
    color: white;
    border-color: #374151;
}

/* Forzar que el contenedor de la calculadora se vea bien en oscuro */
body.night-mode div[style*="background: var(--light)"] {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

/* BOTÓN FLOTANTE MODO DÍA/NOCHE */
#theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px; /* En el lado opuesto al chat para que no se pisen */
    width: 60px;
    height: 60px;
    background: var(--dark);
    border: 2px solid #164e63;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24; /* Color sol */
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 2000;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

/* Estilo del botón cuando está en modo noche */
body.night-mode #theme-toggle {
    background: #1f2937;
    border-color: var(--secondary);
    color: #e2e8f0; /* Color luna */
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.2);
}

body.night-mode .python-tasks {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

body.night-mode .python-tasks h4 {
    color: #ffe169 !important;
}

body.night-mode code {
    background: #111827;
    color: #f43f5e;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}
/* Soporte de Modo Noche para el apartado Sobre Nosotros */
body.night-mode .slide blockquote {
    color: #e2e8f0;
    border-left-color: var(--secondary);
}

body.night-mode .slide div[style*="background: white"] {
    background: #1f2937 !important; /* Tarjetas de estadísticas internas en oscuro */
    border-color: #374151 !important;
}

body.night-mode .slide div[style*="background: white"] div {
    color: #ffffff !important;
}

body.night-mode .slide div[style*="background: var(--light)"] {
    background: #1f2937 !important;
    border-color: #374151 !important;
}

body.night-mode .slide a[onclick*="goToSlide"] {
    color: var(--secondary) !important;
}