/* ============================================================
   Desayuno Royale — Theme
   Paleta cálida de desayuno: crema, café, naranja tostado.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700;9..144,900&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Backgrounds */
    --bg: #faf6f0;
    --bg-2: #f4ede1;
    --surface: #ffffff;
    --surface-2: #fbf6ed;
    --surface-3: #f7eedb;

    /* Text */
    --text: #2a1f17;
    --text-2: #6b5e54;
    --text-3: #9a8c7e;

    /* Borders */
    --border: #ebe1cc;
    --border-strong: #d8c8a8;

    /* Accents */
    --accent: #c47a1c;        /* tostada */
    --accent-strong: #a8650f;
    --accent-soft: #fde8c8;
    --accent-2: #a8527a;      /* mermelada de fresa */
    --accent-3: #5b8c66;      /* aguacate */

    /* Semantic */
    --success: #5b8c66;
    --success-soft: #def0e0;
    --danger: #c44d3c;
    --danger-soft: #fbdfd9;
    --warning: #d99a3c;
    --warning-soft: #fbecd0;
    --info: #5879a8;
    --info-soft: #dfe8f7;

    /* Shadows (warm) */
    --shadow-sm: 0 1px 2px rgba(80, 50, 20, 0.06);
    --shadow: 0 2px 8px rgba(80, 50, 20, 0.08);
    --shadow-lg: 0 8px 24px rgba(80, 50, 20, 0.12);

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0 0 0.5em 0;
}
h1 { font-size: 2rem; font-weight: 900; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 0.8em 0; }

/* ─── Layout ─────────────────────────────── */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 28px 64px;
}

/* ─── Navbar ─────────────────────────────── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.92);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 1.15rem;
    color: var(--text);
    margin-right: 24px;
}
.brand-icon {
    font-size: 1.4rem;
}
.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}
.nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}
.nav-link:hover {
    background: var(--surface-3);
    color: var(--text);
}
.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 600;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.15s ease;
}
.nav-user:hover { border-color: var(--border-strong); background: var(--surface-2); }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.avatar.lg { width: 40px; height: 40px; font-size: 1rem; }
.avatar.sm { width: 22px; height: 22px; font-size: 0.7rem; }

/* ─── Cards ──────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.card-flat {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

/* ─── Buttons ─────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(0.95); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(0.95); }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }

/* ─── Forms ───────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}
.input, .textarea, .select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .textarea:focus, .select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Inter', monospace;
}

/* ─── Badges ──────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--surface-3);
    color: var(--text-2);
}
.badge-idea       { background: var(--info-soft);    color: var(--info); }
.badge-guionizando{ background: var(--warning-soft); color: var(--warning); }
.badge-listo      { background: var(--success-soft); color: var(--success); }
.badge-grabado    { background: var(--accent-soft);  color: var(--accent-strong); }
.badge-pending    { background: var(--surface-3);    color: var(--text-2); }
.badge-liked      { background: var(--success-soft); color: var(--success); }
.badge-rejected   { background: var(--danger-soft);  color: var(--danger); }
.badge-promoted   { background: var(--accent-soft);  color: var(--accent-strong); }

/* ─── Utility ─────────────────────────────── */
.row { display: flex; gap: 14px; align-items: center; }
.row-wrap { display: flex; gap: 14px; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--text-2); }
.tiny { font-size: 0.82rem; }
.center { text-align: center; }
.hidden { display: none !important; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

/* ─── Toast ───────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 999;
}
.toast {
    background: var(--text);
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    animation: slideUp 0.2s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes slideUp {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ─── Modal ───────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(40, 25, 10, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    overflow-y: auto;
}
.modal h2 { margin-top: 0; }

/* ─── Markdown rendered ───────────────────── */
.md {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text);
}
.md h1, .md h2, .md h3 { margin-top: 1.2em; }
.md h1 { font-size: 1.4rem; }
.md h2 { font-size: 1.2rem; }
.md h3 { font-size: 1.05rem; }
.md p { margin: 0 0 0.9em 0; }
.md ul, .md ol { padding-left: 1.4em; margin: 0 0 0.9em 0; }
.md li { margin-bottom: 0.3em; }
.md code {
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: 5px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.88em;
}
.md pre {
    background: var(--surface-3);
    padding: 14px;
    border-radius: 10px;
    overflow-x: auto;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.88em;
}
.md blockquote {
    border-left: 3px solid var(--accent);
    margin: 0 0 0.9em 0;
    padding: 4px 0 4px 14px;
    color: var(--text-2);
    background: var(--accent-soft);
    border-radius: 0 8px 8px 0;
}
.md a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.md strong { color: var(--text); font-weight: 700; }

/* ─── Empty state ─────────────────────────── */
.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-2);
}
.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}
