/* ============================================================
   styles.css  —  CSS compartido de toda la app Froggie AI
   Todo lo que se repetía en los 15 archivos HTML vive aquí.
   Los estilos específicos de cada página van en su propio
   bloque <style> dentro del HTML que retorna render().
   ============================================================ */

/* ── Variables y temas ─────────────────────────────────────── */
:root {
    --bg-main:    #FFFDF9;
    --bg-accent:  #EBF29B;
    --text-dark:  #3E532B;
    --btn-color:  #5D7038;
    --btn-hover:  #455329;
    --font-serif: 'Georgia', serif;
}

body.theme-dark {
    --bg-main:   #483C25;
    --bg-accent: #372E1C;
    --text-dark: #9ea93f;
    --btn-color: #9ea93f;
    --btn-hover: #7E8732;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body ──────────────────────────────────────────────────── */
body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: var(--font-serif);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
    padding-bottom: 80px; /* espacio para el bottom nav */
}

/* ── Área de contenido principal (inyectada por el router) ─── */
#app {
    display: contents; /* se comporta como si no existiera el wrapper */
    transition: opacity 0.15s;
}

/* ── Header ────────────────────────────────────────────────── */
header {
    background-color: var(--bg-accent);
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(62, 83, 43, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 15px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    text-decoration: none;
    color: var(--text-dark);
    flex-shrink: 0;
}
.brand img { width: 30px; height: auto; }

.search-bar {
    flex-grow: 1;
    max-width: 400px;
    margin: 0 15px;
    position: relative;
    display: flex;
    align-items: center;
}
.search-bar input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border-radius: 20px;
    border: 1px solid rgba(62, 83, 43, 0.25);
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: var(--font-serif);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar input:focus {
    border-color: var(--btn-color);
    box-shadow: 0 0 5px rgba(93, 112, 56, 0.2);
}
.search-bar .search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    fill: var(--text-dark);
    opacity: 0.5;
    pointer-events: none;
}

.header-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }

.btn-logout {
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-dark);
    opacity: 0.75;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-serif);
}
.btn-logout:hover { opacity: 1; }

.menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    display: flex;
    padding: 4px;
}

.icon-svg { width: 24px; height: 24px; fill: currentColor; }

@media (max-width: 580px) {
    .brand span, .btn-logout span { display: none; }
    .search-bar { margin: 0 5px; }
}

/* ── Overlay (fondo oscuro del menú) ────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.2); z-index: 150; display: none; }
.overlay.show { display: block; }

/* ── Menú lateral (sidebar) ─────────────────────────────────── */
.side-menu {
    position: fixed;
    top: 0; right: -320px;
    width: 290px;
    height: 100vh;
    background-color: var(--bg-main);
    border-left: 1px solid rgba(62, 83, 43, 0.18);
    box-shadow: -4px 0 20px rgba(0,0,0,0.08);
    z-index: 200;
    transition: right 0.3s ease;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
}
.side-menu.open { right: 0; }

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(62, 83, 43, 0.25);
    padding-bottom: 14px;
}
.side-menu-header h3 { font-weight: normal; font-size: 1.25rem; }
.btn-close-menu { background: none; border: none; cursor: pointer; color: var(--text-dark); }

.menu-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.45;
    padding: 0 10px;
    margin-top: 4px;
}

.menu-options { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.menu-btn {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1rem;
    font-family: var(--font-serif);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.menu-btn:hover  { background-color: var(--bg-accent); }
.menu-btn.active { background-color: var(--bg-accent); font-weight: bold; }

.appearance-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px;
    background-color: rgba(62, 83, 43, 0.03);
}
.appearance-dropdown.show { max-height: 280px; padding: 10px; margin-bottom: 6px; }

.theme-sub-btn {
    background-color: var(--bg-main);
    color: var(--text-dark);
    border: 1px solid rgba(62, 83, 43, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: 0.88rem;
    text-align: left;
    transition: background-color 0.2s;
}
.theme-sub-btn:hover { background-color: var(--btn-color); color: #fff; }

.custom-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
    padding: 3px 4px;
}
.custom-picker-row input[type="color"] {
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
}

.menu-divider { border: none; border-top: 1px dashed rgba(62, 83, 43, 0.18); margin: 4px 0; }

/* ── Contenido principal ────────────────────────────────────── */
main {
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    flex-grow: 1;
}

/* ── Bottom navigation ──────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background-color: var(--bg-accent);
    border-top: 1px solid rgba(62, 83, 43, 0.18);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 12px;
    z-index: 100;
}

.nav-link-btn {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.6;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-serif);
    transition: opacity 0.2s;
    padding: 0 20px;
}
.nav-link-btn .icon-svg { width: 22px; height: 22px; }
.nav-link-btn.active, .nav-link-btn:hover { opacity: 1; }
.nav-link-btn.active span { font-weight: bold; }

/* ── Create popover (botón +) ───────────────────────────────── */
.create-popover {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background-color: var(--bg-main);
    border: 1px solid rgba(62, 83, 43, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    display: none;
    flex-direction: column;
    padding: 6px;
    z-index: 1000;
    width: 180px;
    opacity: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}
.create-popover.show {
    display: flex;
    transform: translateX(-50%) scale(1);
    opacity: 1;
}
.create-popover button {
    width: 100%;
    background: none;
    border: none;
    padding: 11px 14px;
    text-align: left;
    font-family: var(--font-serif);
    color: var(--text-dark);
    font-size: 0.92rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.create-popover button:hover { background-color: rgba(93, 112, 56, 0.12); }

/* ── Modal de novedades ─────────────────────────────────────── */
.news-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.news-modal-overlay.visible { opacity: 1; }

.news-modal {
    background: var(--bg-main);
    border: 1px solid rgba(62, 83, 43, 0.2);
    border-radius: 18px;
    padding: 28px 24px 24px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(10px);
    transition: transform 0.25s ease;
}
.news-modal-overlay.visible .news-modal { transform: translateY(0); }

.news-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    opacity: 0.5;
    font-size: 1.3rem;
    line-height: 1;
    transition: opacity 0.2s;
    padding: 4px;
}
.news-modal-close:hover { opacity: 1; }
.news-modal-frog { font-size: 2.2rem; text-align: center; margin-bottom: 10px; }
.news-modal h2 { font-size: 1.25rem; font-weight: normal; text-align: center; margin-bottom: 6px; }
.news-modal .news-tagline { font-size: 0.82rem; opacity: 0.45; font-style: italic; text-align: center; margin-bottom: 22px; }

.news-item { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.news-item-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.news-item-text { font-size: 0.88rem; line-height: 1.55; opacity: 0.85; }
.news-item-text strong { display: block; font-size: 0.9rem; margin-bottom: 2px; opacity: 1; }

.news-modal-divider { border: none; border-top: 1px dashed rgba(62, 83, 43, 0.18); margin: 18px 0; }
.news-modal-footer { font-size: 0.85rem; text-align: center; opacity: 0.6; font-style: italic; line-height: 1.5; }
.news-modal-btn {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 11px;
    background-color: var(--btn-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.news-modal-btn:hover { background-color: var(--btn-hover); }

/* ── Landing: ocultar sidebar y overlay temporalmente ───────── */
.landing-hidden { display: none !important; }

/* ── Estado vacío / carga ───────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    opacity: 0.4;
    font-style: italic;
    font-size: 0.9rem;
}

/* ── Páginas de autenticación (registro, reset-password) ────── */
.auth-page {
    background-color: var(--bg-accent);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* Estas páginas no usan el bottom nav */
    padding-bottom: 20px;
}

.auth-card {
    background-color: var(--bg-main);
    border: 1px solid rgba(62, 83, 43, 0.25);
    border-radius: 14px;
    padding: 40px 35px;
    width: 100%;
    max-width: 430px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
    text-align: center;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 18px;
        border: none;
        background-color: transparent;
        box-shadow: none;
    }
}
