/* =====================================================
   HAGORAGI / AGI Deployments - Sistema de Estilos
   Template unificado para todas las páginas
   ===================================================== */

/* === Variables de Tema Claro === */
:root, [data-theme="light"] {
    --bg-primary: #f0f4ff;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.95);

    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #7a7a9a;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);

    --border-color: #e0e7ff;
    --shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    --shadow-strong: 0 8px 30px rgba(99, 102, 241, 0.2);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
}

/* === Variables de Tema Oscuro === */
[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #1e1e35;
    --bg-nav: rgba(26, 26, 46, 0.95);

    --text-primary: #f0f0ff;
    --text-secondary: #b0b0d0;
    --text-muted: #7070a0;

    --accent-primary: #818cf8;
    --accent-secondary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #c084fc 100%);

    --border-color: #2a2a4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 8px 30px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-secondary);
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Navegación Principal === */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 0 20px;
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.nav-brand-icon {
    font-size: 1.5rem;
}

.nav-brand span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-strong);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.nav-dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
}

.nav-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

/* Toggle de tema */
.theme-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-card);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Mobile menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.2s ease;
}

@media (max-width: 900px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--bg-primary);
        margin-top: 8px;
    }
}

/* === Breadcrumb === */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 64px;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

/* === Header de Página === */
.page-header {
    text-align: center;
    padding: 40px 0 60px;
}

.page-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.page-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* === Cards === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-strong);
    border-color: var(--accent-primary);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    color: var(--accent-primary);
    font-weight: 500;
}

/* === Secciones === */
.section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-description {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* === Changelog === */
.changelog {
    max-width: 800px;
    margin: 0 auto;
}

.changelog-entry {
    position: relative;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.changelog-entry:hover {
    box-shadow: var(--shadow);
    border-color: var(--accent-primary);
}

.changelog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.changelog-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.changelog-version {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.changelog-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.changelog-content ul {
    list-style: none;
    padding: 0;
}

.changelog-content li {
    position: relative;
    padding: 8px 0 8px 24px;
    color: var(--text-secondary);
}

.changelog-content li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

/* Tags de changelog */
.tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 8px;
    text-transform: uppercase;
}

.tag-feature { background: #dcfce7; color: #166534; }
.tag-fix { background: #fef3c7; color: #92400e; }
.tag-breaking { background: #fee2e2; color: #991b1b; }
.tag-improvement { background: #dbeafe; color: #1e40af; }
.tag-security { background: #fae8ff; color: #86198f; }

[data-theme="dark"] .tag-feature { background: #166534; color: #dcfce7; }
[data-theme="dark"] .tag-fix { background: #92400e; color: #fef3c7; }
[data-theme="dark"] .tag-breaking { background: #991b1b; color: #fee2e2; }
[data-theme="dark"] .tag-improvement { background: #1e40af; color: #dbeafe; }
[data-theme="dark"] .tag-security { background: #86198f; color: #fae8ff; }

/* === Tabs === */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.tab {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.05);
}

.tab.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 2px solid var(--accent-primary);
    margin-bottom: -2px;
}

/* === Footer === */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.footer-column h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: span 2;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* === Botones === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* === Hero Section === */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    margin-top: 64px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Stats === */
.stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    padding: 40px 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* === Utilidades === */
.text-center { text-align: center; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 40px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

/* === Code === */
code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

pre {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

pre code {
    background: none;
    padding: 0;
    border: none;
}

/* === Parallel Changelogs (Side by Side) === */
.changelogs-parallel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 40px 0;
}

.changelog-column {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
}

.changelog-column-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.changelog-column-icon {
    font-size: 2rem;
}

.changelog-column-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.changelog-column-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.changelog-column .changelog-entry {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-primary);
}

.changelog-column .changelog-entry:last-child {
    margin-bottom: 0;
}

.changelog-column .changelog-title {
    font-size: 1rem;
}

.changelog-column .changelog-content li {
    font-size: 0.875rem;
    padding: 4px 0 4px 20px;
}

.changelog-compact .changelog-entry {
    padding: 12px;
    margin-bottom: 12px;
}

.changelog-compact .changelog-header {
    margin-bottom: 8px;
}

.changelog-compact .changelog-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.changelog-compact .changelog-content ul {
    max-height: 150px;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .changelogs-parallel {
        grid-template-columns: 1fr;
    }
}

/* === 3-Column Changelogs === */
.changelogs-triple {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    margin: 40px 0;
}

.changelogs-triple .changelog-column {
    padding: 20px;
}

.changelogs-triple .changelog-column-title {
    font-size: 1.1rem;
}

.changelogs-triple .changelog-entry {
    padding: 10px;
    margin-bottom: 10px;
}

.changelogs-triple .changelog-title {
    font-size: 0.9rem;
}

.changelogs-triple .changelog-content li {
    font-size: 0.8rem;
    padding: 2px 0 2px 16px;
}

@media (max-width: 1200px) {
    .changelogs-triple {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 800px) {
    .changelogs-triple {
        grid-template-columns: 1fr;
    }
}

/* === View Options === */
.view-options {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.view-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.view-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.view-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* === Tabs Enhancement === */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}
