/* =================================================================== */
/*      MAKUMOTO - GENERIC STYLES (v2.0 REFACTOR)
/*      Base, Variables, UI Kit y Utilidades
/* =================================================================== */

:root {
    /* --- PALETA DE COLORES --- */
    --color-primary: #FFD700;       /* Amarillo Makumoto */
    --color-primary-dim: rgba(255, 215, 0, 0.2);
    --color-background: #000000;    /* Negro Puro */
    --color-surface: #111111;       /* Gris Surface */
    --color-border: #222222;        /* Bordes sutiles */
    
    --color-text-primary: #ffffff;
    --color-text-secondary: #aaaaaa;
    --color-danger: #e74c3c;
    
    /* --- TIPOGRAFÍA --- */
    --font-family: 'Poppins', sans-serif;
    --border-radius: 16px;
    --border-radius-pill: 50px;

    /* --- SISTEMA DE CAPAS (Z-INDEX) --- */
    /* Usaremos estas variables en dashboard.css y modals.css */
    --z-back: -1;
    --z-base: 1;
    --z-nav: 100;      /* Barras de navegación */
    --z-float: 200;    /* Botones flotantes */
    --z-modal: 300;    /* Ventanas emergentes */
    --z-overlay: 400;  /* Pantallas de carga */
    --z-alert: 500;    /* Alertas críticas */
    --z-god: 9999;     /* Debug o casos extremos */
}

/* =================================================================== */
/*      1. RESET & BASE
/* =================================================================== */

*, *::before, *::after {
    box-sizing: border-box; /* Vital para layout */
}

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden; /* Previene scroll horizontal accidental */
}

/* Breadcrumbs (Navegación simple) */
.breadcrumb { margin: 10px; }
.breadcrumb-btn {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    padding: 5px 0;
    font-family: var(--font-family);
}
.breadcrumb-btn:hover { color: var(--color-primary); }

/* =================================================================== */
/*      2. UI KIT - TARJETAS
/* =================================================================== */

/* Card Base Genérica */
.card {
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: 1px solid var(--color-border);
}

/* =================================================================== */
/*      3. UI KIT - BOTONES
/* =================================================================== */

/* Base del Botón */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius-pill);
    font-family: var(--font-family);
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, box-shadow 0.2s, background-color 0.2s;
    text-decoration: none;
}

.btn:active { transform: scale(0.95); }

/* Variantes */
.btn-primary {
    background-color: var(--color-primary);
    color: #000;
    box-shadow: 0 4px 15px var(--color-primary-dim);
}
.btn-primary:hover {
    background-color: #ffe033; /* Un poco más claro */
}

.btn-primary-glow {
    background-color: var(--color-primary);
    color: #000;
    border: 2px solid #fff; /* Borde blanco para resaltar */
    box-shadow: 0 0 15px var(--color-primary);
    animation: btn-pulse 2s infinite;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    font-weight: 600;
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background-color: var(--color-danger);
    color: #fff;
}
.btn-danger:hover {
    background-color: #c0392b;
}

/* Botón Icono Redondo (Para chats, envíos) */
.btn-icon-send {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #000;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.2s;
}
.btn-icon-send:active { transform: scale(0.9); }

/* =================================================================== */
/*      4. UI KIT - FORMULARIOS
/* =================================================================== */

/* Usamos la clase .mk-input para no romper inputs de terceros (PayPal) */
.mk-input,
textarea.mk-input,
select.mk-input {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.2s;
}

/* Soporte legacy para inputs sin clase (solo tipos específicos) */
/* Idealmente, migrar todo a .mk-input y borrar este bloque */
input[type="text"]:not(.no-style), 
input[type="number"]:not(.no-style), 
input[type="date"]:not(.no-style),
input[type="email"]:not(.no-style),
input[type="password"]:not(.no-style) {
    background: #222;
    border: 1px solid #444;
    color: #fff;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-family);
}

.mk-input:focus, 
textarea.mk-input:focus, 
select.mk-input:focus,
input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* =================================================================== */
/*      5. COMPONENTE: CHAT DE AYUDA (Refactorizado)
/* =================================================================== */

.chat-layout-card {
    display: flex; flex-direction: column;
    height: calc(100vh - 140px); /* Ajuste de altura dinámica */
    background: #111;
    overflow: hidden; 
    border: none;
    /* Se asume que está dentro de un contenedor modal */
}

.chat-header {
    padding: 15px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    font-weight: 700;
}

.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex; flex-direction: column; gap: 15px;
    background-color: #000;
}

/* Burbujas de Chat */
.message-bubble {
    display: flex; gap: 10px; max-width: 85%;
    align-items: flex-end; /* Alinear avatar abajo */
}

.message-bubble.bot { align-self: flex-start; }
.message-bubble.user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.message-bubble.bot .msg-avatar {
    background: #333;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}
.message-bubble.user .msg-avatar {
    background: var(--color-primary);
    color: #000;
}

.msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-bubble.bot .msg-content {
    background: #222;
    color: #fff;
    border-bottom-left-radius: 2px; /* Estilo 'pico' */
}
.message-bubble.user .msg-content {
    background: var(--color-primary);
    color: #000;
    border-bottom-right-radius: 2px; /* Estilo 'pico' */
    font-weight: 500;
}

.chat-input-wrapper {
    padding: 15px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    display: flex; gap: 10px; align-items: center;
}

/* =================================================================== */
/*      6. COMPONENTE: POST DE TEXTO (Twitter Style)
/* =================================================================== */

.twitter-style-card {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: white;
}

.ts-header { display: flex; align-items: center; gap: 10px; z-index: 2; }
.ts-avatar {
    width: 45px; height: 45px; border-radius: 50%;
    background-size: cover; border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.ts-info h4 { margin: 0; font-size: 1rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.ts-info span { font-size: 0.8rem; opacity: 0.9; }

.ts-body {
    flex-grow: 1;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 0 15px; z-index: 2;
}
.ts-text {
    font-size: 1.6rem; font-weight: 700; line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.ts-footer {
    display: flex; justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    z-index: 2;
}
.ts-btn {
    background: none; border: none; color: white;
    font-size: 1.3rem; display: flex; align-items: center; gap: 5px;
    cursor: pointer; text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.ts-btn span { font-size: 0.9rem; font-weight: bold; }

/* =================================================================== */
/*      7. UTILIDADES & TEMAS
/* =================================================================== */

/* Centrado Absoluto */
.centered-text-content {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center;
    height: 100%; width: 100%; padding: 20px;
}

/* Temas de Fondo (Gradientes) */
.theme-male { background: linear-gradient(-45deg, #1a237e, #0d47a1, #0277bd, #1a237e); }
.theme-female { background: linear-gradient(-45deg, #880e4f, #c2185b, #ec407a, #ad1457); }
.theme-sponsor { background: linear-gradient(-45deg, #000, #333, #FFD700, #b8860b); }
.theme-expert { background: linear-gradient(-45deg, #004d40, #00695c, #26a69a, #004d40); }
.theme-humor { background: linear-gradient(-45deg, #e65100, #f57c00, #ff9800, #ef6c00); }
.theme-makumoto { background: linear-gradient(-45deg, #000, #212121, #424242, #000); }

/* Fondo Animado Genérico */
.animated-bg {
    background-size: 200% 200%;
    animation: gradient-flow 10s ease infinite;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

/* Efecto de Ruido (Opcional, para textura) */
.animated-bg::before {
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.4; pointer-events: none;
}

/* =================================================================== */
/*      8. ANIMACIONES GLOBALES
/* =================================================================== */

@keyframes btn-pulse {
    0% { box-shadow: 0 0 10px var(--color-primary); }
    50% { box-shadow: 0 0 25px var(--color-primary), 0 0 5px #fff; }
    100% { box-shadow: 0 0 10px var(--color-primary); }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes nav-social-pulse {
    0% { transform: scale(1); text-shadow: 0 0 0 rgba(255,255,255,0); color: #fff; }
    50% { transform: scale(1.4); text-shadow: 0 0 15px #00e676; color: #00e676; }
    100% { transform: scale(1); text-shadow: 0 0 0 rgba(255,255,255,0); color: #fff; }
}

/* Clase utilitaria para activar la animación de pulso en JS */
.is-pulsing i {
    animation: nav-social-pulse 0.4s ease-in-out forwards;
}
/* =================================================================== */
/*      ESTILOS DE TEMA: DARK (Base) vs PASTEL (Activo)
/* =================================================================== */

/* --- 1. BASE: DARK MODE (Por defecto) --- */
.journey-card {
    background: #000; 
    color: #fff;
    border: 1px solid #333;
}
.journey-btn {
    background: #111;
    border: 1px solid #333;
    color: #fff;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}

/* --- 2. MODO PASTEL (ACTIVADO) --- */
body.theme-pastel {
    /* Colores Pastel */
    --color-background: #FFE4E1 !important; /* Rosa Pastel */
    --color-surface: #FFFFFF !important;     /* Blanco */
    --color-border: #FFB7B2 !important;      /* Rosa fuerte */
    --color-text-primary: #000000 !important;
    --color-primary: #D6A2E8 !important;     /* Morado Pastel */
    --color-danger: #FF6961 !important;
}

/* Forzar BLANCO en los Modales */
body.theme-pastel .journey-card,
body.theme-pastel .modal-content,
body.theme-pastel #account-subview-container {
    background-color: #FFFFFF !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    border-color: #D6A2E8 !important;
    box-shadow: 0 10px 40px rgba(214, 162, 232, 0.2) !important;
}

/* Textos Negros */
body.theme-pastel h1, body.theme-pastel h2, body.theme-pastel h3, body.theme-pastel div, body.theme-pastel span {
    color: #000000 !important;
    text-shadow: none !important;
}
body.theme-pastel .timer-badge {
    border-color: #D6A2E8 !important;
    color: #D6A2E8 !important;
}

/* Botones en Pastel */
body.theme-pastel .journey-btn {
    background-color: #F9F9F9 !important;
    border: 1px solid #E0E0E0 !important;
    color: #000 !important;
}

/* --- 3. ESTILO DEL SWITCH (TOGGLE) --- */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}
.theme-switch input { 
  opacity: 0; width: 0; height: 0; 
}
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #333; /* Color apagado */
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute; content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
/* Color al activar (Verde o Morado Pastel) */
input:checked + .slider {
  background-color: #D6A2E8; 
}
input:checked + .slider:before {
  transform: translateX(22px);
}