/* ========================================
   UMBUSK CSS - Unificado y Organizado
   Versión: 2.0
   Última actualización: Agosto 2025
   ======================================== */

/* ========================================
   1. VARIABLES Y RESET GLOBAL
   ======================================== */
:root {
    --primary-bg: #000000;
    --secondary-bg: #0a0a0f;
    --text-primary: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(200, 200, 255, 0.9);
    --accent: rgba(255, 255, 255, 0.1);
    --accent-green: #4CAF50;
    --accent-blue: #00a8ff;
    
    /* Espaciados consistentes */
    --header-height: 60px;
    --ticker-top-spacing: 20px;
    --content-top-spacing: 91px;
    
    /* Transiciones */
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

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

/* ========================================
   2. ESTILOS BASE Y TIPOGRAFÍA
   ======================================== */
body {
    font-family: 'Helvetica Neue', sans-serif;
    background: radial-gradient(ellipse at center, var(--secondary-bg) 0%, var(--primary-bg) 100%);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    cursor: crosshair;
}

/* Override para páginas con scroll */
body.arqueologia-page,
body.workflow-page {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh !important;
    cursor: default !important;
}

/* Override específico para index con scroll */
body.index-page {
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* Main wrapper para index */
.main-wrapper {
    min-height: 200vh;
    padding-top: 200px;
}

/* ========================================
   3. COMPONENTES COMUNES
   ======================================== */

/* 3.1 Header (logo + UMBUSK) */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 20px;  /* Cambiar de 40px a 20px para alinear con selector */
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.main-logo {
    width: auto;
    height: var(--header-height);
    transition: var(--transition-normal);
}

.main-logo:hover {
    opacity: 0.5;
}

.umbusk-watermark {
    font-size: 14px;
    opacity: 1;
    letter-spacing: 3px;
    font-weight: 200;
    transition: var(--transition-normal);
    text-align: center;
}

.umbusk-watermark:hover {
    opacity: 0.5;
}

/* 3.2 Ticker de navegación */
.ticker-container {
    position: fixed;  /* Cambiar de relative a fixed */
    width: 50%;       /* Cambiar de 33.33vw a 50% */
    top: 100px;       /* Posición fija debajo del logo */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px 0;
    overflow: hidden;
    z-index: 500;
    backdrop-filter: blur(10px);
    font-family: 'Helvetica Neue', sans-serif;
    font-size: 13px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.ticker-content {
    display: flex;
    align-items: center;
    animation: ticker 30s linear infinite;
    white-space: nowrap;
    padding-left: 0;
}

/* Pausar ticker en hover */
.ticker-container:hover .ticker-content {
    animation-play-state: paused !important;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-nav-item {
    display: inline-flex;
    align-items: center;
    margin: 0 10px;
}

.ticker-nav-item a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition-normal);
    padding: 5px 10px;
}

.ticker-nav-item a:hover {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.ticker-separator {
    width: 10px;
    height: 10px;
    margin: 0 20px;
}

/* 3.3 Selector de idioma */
.lang-selector-home {
    position: fixed;
    top: 30px;
    right: 40px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-family: 'Helvetica Neue', sans-serif;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-normal);
    z-index: 100;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-selector-home:hover {
    color: rgba(255, 255, 255, 1);
}

.lang-selector-home a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 5px;
    cursor: pointer;
    position: relative;
    display: inline-block;
}

/* Subrayados activos */
.lang-selector-home.active-es a:first-child::after,
.lang-selector-home.active-en a:last-child::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-blue);
}

/* 3.4 Back link */
.back-link-arqueologia {
    position: fixed;
    top: 35px;  /* Subir de 30px a 35px para dar más espacio */
    left: 40px;
    z-index: 100;
}

.back-link-arqueologia a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;  /* Reducir de 13px a 11px */
    font-family: 'Helvetica Neue', sans-serif;
    letter-spacing: 0.5px;  /* Reducir de 1px */
    transition: var(--transition-normal);
    text-decoration: none;
}

.back-link-arqueologia a:hover {
    opacity: 1;
    color: rgba(255, 255, 255, 0.9);
}

/* 3.5 Footer */
.footer {
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 60px 0 40px;
    margin-top: 208px;
    position: relative;
    z-index: 1000;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 200px;
    gap: 60px;
    align-items: start;
}

.footer-section h3 {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

.footer-info {
    line-height: 1.8;
}

.footer-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 10px;
}

.footer-info a {
    color: var(--accent-green);
    text-decoration: none;
    transition: var(--transition-normal);
}

.footer-info a:hover {
    opacity: 0.8;
}

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

.footer-nav li {
    margin-bottom: 12px;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-normal);
    position: relative;
}

.footer-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-green);
    transition: width 0.3s ease;
}

.footer-nav a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.footer-nav a:hover::after {
    width: 100%;
}

.qr-code {
    width: 150px;
    height: 150px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    margin: 0 auto 15px;
    display: block;
}

.qr-label {
    font-size: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.footer-bottom {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.copyright {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

/* ========================================
   4. UTILIDADES REUTILIZABLES
   ======================================== */

/* 4.1 Sistema de idiomas */
.lang-en { display: none !important; }
body.en .lang-es { display: none !important; }
body.en .lang-en { display: block !important; }

span.lang-en { display: none !important; }
body.en span.lang-es { display: none !important; }
body.en span.lang-en { display: inline !important; }

/* Para el ticker */
.ticker-nav-item .en { display: none; }
body.en .ticker-nav-item .es { display: none; }
body.en .ticker-nav-item .en { display: inline; }

/* 4.2 Animaciones comunes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(20px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes emerge {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* 4.3 Modales comunes */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    cursor: pointer;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ========================================
   5. PÁGINAS ESPECÍFICAS
   ======================================== */

/* 5.1 INDEX (Home) */
#cosmos {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    pointer-events: all;
    opacity: 0;
    animation: fadeIn 4s ease forwards;
}

.dialogue-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    z-index: 10;
    pointer-events: none;
}

#dialogue-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dialogue-line {
    opacity: 0;
    font-size: 18px;
    line-height: 1.6;
    letter-spacing: 0.5px;
    animation: fadeInUp 3s ease forwards;
    padding: 10px 20px;
    border-radius: 5px;
    pointer-events: auto;
}

.dialogue-line.voice-1 {
    align-self: flex-start;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.dialogue-line.voice-2 {
    align-self: flex-end;
    font-weight: 300;
    color: var(--text-secondary);
    background: rgba(200, 200, 255, 0.03);
    border-right: 2px solid rgba(200, 200, 255, 0.1);
}

/* Selector de modos del cosmos */
.cosmos-mode-selector {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    justify-content: center;
    z-index: 50;
}

.mode-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 15px;
    font-size: 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 1);
    border-color: rgba(255, 255, 255, 0.5);
}

.mode-info-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
    padding: 0;
}

.mode-info-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.mode-info-icon svg {
    width: 14px;
    height: 14px;
    stroke: rgba(255, 255, 255, 0.6);
}

/* Panel de información */
.mode-info-panel {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.mode-info-panel.active {
    opacity: 1;
    visibility: visible;
}

.mode-info-bubble {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px 20px;
    position: relative;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.mode-info-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.mode-info-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.9);
}

/* Historial de diálogos */
.history-trigger {
    position: fixed;
    top: 181px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition-normal);
    z-index: 31;
    font-weight: 300;
}

.history-trigger:hover {
    color: rgba(255, 255, 255, 0.8);
}

.history-container {
    position: fixed;
    top: 200px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    z-index: 40;
    display: none;
    backdrop-filter: blur(20px);
}

.history-container.active {
    display: block;
}

.history-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    background: none;
    border: none;
}

.history-close:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Indicadores y elementos adicionales */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: var(--transition-normal);
    font-weight: 200;
}

.loading-indicator.active {
    opacity: 1;
    z-index: 20;
}

.pulse {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    animation: pulse 1.5s ease-out infinite;
    margin: 0 auto;
}

.fade-message {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    opacity: 0;
}

.fade-message.active {
    animation: fadeInOut 6s ease forwards;
}

/* Compartir diálogo */
.share-dialogue-btn {
    position: fixed;
    bottom: 50%;
    right: 20%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 8px;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
    z-index: 20;
    font-size: 14px;
}

.share-dialogue-btn.show {
    display: flex;
    animation: slideInRight 0.5s ease;
}

.share-dialogue-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-5px);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Modal de compartir */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.share-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.98), rgba(30, 30, 40, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: modalFadeIn 0.3s ease;
}

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

.share-modal h3 {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 300;
    text-align: center;
    letter-spacing: 1px;
}

.share-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

/* Preview del diálogo */
.share-preview {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.8;
    max-height: 300px;
    overflow-y: auto;
}

.share-preview::-webkit-scrollbar {
    width: 6px;
}

.share-preview::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.share-preview .dialogue-item {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 10px;
}

.share-preview .voice-claude {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.share-preview .voice-gpt {
    background: rgba(200, 200, 255, 0.05);
    border-right: 3px solid rgba(200, 200, 255, 0.3);
    text-align: right;
}

/* Botones de compartir */
.share-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1DA1F2, #1a8cd8);
}

.share-btn.linkedin {
    background: linear-gradient(135deg, #0077B5, #005885);
}

.share-btn.download {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Contenedor de items del diálogo con nombres */
.dialogue-item-container {
    margin-bottom: 25px;
    animation: fadeIn 0.5s ease;
}

.dialogue-item-container:last-child {
    margin-bottom: 0;
}

/* Estilos mejorados para los items */
.share-preview .dialogue-item {
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    max-width: 85%;
    display: inline-block;
    animation: slideIn 0.3s ease;
}

.share-preview .voice-claude {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    margin-right: auto;
    text-align: left;
}

.share-preview .voice-gpt {
    background: linear-gradient(135deg, rgba(200, 200, 255, 0.08), rgba(200, 200, 255, 0.04));
    border-right: 3px solid rgba(200, 200, 255, 0.4);
    margin-left: auto;
    text-align: left;
}

/* Animación de entrada */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effect para los mensajes */
.share-preview .dialogue-item:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

/* Avatares opcionales para los LLMs */
.dialogue-item-container::before {
    content: '';
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
    background-size: cover;
    opacity: 0.7;
}

.dialogue-item-container:has(.voice-claude)::before {
    background: linear-gradient(135deg, #fff, #ddd);
    content: 'C';
    text-align: center;
    line-height: 30px;
    color: #000;
    font-weight: bold;
    font-size: 14px;
}

.dialogue-item-container:has(.voice-gpt)::before {
    background: linear-gradient(135deg, #74aa9c, #4a7c59);
    content: 'G';
    text-align: center;
    line-height: 30px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

/* Estilos para el acordeón de diálogos */
.date-item {
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.date-header {
    padding: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.date-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.date-header.active {
    background: rgba(255, 255, 255, 0.1);
}

.date-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.date-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.date-header.active .date-arrow {
    transform: rotate(180deg);
}

.dialogues-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.dialogues-content.active {
    max-height: 500px;
    overflow-y: auto;
}

/* Estilos para los diálogos */
.dialogue-group {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.dialogue-row {
    display: flex;
    margin-bottom: 10px;
    gap: 20px;
}

.voice-label {
    flex: 0 0 120px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
}

.voice-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.dialogue-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    text-align: right;
    margin-top: 10px;
}

/* 5.2 ARQUEOLOGÍA */
.arqueologia-page {
    background: linear-gradient(
        180deg,
        #1a1a1f 0%,
        #141418 15%,
        #0f0f12 30%,
        #0a0a0d 50%,
        #050507 75%,
        #000000 100%
    );
    position: relative;
}

/* Título de sección */
.arqueologia-title-section,
.workflow-title-section {
    text-align: center;
    margin-top: 200px;
    margin-bottom: 60px;
}

.arqueologia-title-section h1,
.workflow-title-section h1 {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    margin-left: auto;
    margin-right: auto;
    color: #fff;
}

.arqueologia-title-section p,
.workflow-title-section p {
    font-size: 1.2rem;
    font-weight: 300;
    margin: 0;
    color: #ccc;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Contenedor de estratos */
.strata-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    margin-bottom: 80px;
}

.stratum {
    margin-bottom: 80px;
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    animation: emerge 1s ease forwards;
}

.stratum:nth-child(1) { animation-delay: 0.5s; }
.stratum:nth-child(2) { animation-delay: 0.7s; }
.stratum:nth-child(3) { animation-delay: 0.9s; }
.stratum:nth-child(4) { animation-delay: 1.1s; }
.stratum:nth-child(5) { animation-delay: 1.3s; }
.stratum:nth-child(6) { animation-delay: 1.5s; }
.stratum:nth-child(7) { animation-delay: 1.7s; }
.stratum:nth-child(8) { animation-delay: 1.9s; }

/* Tarjetas de proyecto */
.project-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    display: flex;
    gap: 30px;
    transition: var(--transition-slow);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.project-thumbnail {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    flex-shrink: 0;
    z-index: 1000;
}

.project-thumbnail:hover {
    transform: scale(1.05);
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(30%) contrast(0.8);
    transition: filter 0.3s ease;
    z-index: 1000;
}

.project-thumbnail:hover img {
    filter: sepia(0%) contrast(1);
}

.project-thumbnail::after {
    content: "🔍";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-thumbnail:hover::after {
    opacity: 1;
}

.project-content {
    flex: 1;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    z-index: 1000;
}

.project-title {
    font-size: 1.5em;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 1);
    z-index: 1000;
}

.project-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 1);
    z-index: 1000;
}

.project-description {
    line-height: 1.6;
    color: rgba(255, 255, 255, 1);
    margin-bottom: 20px;
    z-index: 1000;
}

.project-icons {
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.project-history-icon,
.tech-details-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-normal);
    z-index: 1000;
}

.project-history-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.tech-details-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.project-history-icon svg,
.tech-details-icon svg {
    width: 18px;
    height: 18px;
    stroke: rgba(255, 255, 255, 0.6);
    z-index: 1000;
}

.company-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.85em;
    z-index: 1000;
}

/* Paneles expandibles */
.history-panel,
.tech-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    margin-top: 20px;
    z-index: 1000;
}

.history-panel.active {
    max-height: 496px;
}

.tech-panel.active {
    max-height: 200px;
}

.history-content,
.tech-content {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    font-size: 0.9em;
    z-index: 1000;
}

.history-section {
    margin-bottom: 20px;
}

.history-section:last-child {
    margin-bottom: 0;
}

.history-section h4 {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    font-size: 1.1em;
    font-weight: 400;
    z-index: 1000;
}

.history-section p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.6;
}

.tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.tech-item {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 0.85em;
    z-index: 1000;
}

/* Canvas de partículas sepia */
#particles-canvas-sepia {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

.mouse-gradient-sepia {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(160, 130, 109, 0.1) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
    transition: transform 0.2s ease-out;
}

/* 5.3 WORKFLOW */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

.main-container {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 60px;
}

.workflow-container {
    display: flex;
    gap: 20px;
    margin-bottom: 100px;
    position: relative;
    flex-wrap: wrap;
}

.connector-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, #1a365d, #164e63, #065f46, #1a365d, transparent);
    z-index: 0;
    opacity: 0.3;
}

.stage {
    flex: 1;
    min-width: 240px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.stage:nth-child(1) { animation-delay: 0.3s; }
.stage:nth-child(2) { animation-delay: 0.4s; }
.stage:nth-child(3) { animation-delay: 0.5s; }
.stage:nth-child(4) { animation-delay: 0.6s; }
.stage:nth-child(5) { animation-delay: 0.7s; }

.stage-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px 25px;
    height: 100%;
    transition: var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stage-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.stage-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-10px);
}

.stage-card:hover::before {
    opacity: 1;
}

.stage-number {
    font-size: 4rem;
    font-weight: 100;
    line-height: 1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.8;
}

.stage-title {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.stage-subtitle {
    font-size: 0.9rem;
    color: #06b6d4;
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 1px;
}

.stage-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.8;
}

.stage-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.stage-card:hover .stage-details {
    max-height: 200px;
}

.stage-details li {
    font-size: 0.8rem;
    color: #888;
    margin-left: 20px;
    margin-bottom: 8px;
    list-style: none;
    position: relative;
    padding-left: 15px;
}

.stage-details li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #3b82f6;
}

.process-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 80px;
}

.feature {
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease 0.9s forwards;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature h3 {
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.feature p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

/* ========================================
   6. MEDIA QUERIES (Responsive)
   ======================================== */

/* Desktop grande */
@media (min-width: 1200px) {
    .ticker-container {
        width: 50% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Desktop medio */
@media (min-width: 1024px) {
    .ticker-container {
        width: 50% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 0 auto !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .ticker-container {
        position: fixed !important;
        top: 100px !important;  /* Mismo que desktop */
        width: 70%;
        max-width: 600px;
    }
    
    .header {
        position: fixed !important;
        top: 20px !important;
    }    
    
    .back-link-arqueologia a {
        font-size: 11px;  /* Mantener tamaño pequeño */
    }    
    
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .qr-section {
        grid-column: span 2;
        margin: 0 auto;
    }
    
    .workflow-container {
        gap: 15px;
    }
    
    .connector-line {
        display: none;
    }
}

/* Móvil */
@media (max-width: 768px) {
    /* Header móvil */
    .header {
        position: fixed !important;  /* Cambiar de relative a fixed */
        top: 15px !important;       /* Subir el logo */
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        z-index: 1000 !important;
        background: transparent;    /* Quitar fondo negro */
        padding-bottom: 5px;
    }
    
    /* Para index.html - permitir scroll del header */
    body.index-page .header {
        position: absolute !important;  /* Se mueve con scroll */
        top: 15px !important;  /* Pero mantiene alineación inicial */
    }
    
    body.index-page .ticker-container {
        position: fixed !important;     /* Ticker fijo */
        top: 90px !important;
    }    
    
    .main-logo {
        height: 35px;
        display: block;
        margin: 0 auto;
    }
    
    .umbusk-watermark {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        margin: 5px 0 !important;
        padding: 0 !important;
        left: 0 !important;
        transform: none !important;
        font-size: 14px !important;
        letter-spacing: 2px;
    }
    
    /* Navegación */
    .back-link-arqueologia {
        position: fixed;
        top: 20px;
        left: 15px;
        z-index: 1001;
    }
    
    .back-link-arqueologia a {
        font-size: 10px !important;  /* Aún más pequeño en móvil */
        letter-spacing: 0.3px;
    }    
    
    .lang-selector-home {
        position: fixed;
        top: 15px;             /* Misma altura que back link */
        right: 15px;
        z-index: 1001;
    }
    
    /* Ticker móvil */
    .ticker-container {
        position: fixed !important;
        top: 90px !important;      /* Debajo del logo */
        width: 90% !important;      /* Más angosto en móvil */
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 999 !important;
        background: rgba(0, 0, 0, 0.9);
        padding: 6px 0;            /* Menos padding */
        font-size: 11px;           /* Texto más pequeño */
    }
    
    .ticker-nav-item a {
        font-size: 11px;
    }
    
    .ticker-separator {
        width: 8px;
        height: 8px;
        margin: 0 8px;
    }
    
    .ticker-content {
        animation-duration: 30s;
    }
    
    /* Canvas cosmos móvil */
    #cosmos {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        z-index: 1 !important;
    }
    
    /* Contenido principal */
    .main-content {
        padding-top: 120px;
        position: relative;
        z-index: 1000;
    }
    
    /* Diálogos */
    .dialogue-container {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90%;
        max-width: 350px;
        z-index: 1000;
    }
    
    .dialogue-line {
        font-size: 14px;
        padding: 10px;
    }
    
    /* Botones de modo */
    .cosmos-mode-selector {
        position: fixed !important;
        bottom: 20px !important;
        gap: 5px;
        z-index: 1000;
    }
    
    .mode-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    /* Historial móvil */
    .history-trigger {
        position: fixed !important;
        top: 92px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 1000;
    }
    
    .history-container {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90%;
        max-width: 350px;
        max-height: 60vh !important;
        padding: 15px;
        z-index: 2000 !important;
        overflow-y: auto;
    }
    
    .history-close {
        position: absolute;
        top: 10px !important;
        right: 10px !important;
        font-size: 24px !important;
        padding: 5px 10px !important;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 5px;
    }
    
/* Compartir móvil */
.share-dialogue-btn {
    bottom: 100px;
    right: 20px;
    padding: 8px 16px;
    font-size: 12px;
}

.share-modal-content {
    padding: 25px;
    width: 95%;
    margin: 10px;
}

.share-modal h3 {
    font-size: 1.2rem;
}

.share-preview {
    padding: 15px;
    max-height: 200px;
}

.share-buttons {
    flex-direction: column;
}

.share-btn {
    width: 100%;
    justify-content: center;
}

.share-close {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 20px;
}
    
    /* Footer móvil */
    .footer {
        margin-top: 50px;
        padding: 40px 0 30px;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 0 20px;
    }
    
    .footer-nav {
        display: flex;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .footer-nav li {
        margin: 0;
    }
    
    .qr-code {
        width: 120px;
        height: 120px;
    }
    
    /* Títulos de sección móvil */
    .arqueologia-title-section,
    .workflow-title-section {
        margin-top: 140px !important;  /* Espacio para header + ticker */
        padding: 0 20px;
        z-index: 1000;
    }
    
    .arqueologia-title-section h1,
    .workflow-title-section h1 {
        font-size: 2rem;
        z-index: 1000;
    }
    
    .arqueologia-title-section p,
    .workflow-title-section p {
        font-size: 1rem;
        padding: 0 20px;
        z-index: 1000;
    }
    
    /* Arqueología móvil */
    .strata-container {
        padding: 0 20px;
        z-index: 1000;
    }
    
    .project-card {
        flex-direction: column;
        padding: 20px;
    }
    
    .project-thumbnail {
        width: 100%;
        height: 200px;
        z-index: 1000;
    }
    
    /* Workflow móvil */
    .main-container {
        padding: 0 20px 40px;
    }
    
    .workflow-container {
        flex-direction: column;
    }
    
    .stage {
        min-width: 100%;
    }
    
    .process-features {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    /* Header aún más compacto */
    .header {
        top: 12px !important;  /* Subir un poco más para alineación perfecta */
    }

    .ticker-container {
        top: 85px !important;      /* Ajustar para pantallas pequeñas */
        font-size: 10px !important;
        padding: 5px 0 !important;
        width: 95% !important;     /* Casi todo el ancho */
    }
    
    /* Asegurar que el ticker sea visible */
    .ticker-content {
        min-height: 20px;
    }
    
    /* Back link super pequeño */
    .back-link-arqueologia {
        top: 18px !important;
    }    
    
    .back-link-arqueologia a {
        font-size: 9px !important;  /* Muy pequeño */
        letter-spacing: 0.2px;
    }    
    
    .history-trigger {
        top: 85px !important;
        z-index: 1000;
    }
    
    .history-container {
        max-height: 55vh !important;
        padding: 10px;
        z-index: 1000;
    }
    
    .main-logo {
        height: 30px;
    }
    
    .umbusk-watermark {
        font-size: 11px;
        margin-top: 3px;
        letter-spacing: 1.5px;
    }
    
    .cosmos-mode-selector {
        bottom: 10px !important;
    }
    
    .mode-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .ticker-content {
        animation-duration: 15s;
    }
    
     /* Títulos más abajo */
    .arqueologia-title-section,
    .workflow-title-section {
        margin-top: 130px !important;
        z-index: 1000;
    }   
    
}

/* Landscape móvil */
@media (max-width: 767px) and (orientation: landscape) {
    .ticker-container {
        width: 600px;
        max-width: 50%;
    }
    
    #cosmos {
        height: 100vh !important;
    }
    
    .dialogue-container {
        top: 50% !important;
    }
}

/* Portrait móvil */
@media (max-width: 767px) and (orientation: portrait) {
    .ticker-container {
        width: 90%;
    }
}

/* Ajustes finales */
body.index-page .main-wrapper {
    min-height: 200vh;
    padding-top: 160px;
}

.connection-status {
    position: absolute;
    bottom: 30px;
    left: 30px;
    font-size: 11px;
    opacity: 0.3;
    display: none;
}

.connection-status.show {
    display: block;
}

.connection-status.connected {
    color: #4CAF50;
}

.connection-status.error {
    color: #f44336;
}

/* Ajustar el espaciado base */
.arqueologia-title-section,
.workflow-title-section {
    text-align: center;
    margin-top: 180px;  /* Reducir de 200px para mejor proporción */
    margin-bottom: 60px;
    z-index: 1000;
}

.share-btn.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.share-btn.copy {
    background: linear-gradient(135deg, #6c757d, #495057);
}

/* Acciones en el historial */
.dialogue-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Botón de compartir mini */
.share-dialogue-btn.mini {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 11px;
    margin-left: auto;
    z-index: 10; /* Asegurar que esté encima */
    pointer-events: auto; /* Asegurar que reciba clicks */
}

/* Estilos adicionales para el botón cuando es un elemento button */
button.share-dialogue-btn.mini {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    outline: none;
}

button.share-dialogue-btn.mini:active {
    transform: scale(0.95);
}

.share-dialogue-btn.mini:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
}

.share-dialogue-btn.mini svg {
    width: 14px;
    height: 14px;
}

/* Asegurar que el texto del diálogo no tenga saltos de línea */
.voice-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    white-space: normal; /* Cambiar de pre-wrap a normal */
    word-break: break-word;
}

.share-history-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 4px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    font-family: 'Helvetica Neue', sans-serif;
}

.share-history-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.share-history-btn svg {
    width: 12px;
    height: 12px;
}

/* Mejorar el estilo del grupo de diálogos */
.dialogue-group {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.dialogue-group:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Ajustar el texto para que se vea completo */
.voice-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    white-space: pre-wrap;  /* Mantener saltos de línea */
    word-break: break-word;  /* Romper palabras largas */
}