:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #252d3d;
    --text-primary: #e0e6ed;
    --text-secondary: #8b92a1;
    --accent-primary: #00d4ff;
    --accent-secondary: #ff6b35;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --border: #404854;
    --player-height: 60px;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* PANTALLA DE CARGA - SCROLLABLE */
.upload-screen {
    min-height: 100vh;
    overflow-y: auto;
    padding-bottom: 40px;
}

/* HEADER INICIAL */
.header-initial {
    background: linear-gradient(135deg, #1a2332 0%, #252d3d 100%);
    border-bottom: 1px solid var(--border);
    padding: 30px 20px;
    text-align: center;
}

.header-initial h1 {
    font-size: 2em;
    margin-bottom: 8px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-initial p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-size: 0.9em;
}

.upload-screen .header-initial {
    position: sticky;
    top: 0;
    z-index: 10;
}

.upload-steps {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.upload-step {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 30px 25px;
    flex: 1;
    min-width: 250px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-step:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
}

.upload-step.completed {
    border: 2px solid var(--success);
    background: rgba(46, 204, 113, 0.1);
}

.upload-step.error {
    border: 2px solid var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

.upload-step i {
    font-size: 3em;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.upload-step.completed i {
    color: var(--success);
}

.upload-step h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-step p {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.upload-step input[type=file] {
    display: none;
}

.json-textarea {
    width: 100%;
    min-height: 200px;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    padding: 15px;
    resize: vertical;
    margin-top: 10px;
    transition: all 0.3s;
}

.json-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.json-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.upload-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #00b8d4 100%);
    color: var(--bg-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9em;
}

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

/* BOTÓN FLOTANTE NUEVA LLAMADA */
.fab-button {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #00b8d4 100%);
    color: var(--bg-primary);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
    transition: all 0.3s;
    z-index: 1000;
    display: none;
}

.fab-button:hover {
    transform: scale(1.1) rotate(90deg);
}

.fab-button.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* LAYOUT PRINCIPAL */
.main-container {
    display: none;
    height: 100vh;
    flex-direction: column;
    overflow: hidden;
}

.main-container.active {
    display: flex;
}

/* HEADER FIJO CON INFORMACIÓN + PLAYER */
.header-info {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
    padding: 15px 20px;
    z-index: 100;
    position: relative;
}

/* BOTÓN MENÚ MÓVIL */
.mobile-menu-btn {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--accent-primary);
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 101;
}

.mobile-menu-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
}

.mobile-menu-btn.active {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

/* PANEL EXPANDIBLE MÓVIL */
.mobile-info-panel {
    display: contents;
}

.mobile-info-panel .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid var(--accent-primary);
}

.info-card i {
    font-size: 1.5em;
    color: var(--accent-primary);
    min-width: 30px;
}

.info-card .info-text h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.info-card .info-text p {
    font-size: 0.75em;
    color: var(--text-secondary);
}

/* SEARCH BAR */
.search-container {
    position: relative;
    margin-bottom: 15px;
}

.search-box {
    width: 100%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 12px 45px 12px 45px;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1em;
}

.clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1em;
    display: none;
    transition: all 0.3s;
}

.clear-search:hover {
    color: var(--accent-primary);
}

.clear-search.active {
    display: block;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.3s;
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

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

.search-result-speaker {
    font-weight: 700;
    font-size: 0.75em;
    color: var(--accent-primary);
    margin-bottom: 5px;
}

.search-result-text {
    font-size: 0.85em;
    color: var(--text-primary);
}

.search-result-text mark {
    background: rgba(0, 212, 255, 0.3);
    color: var(--accent-primary);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* FONT SIZE CONTROLS */
.font-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.font-controls label {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-right: 5px;
}

.font-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--accent-primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.font-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.font-size-display {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.85em;
    min-width: 45px;
    text-align: center;
}

/* CONTENIDO CENTRAL - DOS COLUMNAS */
.content-area {
    flex: 1;
    overflow: hidden;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 0;
}

/* COLUMNA IZQUIERDA - TIMELINE SELECT */
.timeline-column {
    background: var(--bg-secondary);
    border-right: 2px solid var(--border);
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 80px;
}

.timeline-column h2 {
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-column h2 i {
    color: var(--accent-primary);
}

.timeline-select-item {
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.timeline-select-item:hover {
    border-color: var(--accent-primary);
    transform: translateX(5px);
    background: var(--bg-secondary);
}

.timeline-select-item.active {
    border-color: var(--accent-primary);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.timeline-select-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-primary);
    border-radius: 10px 0 0 10px;
}

.timeline-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.timeline-item-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1em;
    flex-shrink: 0;
}

.timeline-select-item.active .timeline-item-icon {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

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

.timeline-item-event {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9em;
    margin-bottom: 3px;
}

.timeline-select-item.active .timeline-item-event {
    color: var(--accent-primary);
}

.timeline-item-time {
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* COLUMNA DERECHA - TRANSCRIPCIÓN */
.transcript-column {
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
}

.transcript-container {
    background: transparent;
    border: none;
    padding: 0;
}

.transcript-line {
    display: grid;
    grid-template-columns: 100px 90px 1fr;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
}

.transcript-line:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.transcript-line.active {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.transcript-line.highlighted {
    background: rgba(255, 235, 59, 0.15);
    border-color: #ffd93d;
}

.time-stamp {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.7em;
    align-self: center;
    font-family: 'Courier New', monospace;
    line-height: 1.3;
}

.speaker-tag {
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.75em;
    color: white;
    align-self: center;
}

.speaker-tag.Agente {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #00b8d4 100%);
}

.speaker-tag.Cliente {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #e74c3c 100%);
}

.text-content {
    align-self: center;
    color: var(--text-primary);
}

.text-content mark {
    background: rgba(255, 235, 59, 0.4);
    color: #ffd93d;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* PLAYER FIJO INFERIOR */
.player-fixed {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 10px 20px;
    height: var(--player-height);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: none;
}

.player-fixed.active {
    display: block;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
}

.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #00b8d4 100%);
    color: var(--bg-primary);
    border: none;
    font-size: 1em;
    transition: all 0.3s;
    flex-shrink: 0;
}

.play-btn:hover {
    transform: scale(1.1);
}

.time-display {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 0.85em;
    min-width: 90px;
    flex-shrink: 0;
}

.progress-container {
    flex: 1;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 5px;
    background: var(--bg-primary);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    width: 0%;
    transition: width 0.1s linear;
}

.speed-control {
    position: relative;
    flex-shrink: 0;
}

.speed-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--accent-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.speed-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.speed-panel {
    position: absolute;
    bottom: 50px;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.speed-panel.open {
    display: block;
}

.speed-panel label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8em;
    margin-bottom: 8px;
}

.speed-panel input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.speed-value {
    color: var(--accent-primary);
    font-weight: 700;
    text-align: center;
    margin-top: 8px;
    font-size: 1.1em;
}

/* MENSAJES */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 0.9em;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

.message.success {
    background: rgba(46, 204, 113, 0.2);
    color: #7dff8f;
    border-left: 4px solid var(--success);
}

.message.error {
    background: rgba(231, 76, 60, 0.2);
    color: #ff7675;
    border-left: 4px solid var(--danger);
}

.message.warning {
    background: rgba(243, 156, 18, 0.2);
    color: #ffd93d;
    border-left: 4px solid var(--warning);
}

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

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 10px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .upload-steps {
        flex-direction: column;
    }

    /* MENÚ MÓVIL */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-info {
        padding: 15px 15px 15px 65px;
    }

    .mobile-info-panel {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 2px solid var(--border);
        padding: 20px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
        z-index: 100;
        animation: slideDown 0.3s ease;
    }

    .mobile-info-panel.open {
        display: block;
    }

    .mobile-info-panel .info-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 15px;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .content-area {
        grid-template-columns: 1fr;
    }

    .timeline-column {
        border-right: none;
        border-bottom: 2px solid var(--border);
        max-height: 300px;
    }

    .transcript-line {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .player-controls {
        flex-wrap: wrap;
        gap: 10px;
    }

    .time-display {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .progress-container {
        order: 2;
        width: 100%;
    }

    .fab-button {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    .font-controls {
        width: 100%;
        justify-content: center;
    }
}