/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-fondo: #FDF8F0;
    --color-texto: #1A1A1A;
    --color-accento: #E67E22;
    --color-resaltado: #F1C40F;
    --color-enlace: #27AE60;
    --color-fondo-oscuro: #2C2C2C;
    --color-texto-oscuro: #F5F0E8;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-fondo);
    color: var(--color-texto);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #FDF8F0 0%, #F5E6D3 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    text-align: center;
    width: 90%;
    max-width: 400px;
}

.login-box h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--color-accento);
}

.login-box input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    font-size: 1rem;
    margin: 15px 0;
}

.login-box button {
    width: 100%;
    padding: 15px;
    background: var(--color-accento);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
}

/* App container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.app-header h1 {
    font-size: 1.5rem;
    color: var(--color-accento);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f0ebe3;
}

.btn-primary {
    background: var(--color-accento);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Document list */
.document-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px;
}

.doc-card {
    display: flex;
    align-items: center;
    background: white;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.doc-card:active {
    transform: scale(0.98);
}

.doc-icon {
    font-size: 2rem;
    margin-right: 16px;
}

.doc-info {
    flex: 1;
}

.doc-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.doc-info p {
    font-size: 0.8rem;
    color: #999;
}

.btn-small {
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 8px;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
}

/* Bottom nav */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: white;
    border-top: 1px solid #eee;
    padding: 8px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 800px;
    margin: 0 auto;
    flex-shrink: 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--color-accento);
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-label {
    font-size: 0.7rem;
    margin-top: 2px;
}

/* Editor page */
.editor-page {
    background: white;
}

.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.editor-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    gap: 12px;
}

.btn-back {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
}

.titulo-input {
    flex: 1;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 8px 0;
    background: transparent;
    outline: none;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.btn-dictado, .btn-guardar {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
}

.btn-dictado:active, .btn-guardar:active {
    transform: scale(0.9);
}

.btn-dictado.grabando {
    color: red;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.editor-main {
    flex: 1;
    overflow: hidden;
}

.editor-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#editor {
    flex: 1;
    padding: 20px 16px;
    border: none;
    font-size: 1rem;
    line-height: 1.8;
    resize: none;
    outline: none;
    font-family: inherit;
    background: white;
    color: var(--color-texto);
}

#preview {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
    background: white;
    display: none;
}

.preview-hidden {
    display: none !important;
}

/* Dictado status */
.dictado-status {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 200;
    backdrop-filter: blur(10px);
}

.dictado-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: green;
}

.dictado-indicator.active {
    background: red;
    animation: pulse 1s infinite;
}

/* Reunion page */
.reunion-page {
    background: var(--color-fondo);
}

.reunion-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
}

.reunion-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-bottom: 1px solid #eee;
    gap: 12px;
    flex-shrink: 0;
}

.reunion-header h1 {
    flex: 1;
    font-size: 1.3rem;
}

.btn-grabar {
    background: #E74C3C;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-grabar.grabando {
    background: #C0392B;
    animation: pulse 1s infinite;
}

.reunion-main {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    padding-bottom: 100px;
}

.grabacion-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot-inactive {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #95a5a6;
    display: inline-block;
}

.dot-active {
    background: #E74C3C;
    animation: pulse 1s infinite;
}

.timer-container {
    font-size: 1.3rem;
    font-weight: bold;
    font-family: monospace;
}

.participantes-container, .transcripcion-container, .keywords-container {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.participantes-container h3, .transcripcion-container h3, .keywords-container h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
}

.participantes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participante-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f5f0eb;
}

.p-nombre {
    font-weight: 500;
}

.p-tiempo {
    color: #666;
}

.transcripcion-live {
    max-height: 200px;
    overflow-y: auto;
}

.mensaje-tiempo {
    padding: 6px 0;
    border-bottom: 1px solid #f5f0eb;
    display: flex;
    gap: 12px;
}

.msg-time {
    color: #999;
    font-family: monospace;
    font-size: 0.8rem;
    min-width: 60px;
}

.msg-text {
    flex: 1;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    background: var(--color-resaltado);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.reunion-controls {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.ctrl-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    background: #ecf0f1;
    color: #2c3e50;
    min-width: 100px;
}

.ctrl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ctrl-btn.danger {
    background: #E74C3C;
    color: white;
}

.ctrl-btn.success {
    background: var(--color-enlace);
    color: white;
}

.resumen-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-top: 16px;
}

.resumen-container h3 {
    margin-bottom: 16px;
}

#resumenContent {
    line-height: 1.8;
}

/* Responsive */
@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.2rem;
    }
    
    .btn-primary {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .doc-card {
        padding: 12px;
    }
    
    .reunion-controls {
        gap: 6px;
    }
    
    .ctrl-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
        min-width: 80px;
    }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--color-accento);
    border-radius: 10px;
}