/**
 * SkyTraceGPS Website - Estilo Wikipedia
 * Copyright 2010-2025 SkyTrace de Centroamerica SA
 * Licensed under Apache 2.0
 */

:root {
    --primary-bg: #f8f9fa;
    --secondary-bg: #ffffff;
    --tertiary-bg: #e8f4fc;
    --border-color: #a2a9b1;
    --text-primary: #202122;
    --text-secondary: #54595d;
    --link-color: #0645ad;
    --link-hover: #0b0080;
    --link-visited: #0b0080;
    --accent-cyan: #0ea5e9;
    --accent-cyan-dark: #0284c7;
    --accent-red: #dc2626;
    --accent-green: #059669;
    --header-bg: #f6f6f6;
    --sidebar-bg: #f8f9fa;
    --code-bg: #f8f9fa;
    --warning-bg: #fff3cd;
    --info-bg: #d1ecf1;
    --success-bg: #d4edda;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Liberation Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--primary-bg);
}

/* Header Principal */
.site-header {
    background: linear-gradient(135deg, var(--accent-cyan-dark), var(--accent-cyan));
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #fff;
}

.logo-container img {
    height: 50px;
    width: auto;
}

.logo-text h1 {
    font-size: 1.8em;
    font-weight: 600;
    margin: 0;
}

.logo-text span {
    font-size: 0.7em;
    opacity: 0.9;
}

/* Navegación */
.main-nav {
    display: flex;
    gap: 5px;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 14px;
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(255,255,255,0.2);
}

/* Selector de Idioma */
.lang-switcher {
    display: flex;
    gap: 5px;
    margin-left: 20px;
}

.lang-switcher button {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.lang-switcher button:hover,
.lang-switcher button.active {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
}

/* Contenedor Principal */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    padding: 20px;
}

.main-container.full-width {
    grid-template-columns: 1fr;
}

/* Contenido Principal */
.content {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    padding: 25px 30px;
}

/* Títulos estilo Wikipedia */
.page-title {
    font-size: 1.8em;
    font-weight: normal;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

h2 {
    font-size: 1.4em;
    font-weight: normal;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin: 25px 0 15px 0;
    color: var(--text-primary);
}

h3 {
    font-size: 1.15em;
    font-weight: bold;
    margin: 20px 0 10px 0;
    color: var(--text-primary);
}

h4 {
    font-size: 1em;
    font-weight: bold;
    margin: 15px 0 8px 0;
}

/* Enlaces */
a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:visited {
    color: var(--link-visited);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-box {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
}

.sidebar-box h3 {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 15px;
    margin: 0;
    font-size: 1em;
    font-weight: bold;
}

.sidebar-box .box-content {
    padding: 15px;
}

.sidebar-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-box li {
    padding: 5px 0;
    border-bottom: 1px dotted #ddd;
}

.sidebar-box li:last-child {
    border-bottom: none;
}

/* Infobox estilo Wikipedia */
.infobox {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-collapse: collapse;
    float: right;
    margin: 0 0 15px 20px;
    width: 280px;
    font-size: 13px;
}

.infobox caption {
    background: var(--accent-cyan);
    color: #fff;
    font-weight: bold;
    padding: 10px;
    text-align: center;
    font-size: 1.1em;
}

.infobox img {
    display: block;
    margin: 10px auto;
    max-width: 200px;
}

.infobox th,
.infobox td {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

.infobox th {
    background: var(--header-bg);
    width: 35%;
    font-weight: normal;
    color: var(--text-secondary);
}

/* Tabla de Contenidos */
.toc {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin: 15px 0;
    display: inline-block;
    min-width: 200px;
}

.toc-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.toc ol {
    margin: 0;
    padding-left: 25px;
}

.toc li {
    margin: 5px 0;
}

/* Código */
code, pre {
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 2px;
}

code {
    padding: 2px 5px;
    font-size: 0.9em;
}

pre {
    padding: 15px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.4;
}

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

/* Alertas */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid;
}

.alert-info {
    background: var(--info-bg);
    border-color: #0c5460;
    color: #0c5460;
}

.alert-warning {
    background: var(--warning-bg);
    border-color: #856404;
    color: #856404;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--accent-green);
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--accent-red);
    color: #721c24;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 14px;
}

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

.btn-primary:hover {
    background: var(--accent-cyan-dark);
    text-decoration: none;
    color: #fff;
}

.btn-success {
    background: var(--accent-green);
    color: #fff;
}

.btn-success:hover {
    background: #047857;
    text-decoration: none;
    color: #fff;
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    text-decoration: none;
    color: #fff;
}

.btn-donate {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-donate:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    text-decoration: none;
    color: #000;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

/* Formularios */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-group .required {
    color: var(--accent-red);
}

/* Download Box */
.download-box {
    background: linear-gradient(135deg, var(--tertiary-bg), #ffffff);
    border: 2px solid var(--accent-cyan);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    margin: 20px 0;
}

.download-box h3 {
    color: var(--accent-cyan-dark);
    margin-top: 0;
    border: none;
}

.download-version {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.feature-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.feature-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-card h4 {
    color: var(--accent-cyan-dark);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-icon {
    font-size: 1.5em;
}

/* Changelog */
.changelog-entry {
    border-left: 3px solid var(--accent-cyan);
    padding-left: 20px;
    margin: 20px 0;
}

.changelog-version {
    font-weight: bold;
    color: var(--accent-cyan-dark);
    font-size: 1.1em;
}

.changelog-date {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.changelog-list {
    margin-top: 10px;
}

.changelog-list li {
    margin: 5px 0;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    margin-right: 5px;
}

.tag-new { background: var(--accent-green); color: #fff; }
.tag-fix { background: var(--accent-cyan); color: #fff; }
.tag-update { background: #6366f1; color: #fff; }
.tag-remove { background: var(--accent-red); color: #fff; }

/* FAQ Accordion */
.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
}

.faq-question {
    background: var(--header-bg);
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

.faq-question:hover {
    background: #ebebeb;
}

.faq-answer {
    padding: 20px;
    display: none;
    border-top: 1px solid var(--border-color);
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-toggle {
    transition: transform 0.2s;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

/* Version History */
.version-history-section {
    margin-top: 30px;
}

.version-history-section h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.version-history-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
}

.version-item:last-child {
    border-bottom: none;
}

.version-item:hover {
    background: var(--header-bg);
}

.version-item.current {
    background: #e8f4fc;
}

.version-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-number {
    font-weight: 600;
    color: var(--primary-color);
}

.version-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.version-badge {
    background: var(--accent-green);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.version-actions .btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

/* Footer */
.site-footer {
    background: var(--header-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    margin: 0 15px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex;
}

.modal,
.modal-content {
    background: #ffffff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-content {
    padding: 25px;
}

.modal-content h2 {
    color: var(--accent-cyan-dark);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--accent-cyan);
    padding-bottom: 10px;
}

.modal-content > p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.modal-content .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-cyan);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
}

.modal-header {
    background: var(--accent-cyan);
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    border: none;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Responsive */
@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .infobox {
        float: none;
        margin: 0 auto 20px auto;
    }
    
    .header-inner {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .content {
        padding: 15px;
    }
    
    .page-title {
        font-size: 1.4em;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .logo-text h1 {
        font-size: 1.3em;
    }
}

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.hidden { display: none !important; }

/* Print */
@media print {
    .site-header,
    .sidebar,
    .site-footer,
    .download-box {
        display: none;
    }
    
    .main-container {
        display: block;
    }
}

/* =============================================
   Downloads List Styles
   ============================================= */
.downloads-section {
    margin: 40px 0;
}

.downloads-section h2 {
    margin-bottom: 10px;
}

.downloads-section > p {
    color: #54595d;
    margin-bottom: 25px;
}

.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.download-item:hover {
    background: #fff;
    border-color: #0ea5e9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.download-item.current {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0ea5e9;
    border-width: 2px;
}

.download-item-info {
    flex: 1;
}

.download-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.download-item-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #202122;
}

.version-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.version-badge.current {
    background: #0ea5e9;
    color: white;
}

.download-item-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #54595d;
    margin-bottom: 6px;
}

.download-item-meta .version {
    font-weight: 500;
    color: #202122;
}

.download-item-desc {
    margin: 0;
    font-size: 0.9em;
    color: #72777d;
}

.download-item-action {
    margin-left: 20px;
}

.download-item-action .btn {
    white-space: nowrap;
}

/* Source Code Section */
.source-section {
    margin: 40px 0;
}

.source-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.source-card .icon {
    font-size: 2.5em;
}

.source-info {
    flex: 1;
}

.source-info h3 {
    margin: 0 0 5px 0;
}

.source-info p {
    margin: 0;
    color: #54595d;
}

/* Support & Donate Section */
.support-donate-section {
    margin: 40px 0;
}

.support-donate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .download-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .download-item-action {
        margin-left: 0;
        width: 100%;
    }
    
    .download-item-action .btn {
        width: 100%;
    }
    
    .source-card {
        flex-direction: column;
        text-align: center;
    }
    
    .support-donate-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Sidebar Version Styles
   ============================================= */
.sidebar-version {
    margin-bottom: 8px;
}

.sidebar-version p {
    margin: 0 0 5px 0;
}

.sidebar-version .version-date {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.badge-latest {
    display: inline-block;
    background: #0ea5e9;
    color: white;
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
    text-transform: uppercase;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9em;
}

.btn-static {
    cursor: default;
    opacity: 0.9;
}

.btn-static:hover {
    transform: none;
    box-shadow: none;
}

/* =============================================
   Changelog Notice
   ============================================= */
.changelog-notice {
    background: #f8f9fa;
    border-left: 4px solid #0ea5e9;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.changelog-notice p {
    margin: 5px 0;
    color: #555;
}

.changelog-notice p:first-child {
    font-weight: 500;
}
