/* ==========================================================================
   VARIABLES DE TEMA (Modo Oscuro por defecto / Modo Claro vía data-theme)
   ========================================================================== */
:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --border-color: #30363d;
    --text-color: #c9d1d9;
    --text-heading: #f0f6fc;
    --accent-blue: #2f81f7;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --card-bg: #f6f8fa;
    --border-color: #d0d7de;
    --text-color: #57606a;
    --text-heading: #24292f;
    --accent-blue: #0969da;
    --shadow-color: rgba(140, 149, 159, 0.2);
}

/* ==========================================================================
   ESTILOS DE LA VISTA DE DETALLE DE PROYECTOS
   ========================================================================== */

/* Contenedor principal */
.project-detail-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 7rem 5% 4rem;
    transition: var(--transition);
}

.project-header {
    margin-bottom: 2rem;
}

.project-title {
    font-size: 2.5rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.project-subtitle {
    font-size: 1.1rem;
    color: var(--accent-blue);
    transition: color 0.3s ease;
}

/* --- Galería con Tamaño Fijo --- */
.gallery-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: var(--transition);
}

/* Marco principal rígido */
.main-display {
    width: 100%;
    height: 480px; /* Alto fijo para evitar saltos de layout */
    background-color: #000; /* Mantiene marco negro tipo cine para resaltar capturas */
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.main-display img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mantiene la proporción de la imagen sin deformar */
    transition: opacity 0.2s ease;
}

/* Indicador visual de que la imagen se puede ampliar */
.zoomable-img {
    cursor: zoom-in;
}

/* Botones flotantes sobre la imagen principal */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.nav-btn:hover {
    background: var(--accent-blue);
    border-color: transparent;
}

.prev-btn {
    left: 12px;
}

.next-btn {
    right: 12px;
}

/* Barra de selección de miniaturas */
.thumbnail-bar {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
    padding: 8px 0;
    overflow-x: auto; /* Scroll horizontal si hay muchas imágenes */
}

.thumbnail-bar::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-bar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.thumb {
    width: 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumb:hover, .thumb.active {
    opacity: 1;
    border-color: var(--accent-blue);
    transform: scale(1.03);
}

/* --- Modal Lightbox (Pantalla Completa) --- */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
}

.image-modal.show {
    display: flex;
    animation: fadeIn 0.25s ease-in-out;
}

/* Imagen dentro del modal */
.modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

/* Botón de cerrar (X) */
.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1011;
}

.close-modal:hover {
    color: var(--accent-blue);
}

/* Botones flotantes dentro del Modal Lightbox */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1010;
    transition: background 0.2s;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-prev-btn {
    left: 20px;
}

.modal-next-btn {
    right: 20px;
}

/* --- Secciones de Contenido --- */
.detail-block {
    margin-bottom: 2.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.8rem;
    box-shadow: 0 4px 12px var(--shadow-color);
    transition: var(--transition);
}

.detail-block h2 {
    font-size: 1.3rem;
    color: var(--text-heading);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s ease;
}

.detail-block h2 i {
    color: var(--accent-blue);
    transition: color 0.3s ease;
}

/* Badges / Tags */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-badge {
    background-color: rgba(47, 129, 247, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(47, 129, 247, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

/* Descripción */
.project-description p {
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.7;
    transition: color 0.3s ease;
}

.project-description p:last-child {
    margin-bottom: 0;
}

/* Grid de Videos */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.video-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-heading);
    transition: color 0.3s ease;
}

.video-wrapper {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
}

.footer-credits {
    text-align: center;
    margin-top: 10px;
}

.credit-link {
    color: var(--accent-blue);
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.credit-icon {
    font-size: 0.75rem;
    opacity: 0.8;
}

.credit-link:hover {
    color: #ff3366;
}

.credit-link:hover .credit-icon {
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .project-detail-container {
        padding: 5rem 4% 3rem;
    }

    .main-display {
        height: auto;
        aspect-ratio: 16 / 9;
        max-height: 240px;
    }

    .thumb {
        width: 75px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .main-display {
        aspect-ratio: 16 / 9;
        max-height: 200px;
    }

    .nav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .prev-btn {
        left: 6px;
    }
    
    .next-btn {
        right: 6px;
    }

    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .modal-prev-btn {
        left: 8px;
    }

    .modal-next-btn {
        right: 8px;
    }
}

/* ==========================================================================
   AJUSTES RESPONSIVE DE LA BARRA DE NAVEGACIÓN (NAVBAR)
   ========================================================================== */

/* Ajustes para móviles y pantallas reducidas (≤ 576px) */
@media (max-width: 576px) {
    .navbar {
        padding: 0.8rem 3% !important;
        gap: 8px;
    }

    /* Reducir espacio entre los elementos de la derecha */
    .header-actions {
        gap: 8px !important;
    }

    /* Ocultar el texto del botón "Volver a Proyectos" y dejar solo el icono */
    .nav-controls .btn-outline span[data-i18n="nav.back_to_projects"] {
        display: none;
    }

    /* Hacer el botón de volver más compacto / tipo icono */
    .nav-controls .btn-outline {
        padding: 6px 10px !important;
        font-size: 0.85rem;
    }

    /* Hacer el botón de idioma más compacto */
    .lang-btn {
        padding: 5px 10px !important;
        font-size: 0.78rem !important;
    }

    /* Reducir ligeramente el switch de tema si es necesario */
    .theme-switch-wrapper {
        transform: scale(0.85);
        transform-origin: center right;
    }
}

/* Para pantallas extremas muy pequeñas (≤ 380px) */
@media (max-width: 380px) {
    .logo span {
        font-size: 1.1rem;
    }

    /* Ocultar el texto del idioma en pantallas ultra estrechas, manteniendo el icono */
    #lang-label {
        display: none;
    }

    .lang-btn {
        padding: 6px 8px !important;
    }
}

/* ==========================================================================
   CLASES EXTRAÍDAS DE ESTILOS INLINE
   ========================================================================== */

/* Enlace del Logo en la Navbar */
.logo-link {
    text-decoration: none;
    color: inherit;
}

/* Contenedor de Controles de Navegación */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Contenedor de Acciones del Header */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Lista de Características de Proyectos */
.feature-list {
    list-style: none;
    padding-left: 0;
    line-height: 1.8;
}

/* Icono de Check en Listas */
.check-icon {
    color: var(--accent-blue, #2f81f7);
    margin-right: 8px;
}