:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --info: #0891b2;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --radius: 16px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --card: #1e293b;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Container for JS-injected Header */
#app-header {
    min-height: 77px; /* Prevents layout shift (CLS) when header is injected */
    background: var(--card);
}

/* Header & Nav */
.main-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 60px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}

.logo span { color: var(--text); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.2rem; /* Reducido de 1.5rem para ganar espacio */
    margin: 0 1rem;
    padding: 0;
    flex: 1;
    justify-content: flex-end;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem; /* Ligeramente más pequeño para mayor compatibilidad */
    transition: color 0.2s;
    white-space: nowrap;
}


.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* Common Components */
.btn-theme {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.btn-theme:hover { background: var(--bg); }

.ad-placeholder {
    display: none; /* Oculto hasta aprobación */
    background: var(--card);
    border: 2px dashed var(--border);
    border-radius: 12px;
    min-height: 90px;
    margin: 1.5rem 0;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 0.8rem 1.6rem;
    border-radius: 50px;
    z-index: 2000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 500;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
}
