/* =========================================================
   ESTILOS GLOBALES SONODIT (DNA GOOGLE AI STUDIO / GEMINI)
========================================================= */
:root {
    --google-bg: #131314;
    --google-surface: #1e1f20;
    --google-surface-hover: #2b2c2f;
    --google-border: #444746;
    --google-blue: #8ab4f8;
    --google-blue-text: #001d35;
    --google-text: #e3e3e3;
    --google-text-sub: #bdc1c6;
}

/* --- RESET DE CAJA PARA EVITAR DESBORDES --- */
* { box-sizing: border-box; }

/* =========================================================
   1. AVATAR Y MENÚ DESPLEGABLE (TOP BAR)
========================================================= */
.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--google-blue);
    color: var(--google-blue-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Google Sans', sans-serif;
    transition: box-shadow 0.2s;
    border: none;
}

.user-avatar:hover { 
    box-shadow: 0 0 0 4px rgba(138, 180, 248, 0.2); 
}

#user-dropdown-menu {
    position: absolute;
    top: 60px;
    right: 16px;
    background: var(--google-surface);
    border: 1px solid var(--google-border);
    border-radius: 24px;
    padding: 12px;
    width: 300px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 10001;
    font-family: 'Google Sans', sans-serif;
    color: var(--google-text);
    animation: googlePopup 0.2s cubic-bezier(0, 0, 0.2, 1);
}

.menu-header-pro {
    padding: 12px 16px 20px 16px;
    text-align: center;
    border-bottom: 1px solid var(--google-border);
    margin-bottom: 8px;
}

.menu-user-name { font-weight: 500; color: #fff; font-size: 1rem; }
.menu-user-email { font-size: 0.85rem; color: var(--google-text-sub); margin-bottom: 8px; }

.menu-plan-badge { 
    display: inline-block;
    font-size: 0.65rem; 
    color: #c4eed0; 
    font-weight: bold; 
    text-transform: uppercase; 
    padding: 4px 12px;
    background: rgba(196, 238, 208, 0.1);
    border-radius: 100px;
    border: 1px solid rgba(196, 238, 208, 0.2);
}

/* Items del menú */
.dropdown-item-pro {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    border-radius: 100px;
    transition: background 0.2s;
    position: relative;
    color: var(--google-text);
}

.dropdown-item-pro:hover { background: var(--google-surface-hover); }

/* Indicador de submenú (Flechita) */
.dropdown-item-pro.has-flyout::after {
    content: '〉';
    position: absolute;
    right: 16px;
    font-size: 0.7rem;
    opacity: 0.5;
}

/* --- 🛠️ CIRUGÍA: SUB-MENÚ DE TEMAS (FLYOUT) --- */
.flyout-menu {
    position: absolute;
    right: 102%; /* Posicionado a la izquierda del menú principal */
    top: -10px;
    background: var(--google-surface);
    border: 1px solid var(--google-border);
    border-radius: 20px;
    width: 190px;
    display: none; 
    padding: 8px;
    box-shadow: -8px 8px 20px rgba(0,0,0,0.4);
    z-index: 10002;
}

/* PUENTE INVISIBLE: Evita que el menú se cierre al mover el mouse */
.flyout-menu::before {
    content: '';
    position: absolute;
    right: -20px; 
    top: 0;
    width: 25px;
    height: 100%;
}

.dropdown-item-pro:hover .flyout-menu {
    display: block; 
}

.flyout-item {
    padding: 10px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--google-text-sub);
    border-radius: 100px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flyout-item:hover {
    background: var(--google-surface-hover);
    color: var(--google-blue);
}

.flyout-item.active {
    color: var(--google-blue);
    font-weight: 500;
    background: rgba(138, 180, 248, 0.1);
}

.menu-divider { border-top: 1px solid var(--google-border); margin: 8px 0; }

/* =========================================================
   2. PANEL DE CONTROL (EL DASHBOARD)
========================================================= */
.super-dashboard {
    background: var(--google-bg);
    color: var(--google-text);
    font-family: 'Google Sans', sans-serif;
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.section-title { font-size: 2.2rem; font-weight: 400; margin-bottom: 30px; letter-spacing: -0.5px; }

.dash-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.03);
    padding: 6px;
    border-radius: 100px;
    width: fit-content;
}

.dash-tab-btn {
    background: transparent;
    border: none;
    color: var(--google-text-sub);
    padding: 10px 24px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.dash-tab-btn:hover { background: rgba(255,255,255,0.05); }
.dash-tab-btn.active {
    background: var(--google-blue);
    color: var(--google-blue-text);
    font-weight: 500;
}

.dash-body {
    background: var(--google-surface);
    border: 1px solid var(--google-border);
    border-radius: 28px;
    padding: 30px;
    min-height: 400px;
}

.dash-panel h2 { font-size: 1.4rem; font-weight: 400; margin-bottom: 20px; color: #fff; }

.form-group {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

label { font-size: 0.9rem; color: var(--google-text-sub); margin-left: 4px; }

.pro-input, .pro-select {
    background: var(--google-surface-hover);
    border: 1px solid var(--google-border);
    border-radius: 14px;
    color: white;
    padding: 14px 18px;
    font-size: 1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pro-input:focus, .pro-select:focus {
    border-color: var(--google-blue);
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.1);
}

textarea.pro-input {
    min-height: 180px;
    resize: vertical;
    line-height: 1.6;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
}

.dash-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--google-border);
}

.btn-primary {
    background: var(--google-blue);
    color: var(--google-blue-text);
    border: none;
    padding: 12px 32px;
    border-radius: 100px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--google-border);
    color: var(--google-blue);
    padding: 12px 32px;
    border-radius: 100px;
    cursor: pointer;
}

.btn-primary:hover, .btn-secondary:hover { opacity: 0.85; }

/* =========================================================
   3. NOTIFICACIONES (TOASTS)
========================================================= */
#sonodit-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #323336;
    color: #fff;
    padding: 14px 28px;
    border-radius: 100px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    z-index: 10005;
    font-family: 'Google Sans', sans-serif;
    font-size: 0.95rem;
    display: none;
    animation: toastUp 0.3s cubic-bezier(0, 0, 0.2, 1);
    border: 1px solid var(--google-border);
}

@keyframes toastUp {
    from { bottom: -60px; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

@keyframes googlePopup {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}