/* 
 * Estilos del Sistema de Gestión de Turnos
 * Versión optimizada para móviles - compacta
 */

/* ========== Variables CSS ========== */
:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #16a34a;
    --warning-color: #ea580c;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #cbd5e1;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    --transition: all 0.2s ease;
}

/* ========== Reset y Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== Página de Login ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 1.5rem;
}

.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
}

.login-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.login-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ========== Página de Participante ========== */
.participant-page {
    background-color: var(--bg-secondary);
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.info-section {
    margin-bottom: 2rem;
}

.meeting-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.meeting-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ========== Opciones de Turno ========== */
.turn-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.turn-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.turn-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.turn-option-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.turn-option-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.turn-option-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ========== Lista de Turnos ========== */
.turns-list {
    max-height: 500px;
    overflow-y: auto;
}

.turn-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--border-color);
    transition: var(--transition);
}

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

.turn-pending {
    border-left-color: var(--info-color);
}

.turn-active {
    border-left-color: var(--success-color);
    background: #ecfdf5;
}

.turn-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.turn-info {
    flex: 1;
}

.turn-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.turn-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.turn-role {
    color: var(--text-secondary);
}

.turn-duration {
    color: var(--info-color);
    font-weight: 500;
}

.turn-status {
    color: var(--success-color);
    font-weight: 500;
}

.turn-comment {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* ========== Controles de Moderador ========== */
.moderator-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border: 2px solid var(--warning-color);
}

.moderator-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ========== Formularios ========== */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========== Botones ========== */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #c2410c;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ========== Pantalla de Visualización ========== */
.display-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
}

.display-container {
    min-height: 100vh;
    padding: 2rem;
}

.display-header {
    text-align: center;
    margin-bottom: 2rem;
}

.display-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.display-time {
    font-size: 1.5rem;
    color: #94a3b8;
    font-weight: 300;
}

.current-turn-display {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border-radius: var(--radius-lg);
    padding: 3rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.current-turn-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.current-speaker-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.speaker-icon {
    font-size: 4rem;
}

.speaker-details {
    text-align: center;
}

.speaker-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.speaker-role {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.speaker-timer {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.timer-display {
    font-weight: 700;
    font-size: 2rem;
}

.timer-overtime {
    color: #fca5a5;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

.upcoming-turns {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.upcoming-turns h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.display-turns-list {
    display: grid;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.display-turn-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: var(--transition);
}

.display-turn-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.turn-position {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.turn-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.turn-participant {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.participant-name {
    font-size: 1.25rem;
    font-weight: 600;
}

.participant-role {
    font-size: 1rem;
    opacity: 0.8;
}

.turn-duration-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.more-turns {
    text-align: center;
    padding: 1rem;
    color: #94a3b8;
    font-style: italic;
}

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

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* ========== Footer ========== */
.app-footer,
.display-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.display-footer {
    color: rgba(255, 255, 255, 0.6);
}

/* ========== Toast Notifications ========== */
.toast {
    position: fixed;
    bottom: -100px;
    right: 2rem;
    background: var(--text-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transition: bottom 0.3s ease;
    z-index: 1000;
    max-width: 400px;
}

.toast-show {
    bottom: 2rem;
}

.toast-success {
    background: var(--success-color);
}

.toast-error {
    background: var(--danger-color);
}

.toast-warning {
    background: var(--warning-color);
}

.toast-info {
    background: var(--info-color);
}

/* ========== Mensajes de Error ========== */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-left: 4px solid var(--danger-color);
}

/* ========== Links ========== */
.link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.link:hover {
    text-decoration: underline;
}

.display-page .link {
    color: #60a5fa;
}

/* ========== RESPONSIVE MÓVIL - ULTRA COMPACTO ========== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    /* Header más compacto */
    .app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }
    
    .header-content {
        padding: 0.5rem 0.75rem;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .app-header h1 {
        font-size: 1rem;
    }
    
    .user-info {
        gap: 0.5rem;
    }
    
    .user-name {
        display: none; /* Ocultar nombre en móvil */
    }
    
    .user-role {
        font-size: 0.7rem;
    }
    
    .btn-small {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    /* Contenido principal ajustado */
    .main-content {
        padding: 0.75rem;
        margin-top: 50px; /* Espacio para header fijo */
        overflow-y: auto;
        height: calc(100vh - 50px);
    }
    
    /* Ocultar sección de información */
    .info-section {
        display: none;
    }
    
    /* Cards más compactos */
    .card {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border-radius: var(--radius-md);
    }
    
    .card h3 {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .section-description {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
        display: none; /* Ocultar descripción */
    }
    
    /* Opciones de turno en una fila */
    .turn-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .turn-option {
        padding: 0.6rem 0.3rem;
    }
    
    .turn-option-icon {
        font-size: 1.3rem;
        margin-bottom: 0.2rem;
    }
    
    .turn-option-title {
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
    }
    
    .turn-option-desc {
        font-size: 0.65rem;
    }
    
    /* Textarea más pequeño */
    .form-group {
        margin-bottom: 0.5rem;
    }
    
    .form-group label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .form-group textarea {
        min-height: 50px;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    /* Turno actual más compacto */
    #currentTurnSection {
        padding: 0.75rem;
    }
    
    .current-turn-info {
        font-size: 0.85rem;
    }
    
    .turn-status, .turn-duration {
        font-size: 0.8rem;
    }
    
    /* Lista de turnos compacta */
    .turns-list {
        max-height: 250px;
    }
    
    .turn-item {
        padding: 0.5rem;
        margin-bottom: 0.4rem;
        gap: 0.5rem;
    }
    
    .turn-number {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .turn-name {
        font-size: 0.85rem;
        margin-bottom: 0.1rem;
    }
    
    .turn-details {
        gap: 0.4rem;
        font-size: 0.7rem;
    }
    
    .turn-comment {
        padding: 0.3rem;
        font-size: 0.7rem;
        margin-top: 0.3rem;
    }
    
    /* Controles de moderador compactos */
    .moderator-section {
        padding: 0.75rem;
    }
    
    .moderator-actions {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .moderator-actions .btn {
        width: auto;
        flex: 1;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Botones más pequeños */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Footer oculto en móvil */
    .app-footer {
        display: none;
    }
    
    /* Toast más pequeño */
    .toast {
        right: 0.5rem;
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        max-width: 300px;
    }
    
    .toast-show {
        bottom: 0.5rem;
    }
    
    /* Login ajustado */
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .login-header p {
        font-size: 0.8rem;
    }
}

/* Para pantallas muy pequeñas */
@media (max-height: 700px) {
    .turn-options {
        margin-bottom: 0.5rem;
    }
    
    .turns-list {
        max-height: 180px;
    }
    
    .card h3 {
        font-size: 0.9rem;
    }
}

/* ========== Scrollbar Personalizado ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
