/* Reset y variables CSS */
:root {
    --primary-color: #4A90E2;
    --secondary-color: #50C878;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --success-color: #27AE60;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --border-color: #E0E0E0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

* {
    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;
    color: var(--text-dark);
    font-size: 18px;
    line-height: 1.6;
}

/* Contenedor principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Tarjetas */
.card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.header .user-info {
    font-size: 18px;
    opacity: 0.9;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 8px 30px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    min-width: 200px;
    margin: 10px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #357ABD, #2868A6);
}

.btn-success {
    background: linear-gradient(135deg, #50C878, #3DA35D);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #3DA35D, #2E8B57);
}

.btn-danger {
    background: linear-gradient(135deg, #E74C3C, #C0392B);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #C0392B, #A93226);
}

.btn-warning {
    background: linear-gradient(135deg, #F39C12, #E67E22);
    color: white;
}

.btn-large {
    /*  padding: 30px 60px;*/
    font-size: 32px;
    /*min-height: 120px;*/
    width: 100%;
    /*max-width: 500px;*/
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* Formularios */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 18px;
    font-size: 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition);
    background: var(--bg-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

select.form-control {
    cursor: pointer;
}

/* Rutinas */
.rutinas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.rutina-card {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow);
    border-left: 6px solid var(--primary-color);
    transition: var(--transition);
}

.rutina-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.rutina-card.completada {
    border-left-color: var(--success-color);
    background: linear-gradient(to right, #e8f5e9, white);
}

.rutina-card.pendiente {
    border-left-color: var(--warning-color);
    background: linear-gradient(to right, #fff3e0, white);
}

.rutina-card.atrasada {
    border-left-color: var(--danger-color);
    background: linear-gradient(to right, #ffebee, white);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

.rutina-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.rutina-titulo {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

.rutina-tipo {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.rutina-tipo.medicacion {
    background: #E3F2FD;
    color: #1976D2;
}

.rutina-tipo.tarea {
    background: #F3E5F5;
    color: #7B1FA2;
}

.rutina-hora {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 10px 0;
}

.rutina-descripcion {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.rutina-estado {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
}

.estado-completada {
    background: var(--success-color);
    color: white;
}

.estado-pendiente {
    background: var(--warning-color);
    color: white;
}

.estado-atrasada {
    background: var(--danger-color);
    color: white;
}

/* Alertas */
.alerta-badge {
    position: relative;
    display: inline-block;
}

.alerta-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.alerta-item {
    background: #FFEBEE;
    border-left: 6px solid var(--danger-color);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.alerta-item.leida {
    background: var(--bg-light);
    border-left-color: var(--text-light);
    opacity: 0.7;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-emergency {
    border: 5px solid var(--danger-color);
    animation: emergencyPulse 1s infinite;
}

@keyframes emergencyPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
    }

    50% {
        box-shadow: 0 0 40px rgba(231, 76, 60, 0.8);
    }
}

.close {
    float: right;
    font-size: 40px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--danger-color);
}

/* Asistente de voz */
.voice-assistant {
    text-align: center;
    padding: 4px;
}

.voice-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.voice-button:hover {
    transform: scale(1.1);
}

.voice-button.listening {
    animation: voicePulse 1.5s infinite;
    background: linear-gradient(135deg, #E74C3C, #C0392B);
}

@keyframes voicePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(231, 76, 60, 0);
    }
}

.voice-icon {
    font-size: 80px;
    color: white;
}

.voice-status {
    margin-top: 3px;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Tabla */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 18px;
}

.table th {
    background: var(--bg-light);
    font-weight: 700;
    color: var(--text-dark);
}

.table tr:hover {
    background: var(--bg-light);
}

/* Navegación */
.nav {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 15px 30px;
    background: var(--bg-white);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

/* Utilidades */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 24px;
    }

    .btn {
        font-size: 20px;
        padding: 15px 30px;
    }

    .btn-large {
        font-size: 24px;
        padding: 25px 40px;
    }

    .rutinas-grid {
        grid-template-columns: 1fr;
    }

    .voice-button {
        width: 150px;
        height: 150px;
    }

    .voice-icon {
        font-size: 60px;
    }
}