/**
 * Estilos principales - Gestor Horario
 */

/* Variables CSS */
:root {
    --primary-color: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
}

/* Base */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    border-radius: 0.75rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 600;
}

/* Botones de fichaje */
.btn-fichaje {
    padding: 1.5rem 2rem;
    font-size: 1.25rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.btn-fichaje:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-entrada {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
}

.btn-entrada:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
}

.btn-salida {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    color: white;
}

.btn-salida:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
}

.btn-pausa {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: white;
}

.btn-pausa:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: white;
}

/* Reloj grande */
.clock-display {
    font-size: 4rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.clock-date {
    font-size: 1.25rem;
    color: #6b7280;
}

/* Estado de fichaje */
.fichaje-status {
    padding: 1rem;
    border-radius: 0.75rem;
    background: #f3f4f6;
}

.fichaje-status.working {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

.fichaje-status.paused {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.fichaje-status.finished {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
}

/* Timeline de fichajes */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 2px solid #2563eb;
}

.timeline-item.entrada::before {
    border-color: #10b981;
    background: #10b981;
}

.timeline-item.salida::before {
    border-color: #ef4444;
    background: #ef4444;
}

.timeline-item.pausa::before {
    border-color: #f59e0b;
    background: #f59e0b;
}

/* Indicador offline */
.offline-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fef3c7;
    color: #92400e;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    z-index: 1050;
    border-top: 1px solid #fcd34d;
}

/* Calendario */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day:hover {
    background: #f3f4f6;
}

.calendar-day.today {
    background: #2563eb;
    color: white;
    font-weight: 600;
}

.calendar-day.festivo {
    background: #fee2e2;
    color: #991b1b;
}

.calendar-day.ausencia {
    background: #dbeafe;
    color: #1e40af;
}

.calendar-day.vacaciones {
    background: #d1fae5;
    color: #065f46;
}

/* Tablas */
.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* Badges de estado */
.badge-estado {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Stats cards */
.stat-card {
    padding: 1.5rem;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: 0.875rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Loading spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .clock-display {
        font-size: 3rem;
    }
    
    .btn-fichaje {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* PWA Install prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .pwa-install-prompt {
        left: auto;
        max-width: 400px;
    }
}
