/* ==========================================================================
   TALLER LINUX - HOJA DE ESTILOS PRINCIPAL
   ========================================================================== 
   
   ÍNDICE DE CONTENIDOS:
   1. Variables y Configuración Base
   2. Utilidades Generales
   3. Estructura Principal (Layout, Main, Headers)
   4. Navegación (Navbar y Menú Móvil)
   5. Secciones y Títulos (Section Headers)
   6. Tarjetas (Cards y Grid)
   7. Hubs de Recursos
   8. Página de Detalles (Layout, Sidebar, Reseñas)
   9. Componentes de Detalle (Carousel y Meta-Grid)
   10. Páginas Legales
   11. Footer
   12. Media Queries (Diseño Responsivo)
   ========================================================================== */

/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
    /* Paleta Oscura Moderna */
    --bg-body: #0a0a0a;
    --bg-surface: #171717;
    --bg-surface-light: #262626;
    
    --text-main: #f5f5f5;
    --text-muted: #a3a3a3;
    
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-orange: #f97316;
    --accent-orange-hover: #ea580c;
    --accent-pink: #ef3df8;
    --accent-pink-hover: #921292;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-red: #f52e0f;
    --accent-red-hover: #801809;

    --border-color: #333333;
    --border-radius: 12px;
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.6);
    
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}

/* =========================================
   2. UTILIDADES GENERALES
   ========================================= */
.accent-blue { color: var(--accent-blue); }
.accent-orange { color: var(--accent-orange); }

.rounded-box {
    border-radius: var(--border-radius);
}

.shadow-box {
    box-shadow: var(--shadow-soft);
}

/* =========================================
   3. ESTRUCTURA PRINCIPAL (Layout)
   ========================================= */
.main-header {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    max-width: 1200px;
    margin: 2rem auto;
    padding: 3rem 2rem;
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-orange));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-content p {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
}

.main-content {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    padding: 2rem;
}

/* =========================================
   4. NAVEGACIÓN (Navbar)
   ========================================= */
.navbar {
    background-color: rgba(23, 23, 23, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.3)); 
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-main-text {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.logo-sub-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-btn {
    text-decoration: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.nav-btn:hover {
    color: var(--text-main);
    background-color: var(--bg-surface-light);
}

.nav-btn.btn-outline {
    border: 1px solid var(--border-color);
}

.nav-btn.btn-orange {
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
}

.nav-btn.btn-orange:hover {
    background-color: var(--accent-orange);
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: none;
}

.menu-overlay.active {
    display: block;
}

/* =========================================
   5. SECCIONES Y TÍTULOS (Headers)
   ========================================= */
.category-section {
    margin-bottom: 4rem;
}

.section-header-so,
.section-header-frontends,
.section-header-standalone,
.section-header-libretro,
.section-header-recursos {
    background-color: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

/* Colores de bordes según categoría */
.section-header-so { border-left: 4px solid var(--accent-blue); }
.section-header-frontends { border-left: 4px solid var(--accent-red); }
.section-header-standalone { border-left: 4px solid var(--accent-pink); }
.section-header-libretro { border-left: 4px solid var(--accent-green); }
.section-header-recursos { border-left: 4px solid var(--accent-orange); }

.section-header.border-orange { border-left-color: var(--accent-orange); }

.section-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =========================================
   6. TARJETAS (Cards y Grid)
   ========================================= */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.5rem;
    width: 100%;
}

.card {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-blue);
}

.logo-container-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img-card {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.3)); 
}

.card-icon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.tags {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.tag-blue { background-color: rgba(59, 130, 246, 0.1); color: var(--accent-blue); }
.tag-orange { background-color: rgba(249, 115, 22, 0.1); color: var(--accent-orange); }
.tag-grey { background-color: rgba(163, 163, 163, 0.1); color: var(--text-muted); }

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1.0rem;
    margin-bottom: 1.0rem;
    flex-grow: 1;
}

.btn-more {
    display: inline-block;
    text-align: center;
    padding: 10px;
    background-color: var(--bg-surface-light);
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.card:hover .btn-more {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

/* =========================================
   7. HUBS DE RECURSOS
   ========================================= */
.hubs-container {
    display: flex;
    gap: 2rem;
}

.hub-card {
    flex: 1;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    transition: var(--transition);
}

.hub-card:hover {
    border-color: var(--accent-orange);
    box-shadow: var(--shadow-hover);
}

.hub-icon {
    font-size: 2.5rem;
    color: var(--accent-orange);
    background-color: rgba(249, 115, 22, 0.1);
    padding: 1rem;
    border-radius: 12px;
}

.hub-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.hub-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.btn-more.btn-orange {
    background-color: transparent;
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.btn-more.btn-orange:hover {
    background-color: var(--accent-orange);
    color: #fff;
}

/* =========================================
   8. PÁGINA DE DETALLES
   ========================================= */
.detail-layout {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    min-height: 500px;
}

.detail-info {
    flex: 2;
    padding-right: 1rem;
}

.header-detail {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 2.5rem;
}

.logo-large {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4));
}

#det-nombre {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.resena-box {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.resena-box h3 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
    font-size: 1rem;
    text-transform: uppercase;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.spec-item {
    background-color: var(--bg-surface-light);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    border-top: 2px solid var(--accent-blue);
}

.spec-item strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Panel Lateral (Sidebar de Descarga) */
.detail-sidebar {
    flex: 1;
    background: linear-gradient(145deg, var(--bg-surface-light) 0%, #1a1a1a 100%);
    border: 1px solid var(--accent-orange);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: sticky;
    top: 100px;
    height: fit-content;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.1);
}

.detail-sidebar h3 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.detail-sidebar p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.btn-download-main {
    width: 100%;
    padding: 1.2rem;
    background-color: var(--accent-orange);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-download-main:hover {
    background-color: var(--accent-orange-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5);
}

.verify-tag {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

/* =========================================
   9. COMPONENTES DE DETALLE (Carousel & Meta)
   ========================================= */
.detail-header {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-titles h1 {
    font-size: 2.2rem;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-orange));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.header-switcher {
    background-color: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-width: 320px;
    max-width: 400px;
}

.switcher-title {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
}

.carousel-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carousel-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

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

.carousel-track {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0.5rem 0;
    scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    transition: var(--transition);
    opacity: 0.6;
}

.carousel-item:hover {
    opacity: 1;
    transform: scale(1.1);
}

.carousel-item img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.2));
}

.carousel-item span {
    font-size: 0.7rem;
    color: var(--text-main);
    white-space: nowrap;
}

.title-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.meta-item {
    background-color: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.meta-item:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.meta-item i {
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
}

.meta-item span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.meta-item strong {
    font-size: 0.95rem;
    color: var(--text-main);
}

/* =========================================
   10. PÁGINAS LEGALES
   ========================================= */
.legal-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    padding: 1rem;
}

.legal-section {
    margin-bottom: 2.5rem;
}

.legal-section h2 {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.legal-section p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.legal-list {
    list-style: none;
    padding-left: 1.5rem;
}

.legal-list li {
    color: var(--text-muted);
    position: relative;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.legal-list li::before {
    content: "•";
    color: var(--accent-blue);
    font-weight: bold;
    position: absolute;
    left: -1.2rem;
}

.legal-list strong {
    color: var(--accent-orange);
}

/* =========================================
   11. FOOTER (Modificado con Flexbox)
   ========================================= */
.footer-emuladores {
    background-color: rgba(23, 23, 23, 0.95);
    color: var(--text-muted);
    padding: 4rem 1.5rem 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Layout en línea para Escritorio */
.footer-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap; /* Permite que fluya si la pantalla se achica un poco */
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Sección de Marca (Gracias) */
.footer-brand {
    flex: 1 1 250px;
}

.footer-brand .brand-header {
    display: flex;
    align-items: left;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-brand img {
    width: 50px;
    height: 50px;
}

.brand-name {
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 700;
    font-style: italic;
}

.brand-thanks {
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 350px;
}

/* Grid de Enlaces (Emulación, Proyecto, Contacto) en la misma línea */
.footer-links-grid {
    flex: 2 1 500px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap; /* Seguridad para pantallas intermedias */
}

.footer-column {
    min-width: 120px;
}

.footer-column h4 {
    color: #ffffff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
}

.footer-column nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-column a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--accent-blue-hover);
}

.footer-column a i {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.footer-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.footer-legal {
    text-align: left;
}

.footer-legal p {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.trademark {
    font-size: 0.7rem !important;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =========================================
   12. MEDIA QUERIES (Móviles / Tablets)
   ========================================= */
@media (max-width: 768px) {
    /* Utilidades Legales y Contenedores */
    .legal-container {
        padding: 0;
    }
    .legal-section h2 {
        font-size: 1.2rem;
    }

    /* Layout Detalle */
    .detail-layout {
        flex-direction: column;
    }
    .detail-sidebar {
        position: static;
        order: -1;
    }
    .specs-grid {
        grid-template-columns: 1fr;
    }

    /* Navbar y Logos */
    .logo-img {
        width: 35px;
        height: 35px;
    }
    .logo-main-text {
        font-size: 1rem;
    }
    .logo-sub-text {
        font-size: 0.7rem;
    }
    
    /* Menú Móvil */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--bg-surface);
        flex-direction: column;
        padding: 5rem 2rem;
        gap: 1rem;
        z-index: 101;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--border-color);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }
    .nav-links.active {
        right: 0;
    }
    .nav-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 1rem;
    }
    .mobile-menu-btn {
        display: block;
        z-index: 102;
        position: relative;
    }

    /* Contenido Principal */
    .main-header {
        margin: 1rem;
        padding: 1.5rem;
    }
    .main-content {
        padding: 1rem;
        margin: 0.5rem;
        overflow-x: hidden;
    }
    .header-content h1 {
        font-size: 2rem;
    }

    /* Hubs y Carousel */
    .hubs-container {
        flex-direction: column;
    }
    .hub-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .detail-header {
        flex-direction: column;
        text-align: center;
        margin: 1rem auto;
    }
    .header-switcher {
        width: 100%;
        max-width: 100%;
    }

    /* FOOTER (Apilado correcto para móviles) */
    .footer-top {
        flex-direction: column;
        gap: 2.5rem;
    }
    .footer-links-grid {
        flex-direction: column;
        gap: 2rem;
    }
}