/* Variables de color de ChatGPT */
:root {
    --bg-dark: #0d0d0d;
    --input-gray: #2f2f2f;
    --text-muted: #b4b4b4;
    color-scheme: dark;
}

/* Header */
.custom-header {
    height: 60px;
}

.icon-bg {
    background-color: var(--input-gray);
    padding: 10px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plan-badge {
    background-color: #c41ac87a;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: #8c18ce;
    font-weight: bold;
}

.border-dashed-custom {
    border: 1px dashed #666;
    width: 36px;
    height: 36px;
}

/* Main Area */
#chat-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
}

.logo-central {
    width: 48px;
    height: 48px;
    opacity: 0.9;
}

/* Input Bar */
.input-container {
    background-color: var(--input-gray);
    border-radius: 30px;
    padding: 8px 16px;
    margin-bottom: env(safe-area-inset-bottom); /* Margen para la barra de inicio de iPhone */
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
}

#chat-input:focus {
    box-shadow: none;
    outline: none;
}

.btn-send {
    background-color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mensajes */
.bubble-user {
    background-color: var(--input-gray);
    border-radius: 18px;
    padding: 10px 16px;
    max-width: 85%;
    align-self: flex-end;
}

.ai-icon-small {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    padding: 4px;
}

/* Contenedores de botones circulares negros */
.icon-circle, .icon-btn-group {
    background-color: #171717; /* Gris muy oscuro casi negro */
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle {
    width: 44px;
    height: 44px;
}

/* El botón central azulado */
.upgrade-btn {
    background: linear-gradient(to right, #2a2d5e, #363a7d); /* Azul oscuro violáceo */
    color: #9da3fb; /* Texto azul claro */
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid rgba(157, 163, 251, 0.2);
}

.spark-icon {
    font-size: 12px;
    color: #9da3fb;
}

/* Grupo de botones de la derecha */
.icon-btn-group {
    height: 44px;
    padding: 0 10px;
}

.divider-v {
    width: 1px;
    height: 20px;
    background-color: #333;
    margin: 0 5px;
}

/* El mensaje de "Memoria guardada completa" */
.memory-status {
    color: #4a9eff; /* Azul brillante de la imagen */
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

/* Ajuste general para el modo oscuro iPhone */
body {
    letter-spacing: -0.01em;
    background-color: var(--bg-dark);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top); /* Margen para el Notch/Isla Dinámica */
    overflow: hidden;
}

p{
    font-size: 18px;
}




/* Drawer Base */
.side-drawer {
    position: fixed;
    top: 0;
    left: -300px; /* Escondido por defecto */
    width: 300px;
    height: 100%;
    background-color: #171717;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    overflow-y: auto;
    padding-top: env(safe-area-inset-top);
}

.side-drawer.active {
    left: 0;
}

.drawer-header {
    padding-top: calc(env(safe-area-inset-top) + 12px);
}


/* Overlay */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1040;
}

#menu-overlay.active {
    display: block;
}

/* Estilos de los items (ListTile en Flutter) */
.section-title {
    padding: 20px 16px 8px;
    color: #ffb74d; /* Naranja de Flutter .shade300 */
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.list-item {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.list-item:active {
    background: #2d2d2d;
}

.list-item .title {
    font-size: 15px;
    font-weight: 400;
}

.list-item .subtitle {
    font-size: 16px;
    color: #b0b0b0;
    max-width: 300px;
}

.divider {
    border-color: #333;
    margin: 8px 0;
}

/* Custom Switch color */
.form-check-input:checked {
    background-color: #ffb74d;
    border-color: #ffb74d;
}

/* Contenedor del selector */
.reveal-selector-container {
    display: flex;
    position: relative;
    background: #2c2c2e;
    border-radius: 10px;
    padding: 2px;
    user-select: none;
}

/* Ocultar los inputs reales */
.reveal-selector-container input {
    display: none;
}

/* Estilo de las etiquetas/botones */
.reveal-selector-container label {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 16px;
    z-index: 2;
    cursor: pointer;
    transition: color 0.3s ease;
    margin: 0;
    color: #ebebf5;
}

/* El fondo que se desliza */
.selection-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(33.33% - 2px);
    height: calc(100% - 4px);
    background: #636366; /* Color gris suave */
    border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

    /* Movimiento del slider según la selección */
    #level-direct:checked ~ .selection-slider { transform: translateX(0); }
    #level-personaje:checked ~ .selection-slider { transform: translateX(100%); }
    #level-historia:checked ~ .selection-slider { transform: translateX(200%); }

    /* Cambio de color de texto al estar activo */
    #level-direct:checked ~ label[for="level-direct"],
    #level-personaje:checked ~ label[for="level-personaje"],
    #level-historia:checked ~ label[for="level-historia"] {
        font-weight: bold;
        color: #ffffff;
    }