/* ============================================
   Recuerda+ — Estilos Globales
   ============================================ */

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Colores primarios */
    --color-primary: #00796b;
    --color-primary-dark: #004d40;
    --color-primary-light: #0097a7;
    --color-accent: #0dbfe0;

    /* Colores de estado */
    --color-success: #388e3c;
    --color-success-bg: #e8f5e9;
    --color-success-border: #c8e6c9;
    --color-warning: #f57c00;
    --color-warning-bg: #fff3e0;
    --color-warning-border: #ffe0b2;
    --color-error: #f44336;
    --color-error-bg: #ffebee;
    --color-error-border: #ffcdd2;
    --color-info: #1976d2;
    --color-info-bg: #e3f2fd;

    /* Colores de texto */
    --color-text: #333;
    --color-text-secondary: #757575;
    --color-text-muted: #9e9e9e;
    --color-text-dark: #424242;

    /* Fondos */
    --color-bg: #f5f5f5;
    --color-bg-card: #ffffff;
    --color-bg-hover: #f9f9f9;
    --color-bg-input: #ffffff;
    --color-border: #e0e0e0;
    --color-border-light: #f0f0f0;

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    --gradient-danger: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
    --gradient-login-bg: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);

    /* Sombras */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 10px 25px rgba(0, 150, 136, 0.2);
    --shadow-header: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-nav: 0 -2px 10px rgba(0, 0, 0, 0.1);
    --shadow-modal: 0 5px 20px rgba(0, 0, 0, 0.2);

    /* Bordes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-pill: 20px;
    --radius-circle: 50%;

    /* Tipografía — tamaños base */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 16px;
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-md: 14px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-xxl: 24px;

    /* Espaciado */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 25px;

    /* Z-index */
    --z-header: 100;
    --z-nav: 100;
    --z-dropdown: 101;
    --z-overlay: 900;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* --- Modo Oscuro (variables override) --- */
:root.dark-mode {
    --color-text: #e0e0e0;
    --color-text-secondary: #b0b0b0;
    --color-text-muted: #888;
    --color-text-dark: #ccc;

    --color-bg: #121212;
    --color-bg-card: #1e1e1e;
    --color-bg-hover: #2a2a2a;
    --color-bg-input: #2a2a2a;
    --color-border: #333;
    --color-border-light: #2a2a2a;

    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.4);
    --shadow-header: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-nav: 0 -2px 10px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
    :root:not(.light-mode) {
        --color-text: #e0e0e0;
        --color-text-secondary: #b0b0b0;
        --color-text-muted: #888;
        --color-text-dark: #ccc;

        --color-bg: #121212;
        --color-bg-card: #1e1e1e;
        --color-bg-hover: #2a2a2a;
        --color-bg-input: #2a2a2a;
        --color-border: #333;
        --color-border-light: #2a2a2a;

        --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 5px 15px rgba(0, 0, 0, 0.4);
        --shadow-header: 0 2px 10px rgba(0, 0, 0, 0.4);
        --shadow-nav: 0 -2px 10px rgba(0, 0, 0, 0.4);
    }
}

/* --- Tamaño de fuente ajustable --- */
html.font-small { font-size: 14px; }
html.font-normal { font-size: 16px; }
html.font-large { font-size: 20px; }

/* ============================================
   Reset & Base
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: var(--font-size-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Container
   ============================================ */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-lg) var(--spacing-md);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    box-shadow: var(--shadow-header);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-name {
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.app-name img {
    width: 40%;
    height: auto;
    -webkit-mask-image: url('../img/logowt_sinfondo.webp');
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-image: url('../img/logowt_sinfondo.webp');
    mask-repeat: no-repeat;
    mask-size: contain;
    background-color: white;
}

.back-btn {
    color: white;
    text-decoration: none;
    font-size: var(--font-size-xxl);
    margin-right: var(--spacing-md);
}

/* ============================================
   User Menu (Dropdown)
   ============================================ */
.user-menu {
    position: relative;
}

.user-menu-btn {
    background: rgba(255, 255, 255, 0);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: var(--font-size-lg);
}

.user-menu-btn img {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    right: 0;
    z-index: -1;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-bg-card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    width: 150px;
    display: none;
    z-index: var(--z-dropdown);
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 12px var(--spacing-md);
    color: var(--color-text-dark);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border-light);
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background-color: var(--color-bg-hover);
}

/* ============================================
   Bottom Navigation
   ============================================ */
.nav {
    background: var(--color-bg-card);
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-md) 0;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    z-index: var(--z-nav);
    box-shadow: var(--shadow-nav);
    border-top: 1px solid var(--color-border-light);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item:hover {
    color: var(--color-primary);
}

.nav-icon {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-xs);
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-icon img {
    width: 30%;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    padding: var(--spacing-lg) var(--spacing-md);
    padding-bottom: 80px;
}

/* ============================================
   Cards / Sections
   ============================================ */
.section {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border-light);
}

.section-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-primary);
}

.see-all {
    color: var(--color-primary-light);
    text-decoration: none;
    font-size: var(--font-size-md);
    font-weight: 500;
}

.see-all:hover {
    text-decoration: underline;
}

/* ============================================
   Form Elements
   ============================================ */
.form-container {
    padding: var(--spacing-lg) var(--spacing-md);
    padding-bottom: 100px;
}

.form {
    display: none;
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.form.active {
    display: block;
}

.form-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--color-primary);
    text-align: center;
}

.input-group {
    margin-bottom: var(--spacing-md);
}

.input-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-md);
    color: var(--color-text-dark);
    font-weight: 500;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    transition: border-color 0.3s;
    background-color: var(--color-bg-input);
    color: var(--color-text);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--color-primary-light);
    outline: none;
}

.input-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox groups */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: var(--font-size-md);
}

.checkbox-label input {
    margin-right: var(--spacing-xs);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px var(--spacing-lg);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 150, 136, 0.3);
}

.btn-submit {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    margin-top: var(--spacing-sm);
    transition: opacity 0.2s;
}

.btn-submit:hover {
    opacity: 0.9;
}

.btn-danger {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--gradient-danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    margin-top: var(--spacing-sm);
    transition: opacity 0.2s;
}

.btn-danger:hover {
    opacity: 0.9;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 12px var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-md);
}

.alert-error,
.error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error-border);
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.alert-info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid #bbdefb;
}

/* ============================================
   Items (Medication, Appointment, Event)
   ============================================ */
.medication-item,
.appointment-item,
.event-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-bg-hover);
}

.medication-item:last-child,
.appointment-item:last-child,
.event-item:last-child {
    border-bottom: none;
}

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-md);
    flex-shrink: 0;
}

.medication-icon {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.appointment-icon {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.event-icon {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.item-info {
    flex: 1;
}

.item-title {
    font-weight: 500;
    margin-bottom: 3px;
}

.item-details {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: 3px;
}

.item-time {
    font-size: var(--font-size-md);
    color: var(--color-primary-light);
    font-weight: 500;
    text-align: right;
    min-width: 60px;
}

/* Horarios pills */
.horarios-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.horario-pill {
    background: var(--color-success-bg);
    color: var(--color-success);
    padding: 3px 8px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.horario-pill.pasado {
    background: var(--color-bg);
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.evento-tipo {
    font-size: var(--font-size-xs);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    margin-left: var(--spacing-xs);
}

/* Past items */
.past-item {
    opacity: 0.7;
    background-color: var(--color-bg-hover);
}

.past-item .item-title,
.past-item .item-details,
.past-item .item-time {
    text-decoration: line-through;
    color: var(--color-text-muted) !important;
}

.past-item .item-icon {
    opacity: 0.5;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--spacing-lg) 0;
    color: var(--color-text-muted);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: var(--spacing-sm);
    display: block;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    width: 85%;
    max-width: 400px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-modal);
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
    gap: var(--spacing-sm);
}

.modal-btn {
    padding: 8px var(--spacing-md);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
}

.modal-btn.cancelar,
.modal-btn.cancel {
    background: var(--color-bg);
    color: var(--color-text-secondary);
}

.modal-btn.eliminar,
.modal-btn.confirm {
    background: var(--color-error);
    color: white;
}

/* ============================================
   Recordatorio Items
   ============================================ */
.recordatorio-item {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
    position: relative;
}

.recordatorio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.recordatorio-tipo {
    font-size: var(--font-size-xs);
    padding: 4px 8px;
    border-radius: 10px;
    color: white;
}

.tipo-cita { background: var(--color-info); }
.tipo-medicamento { background: var(--color-success); }
.tipo-evento { background: var(--color-warning); }

.recordatorio-acciones {
    display: flex;
}

.accion-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    margin-left: var(--spacing-sm);
    cursor: pointer;
    transition: transform 0.2s;
}

.accion-btn:hover {
    transform: scale(1.2);
}

.accion-btn.eliminar {
    color: var(--color-error);
}

.recordatorio-titulo {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-base);
}

.recordatorio-detalles {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    margin-bottom: 3px;
}

.recordatorio-fecha {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--spacing-sm);
}

/* ============================================
   Filters
   ============================================ */
.filters {
    display: flex;
    overflow-x: auto;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
    gap: var(--spacing-sm);
}

.filter-btn {
    padding: 8px var(--spacing-md);
    background: var(--color-bg-card);
    border: none;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-md);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    color: var(--color-text);
}

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

.filter-btn:hover:not(.active) {
    background: var(--color-bg-hover);
}

/* ============================================
   Tipo Selector (Agregar page)
   ============================================ */
.tipo-selector {
    display: flex;
    background: var(--color-bg-card);
    padding: var(--spacing-md);
    justify-content: space-around;
}

.tipo-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

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

/* ============================================
   Profile Card
   ============================================ */
.profile-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.profile-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-circle);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    color: white;
    font-size: 32px;
}

.profile-name {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-primary);
}

.profile-email {
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
}

/* ============================================
   Toggle Switch
   ============================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-right: var(--spacing-sm);
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: var(--radius-circle);
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.toggle-label {
    font-size: var(--font-size-md);
    color: var(--color-text-dark);
}

.preferencias-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border-light);
}

/* ============================================
   Password Toggle
   ============================================ */
.password-toggle {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: var(--spacing-md);
    top: 42px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
}

/* ============================================
   Notification Toast
   ============================================ */
.notification-toast {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    background: var(--color-bg-card);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-modal);
    max-width: 350px;
    z-index: var(--z-toast);
    display: flex;
    align-items: center;
    animation: slideIn 0.5s ease-out;
}

.notification-toast.evento {
    border-left-color: var(--color-warning);
}

.notification-toast.evento .notification-icon {
    color: var(--color-warning);
}

.notification-toast.cita {
    border-left-color: var(--color-info);
}

.notification-toast.cita .notification-icon {
    color: var(--color-info);
}

.notification-icon {
    font-size: 28px;
    margin-right: var(--spacing-md);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--color-primary);
    font-size: var(--font-size-base);
}

.notification-message {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.notification-time {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-top: var(--spacing-xs);
}

.notification-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: var(--color-text-muted);
    margin-left: var(--spacing-sm);
    padding: var(--spacing-xs);
    transition: color 0.2s;
}

.notification-close:hover {
    color: var(--color-error);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Notification Status Badge
   ============================================ */
.notification-status {
    position: fixed;
    top: 70px;
    right: var(--spacing-lg);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    z-index: var(--z-toast);
    display: none;
}

.notification-status.enabled {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.notification-status.disabled {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error-border);
}

/* ============================================
   Welcome Card (Dashboard)
   ============================================ */
.welcome-card {
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    z-index: 1;
}

.welcome-message {
    font-size: var(--font-size-lg);
    font-weight: 500;
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 2;
}

.welcome-message span {
    font-weight: 700;
}

/* ============================================
   Clock (Dashboard)
   ============================================ */
.clock-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

.clock {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-circle);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.clock::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: var(--radius-circle);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.hour-hand,
.minute-hand,
.second-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 4px;
}

.hour-hand {
    width: 4px;
    height: 30px;
    background: #fff;
    transform: translateX(-50%) rotate(0deg);
}

.minute-hand {
    width: 3px;
    height: 40px;
    background: #fff;
    transform: translateX(-50%) rotate(0deg);
}

.second-hand {
    width: 2px;
    height: 45px;
    background: #ff5252;
    transform: translateX(-50%) rotate(0deg);
}

.digital-time {
    text-align: center;
    margin: var(--spacing-md) auto 0 auto;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    display: table;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.clock-mark {
    position: absolute;
    width: 4px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
}

.clock-mark-3 {
    transform: translateY(-50%) rotate(90deg);
    top: 50%;
    right: 6px;
    left: auto;
}

.clock-mark-6 {
    transform: rotate(180deg);
    top: auto;
    bottom: 6px;
}

.clock-mark-9 {
    transform: translateY(-50%) rotate(270deg);
    top: 50%;
    left: 6px;
}

/* ============================================
   Calendar
   ============================================ */
.nav-calendario {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--color-bg-card);
}

.nav-btn {
    background: var(--color-bg);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--color-text);
}

.nav-btn:hover {
    background: var(--color-border);
}

.mes-ano {
    font-weight: 600;
    font-size: var(--font-size-base);
}

.calendario {
    background: var(--color-bg-card);
    padding: var(--spacing-md);
}

.dias-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
}

.dias-semana div {
    padding: var(--spacing-sm) 0;
}

.dias-mes {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-xs);
}

.dia {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 15%;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.dia:hover:not(.vacio) {
    background: var(--color-bg-hover);
}

.dia.vacio {
    background: transparent;
    cursor: default;
}

.dia.actual {
    background: var(--color-accent);
    color: white;
}

.dia.con-eventos {
    background: #e0f2f1;
    color: var(--color-primary);
    font-weight: 600;
}

.dia.selected {
    border: 2px solid var(--color-primary);
}

.numero-dia {
    font-size: var(--font-size-base);
    margin-bottom: 2px;
}

.puntos-eventos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}

.punto-evento {
    width: 5px;
    height: 5px;
    border-radius: var(--radius-circle);
}

.punto-evento.tipo-cita { background: var(--color-info); }
.punto-evento.tipo-medicamento { background: #39ed41; }
.punto-evento.tipo-evento { background: var(--color-warning); }

/* Calendar event detail panel */
.calendario-eventos-container {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
}

.eventos-dia {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--color-bg-card);
    border-radius: var(--radius-pill) var(--radius-pill) 0 0;
    padding: var(--spacing-lg);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.15);
    z-index: var(--z-modal);
    max-height: 80vh;
    overflow-y: auto;
}

.eventos-dia.mostrar {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.eventos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border-light);
}

.eventos-titulo {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--color-primary);
}

.cerrar-eventos {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: var(--color-text-secondary);
}

.evento-item-cal {
    padding: var(--spacing-md);
    border-radius: 10px;
    margin-bottom: var(--spacing-sm);
    background: var(--color-bg-hover);
}

.evento-tipo-cal {
    font-size: var(--font-size-xs);
    padding: 4px 8px;
    border-radius: 10px;
    color: white;
    display: inline-block;
    margin-bottom: 8px;
}

.evento-cita { background: var(--color-info); }
.evento-medicamento { background: var(--color-success); }
.evento-entretenimiento { background: var(--color-warning); }

.evento-titulo-cal {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.evento-detalle {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    margin-bottom: 3px;
}

.evento-hora {
    font-size: var(--font-size-md);
    color: var(--color-primary-light);
    font-weight: 500;
    margin-top: var(--spacing-xs);
}

/* Calendar overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-overlay);
}

.overlay.mostrar {
    display: block;
}

/* ============================================
   Login / Auth Pages
   ============================================ */
.login-body {
    background: var(--gradient-login-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.login-header h1 {
    font-size: var(--font-size-xxl);
    margin-bottom: var(--spacing-xs);
}

.login-header p {
    font-size: var(--font-size-md);
    opacity: 0.9;
}

.tab-container {
    display: flex;
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.tab {
    flex: 1;
    text-align: center;
    padding: var(--spacing-sm);
    cursor: pointer;
    color: var(--color-text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.tab.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

/* ============================================
   Toast Notification System
   ============================================ */
.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--color-bg-card);
    border-radius: var(--radius-sm);
    padding: 12px var(--spacing-md);
    box-shadow: var(--shadow-modal);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 280px;
    max-width: 380px;
    animation: slideIn 0.4s ease-out;
    border-left: 4px solid var(--color-primary);
}

.toast.toast-success { border-left-color: var(--color-success); }
.toast.toast-error { border-left-color: var(--color-error); }
.toast.toast-warning { border-left-color: var(--color-warning); }
.toast.toast-info { border-left-color: var(--color-info); }

.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-text { flex: 1; font-size: var(--font-size-md); }
.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0 2px;
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.toast.removing {
    animation: fadeOut 0.3s ease-in forwards;
}

/* ============================================
   Font Size Controls
   ============================================ */
.font-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.font-control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    transition: background 0.2s;
}

.font-control-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.font-control-btn.active {
    background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    border-radius: var(--radius-circle);
    transition: background 0.2s;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 480px) {
    .login-container {
        border-radius: 10px;
    }

    .login-header {
        padding: var(--spacing-lg) var(--spacing-md);
    }
}

/* ============================================
   Warning text (used in perfil danger zone)
   ============================================ */
.warning-text {
    color: var(--color-error);
    font-weight: 500;
    margin: var(--spacing-sm) 0;
}

/* ============================================
   Search Bar
   ============================================ */
.search-bar {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.search-bar input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    font-size: var(--font-size-md);
    background: var(--color-bg-card);
    color: var(--color-text);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-bar input:focus {
    border-color: var(--color-primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 16px;
}

/* ============================================
   Medication Compliance (Taken / Past / Pending)
   ============================================ */
.horarios-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.horario-pill {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-xs);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.horario-pill:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.horario-pill.pasado {
    background: var(--color-bg);
    color: var(--color-text-muted);
    border-color: var(--color-border);
    text-decoration: line-through;
    cursor: default;
}

.horario-pill.tomado {
    background: var(--color-success);
    color: white;
    border-color: var(--color-primary-dark);
}

.horario-pill.tomado::before {
    content: "✓";
    font-weight: bold;
}

/* ============================================
   Onboarding Overlay (Wizard / Guide)
   ============================================ */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.onboarding-card {
    background: var(--color-bg-card);
    width: 90%;
    max-width: 450px;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

.onboarding-slide {
    display: none;
}

.onboarding-slide.active {
    display: block;
}

.onboarding-image {
    font-size: 60px;
    margin-bottom: var(--spacing-md);
}

.onboarding-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.onboarding-desc {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: var(--spacing-lg);
}

.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
}

.onboarding-dot.active {
    background: var(--color-primary);
    width: 20px;
    border-radius: 4px;
}

.onboarding-buttons {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Estilos para marcar tomas en el calendario */
.evento-detalle-toma {
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    margin-top: var(--spacing-xs);
    border-radius: var(--radius-sm);
    background: var(--color-bg-hover);
    border-left: 4px solid var(--color-text-muted);
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.evento-detalle-toma:hover {
    background: var(--color-border-light);
}
.evento-detalle-toma.tomado {
    border-left-color: var(--color-success);
    background: var(--color-success-bg);
}
.evento-detalle-toma .estado-toma-badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--color-border);
}
.evento-detalle-toma.tomado .estado-toma-badge {
    color: var(--color-success);
    background: var(--color-success-border);
}


