* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #131314;
    color: #e3e3e3;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    padding: 20px;
    overflow: hidden;
    transition: justify-content 0.5s ease;
}

body.estado-inicial {
    justify-content: center; 
}

body.chat-active { 
    justify-content: space-between; 
}

/* Estilos iniciales del Temporizador Superior (Modo Alerta/Rojo) */
.timer-container {
    position: absolute;
    top: 20px;
    font-size: 0.9rem;
    color: #ff6b6b; /* Texto rojo suave al inicio */
    background-color: rgba(255, 107, 107, 0.03);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 107, 0.2); /* Borde rojo sutil */
    letter-spacing: 0.5px;
    z-index: 10;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Transición suave de color */
}

/* Transición a VERDE cuando se activa la reflexión autónoma */
.timer-container.timer-highlight {
    color: #4eed96; /* Verde brillante */
    background-color: rgba(78, 237, 150, 0.05);
    border: 1px solid rgba(78, 237, 150, 0.4);
    box-shadow: 0 0 15px rgba(78, 237, 150, 0.15);
    animation: pulseGlow 2.5s infinite ease-in-out;
}

.timer-container #globalTimer {
    font-weight: 600;
    font-variant-numeric: tabular-nums; /* Evita que los números tiemblen al cambiar */
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

/* El resto de tus estilos del buscador se adaptan al verde */
.search-box.reflection-active {
    background: linear-gradient(#1e1f20, #1e1f20) padding-box,
                linear-gradient(90deg, #4eed96, #2bb573) border-box;
    border: 1px solid transparent;
}

.main-container {
    text-align: center;
    max-width: 720px;
    width: 100%;
    transition: all 0.5s ease;
}

.greeting {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #4285f4, #9b51e0, #e91e63);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.chat-active .main-container { 
    display: none; 
}

.chat-container {
    display: none;
    flex: 1;
    flex-direction: column;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    margin-top: 40px;
}

body.chat-active .chat-container {
    display: flex; 
}

.conversation-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.message {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-avatar { 
    background-color: #5f6368; 
    color: white; 
}

.ai-avatar { 
    background: linear-gradient(45deg, #4285f4, #9b51e0); 
    color: white; 
}

/* Alerta de Error en el chat (Para cuando te piden resolver cosas) */
.error-message .message-content {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.08);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.25);
    line-height: 1.5;
}

.message-content {
    flex: 1;
    line-height: 1.6;
    font-size: 1.05rem;
}

.message-content p { 
    margin-bottom: 12px; 
}

.message-content strong { 
    color: #fff; 
}

.input-area {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 20px;
    transition: all 0.5s ease;
}

body.estado-inicial .input-area {
    margin-top: 20px;
    padding-bottom: 0;
}

.search-form { width: 100%; }

.search-box {
    display: flex;
    align-items: center;
    background-color: #1e1f20;
    border: 1px solid transparent;
    border-radius: 30px;
    padding: 10px 20px;
    transition: background-color 0.2s, border-color 0.2s;
}

.search-box:focus-within {
    background-color: #282a2c;
    border-color: #4285f4;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #e3e3e3;
    font-size: 1.1rem;
    padding: 10px 5px;
}

.search-input::placeholder { color: #80868b; }

.submit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #4285f4;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.submit-btn:hover { 
    background-color: rgba(66, 133, 244, 0.1); 
}

.submit-btn svg { 
    width: 24px; 
    height: 24px; 
    fill: currentColor; 
}

.guia-links {
    margin-top: 15px;
    display: grid;
    gap: 10px;
}

.recurso-link {
    display: inline-block;
    background: #1e1f20;
    border: 1px solid #282a2c;
    padding: 10px 15px;
    border-radius: 8px;
    color: #4285f4;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.recurso-link:hover {
    background: #282a2c;
    border-color: #9b51e0;
    color: #fff;
}