/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.brand-header .logo {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.brand-text {
    text-align: left;
}

.header h1, .title {
    color: #ffffff;
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.subtitle {
    color: #f8f9fa;
    font-size: 1.1rem;
    margin: 0.5rem 0 0 0;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Tarjeta de fichaje */
.fichaje-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.fichaje-card h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Formulario */
.fichaje-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 1rem;
}

.form-group input {
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-align: center;
    text-transform: uppercase;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Botón de fichar */
.btn-fichar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-fichar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-fichar:active {
    transform: translateY(0);
}

.btn-fichar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Estados del botón */
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Resultado */
.resultado {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
}

.resultado.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.resultado.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.resultado.confirmacion {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    text-align: left;
}

/* Estilos para la confirmación de fichaje */
.confirmacion-fichaje {
    padding: 0px 0;
}

.fichaje-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}


.user-info {
    text-align: center;
}

.user-info h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
}

.location-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
    font-size: 1rem;
}

.location-icon {
    font-size: 16px;
}

.horario-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
    font-size: 0.95rem;
    margin-top: 8px;
}

.horario-icon {
    font-size: 16px;
}

.horario-text {
    font-weight: 500;
}

.ultimo-fichaje {
    margin: 15px 0 25px 0;
    padding: 12px 15px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
    border-left: 4px solid #6c757d;
}

.fichaje-previo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fichaje-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.fichaje-detalle {
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
}

.accion-selector {
    text-align: center;
}

.accion-selector h4 {
    margin-bottom: 20px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.botones-accion {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

/* Desktop: apilar vertical y mostrar sugerido arriba */
.botones-accion {
    flex-direction: column;
    align-items: center;
}

.btn-accion.sugerida {
    order: 0;
}

.btn-accion:not(.sugerida) {
    order: 1;
}

.btn-accion {
    width: 95%;
    max-width: none;
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-accion:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-accion.sugerida {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    color: #155724;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.btn-accion.sugerida:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Estilos para botón NO sugerido */
.btn-accion:not(.sugerida) {
    width: 70%;
    transform: scale(1);
    opacity: 0.7;
    border-color: #dee2e6;
    background: #f8f9fa;
}

.btn-accion:not(.sugerida) .accion-titulo {
    color: #6c757d;
    font-weight: 500;
}

.btn-accion:not(.sugerida) .accion-icon svg {
    opacity: 0.6;
}

.btn-accion:not(.sugerida):hover {
    transform: translateY(-2px);
    opacity: 0.85;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.accion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.accion-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.accion-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sugerido {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
    background: rgba(255,255,255,0.7);
    padding: 2px 8px;
    border-radius: 10px;
}


/* Estilos para fichaje exitoso */
.fichaje-exitoso {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    text-align: center;
}

.success-icon {
    font-size: 3rem;
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

.success-content h3 {
    margin: 0 0 20px 0;
    color: #155724;
    font-size: 1.5rem;
    font-weight: 600;
}

.fichaje-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.accion-realizada {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255,255,255,0.8);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    font-size: 1.2rem;
}

.usuario-info {
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}

.ubicacion-info, .timestamp-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #666;
    font-size: 1rem;
}

.location-icon, .time-icon {
    font-size: 16px;
}

/* Panel de información */
.info-panel {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

.current-time {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.current-date {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    text-align: center;
}

.admin-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.admin-link:hover {
    color: white;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .fichaje-card {
        padding: 20px 20px;
    }
    
    .current-time {
        font-size: 1.5rem;
    }
    
    .botones-accion {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-accion {
        width: 95%;
        max-width: none;
        padding: 8px 20px;
    }
    
    .btn-accion:not(.sugerida) {
        width: 65%;
    }
    
    .fichaje-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    
    .user-info h3 {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .accion-selector h4 {
        font-size: 1rem;
    }
    
    .success-content h3 {
        font-size: 1.3rem;
    }
    
    .accion-realizada {
        flex-direction: column;
        gap: 8px;
    }
}

/* Estilos para la alerta de confirmación */
.alerta-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.alerta-no-recomendada {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-out;
}

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

.alerta-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.warning-icon {
    font-size: 2.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.alerta-header h3 {
    color: #dc3545;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.alerta-content {
    margin-bottom: 25px;
    text-align: center;
}

.alerta-content p {
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.alerta-content p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: #dc3545;
}

.alerta-botones {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-cancelar, .btn-confirmar {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cancelar {
    background: #6c757d;
    color: white;
}

.btn-cancelar:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-confirmar {
    background: #dc3545;
    color: white;
}

.btn-confirmar:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* Responsive para la alerta */
@media (max-width: 600px) {
    .alerta-no-recomendada {
        padding: 20px;
        margin: 20px;
    }
    
    .alerta-header h3 {
        font-size: 1.2rem;
    }
    
    .warning-icon {
        font-size: 2rem;
    }
    
    .alerta-botones {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-cancelar, .btn-confirmar {
        width: 100%;
        justify-content: center;
    }
}
