/**
 * Estilos DataFit - Glassmorphism & Soft UI (CoachPro Style)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-sidebar: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-sidebar-hover: rgba(255, 255, 255, 0.1);
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-light: #a0aec0;
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.08);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    --gradient-info: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    --gradient-warning: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    --gradient-danger: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a:hover{
    text-decoration: none;
    color: white;
}
/* Layout Principal */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

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

.sidebar-brand i {
    font-size: 2rem;
}

.sidebar-nav {
    padding: 1.5rem 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

.sidebar-nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: white;
    padding-left: 2rem;
}

.sidebar-nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.sidebar-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: white;
    border-radius: 0 4px 4px 0;
}

.sidebar-nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Contenido Principal */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Botones */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    font-family: 'Inter', sans-serif;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

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

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

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

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

.btn-outline-primary {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Inputs */
.form-control {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    color: #2d3748 !important;
    font-weight: 400;
}

.form-control:focus {
    background: white !important;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    color: #2d3748 !important;
}

.form-control::placeholder {
    color: var(--text-light);
}

/* Estilos para FullCalendar */
#calendarContainer {
    border-radius: 20px;
    overflow: hidden;
}

.fc {
    font-family: 'Inter', 'Segoe UI', sans-serif !important;
}

.fc-header-toolbar {
    padding: 1rem;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.fc-toolbar-chunk {
    display: flex;
    gap: 8px;
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}

.fc-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    margin-right: 8px !important;
}

.fc-button:last-child {
    margin-right: 0 !important;
}

.fc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.fc-button:active {
    transform: translateY(0);
}

.fc-button-primary:not(:disabled):active,
.fc-button-primary:not(:disabled).fc-button-active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

.fc-daygrid-day {
    border-radius: 12px;
    margin: 2px;
    cursor: pointer;
}

.fc-day-today {
    background: rgba(102, 126, 234, 0.1) !important;
}

.fc-event {
    border-radius: 8px !important;
    border: none !important;
    padding: 4px 8px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fc-event:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.fc-daygrid-event {
    margin: 2px 0 !important;
}

/* Selects normales - asegurar visibilidad del texto seleccionado */
select,
select.form-control,
select.form-control-sm {
    /* Dejar que el navegador use sus estilos por defecto */
    appearance: auto !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    /* Asegurar que el texto seleccionado sea visible */
    color: #000000 !important;
    background-color: #ffffff !important;
    /* Forzar color del texto incluso cuando está seleccionado */
    -webkit-text-fill-color: #000000 !important;
    /* Altura para que el texto sea visible */
    height: 50px !important;
    min-height: 38px !important;
}
/* 
select.form-control-sm {
    height: 31px !important;
    min-height: 31px !important;
} */

/* Asegurar que el texto seleccionado sea visible en todos los estados */
select:focus,
select.form-control:focus,
select.form-control-sm:focus {
    color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
}

select option {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* Cuando una opción está seleccionada */
select option:checked,
select option[selected] {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* Tablas */
.table {
    background: transparent;
    color: var(--text-primary);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.75rem;
}

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

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

.badge-info {
    background: var(--gradient-info);
    color: white;
}

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

/* Modales */
.modal-content {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* Navbar (si se necesita) */
.navbar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

/* Títulos */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Utilidades */
.text-muted {
    color: var(--text-secondary) !important;
}

.bg-light {
    background: var(--bg-primary) !important;
}

/* Grupos de botones */
.btn-group .btn {
    margin: 0;
}

/* Input groups */
.input-group .form-control {
    border-right: none;
}

.input-group-append .btn {
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-prepend .btn {
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Toast */
.toast {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
}

.toast-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

/* Heatmap */
.heatmap-container {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius-md);
}

/* Tabla de Medidas Mejorada */
.table-measures {
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.table-measures table {
    margin-bottom: 0;
    background: transparent;
}

.table-measures thead th {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-measures tbody tr {
    transition: all 0.2s ease;
}

.table-measures tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(2px);
}

.table-measures tbody td {
    border: none;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Estilos para Sidebar - Hábitos y Alertas */
.sidebar-habits,
.sidebar-alerts {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1rem;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #c7d2fe;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.sidebar-habit-btn {
    width: 100%;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    backdrop-filter: blur(5px);
}

.sidebar-habit-btn:hover {
    background: rgba(102, 126, 234, 0.35);
    border-color: rgba(199, 210, 254, 0.6);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sidebar-habit-btn i {
    font-size: 1.1rem;
    color: #c7d2fe;
    width: 20px;
    text-align: center;
}

.alert-toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    width: 100%;
}

.alert-toggle-label input[type="checkbox"] {
    display: none;
}

.alert-toggle-slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.alert-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.alert-toggle-label input[type="checkbox"]:checked + .alert-toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #c7d2fe;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
}

.alert-toggle-label input[type="checkbox"]:checked + .alert-toggle-slider::before {
    transform: translateX(24px);
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.alert-toggle-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    flex: 1;
}

.btn-probar-sonido {
    width: 100%;
    padding: 0.625rem;
    margin-top: 0.75rem;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 12px;
    color: #c7d2fe;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    backdrop-filter: blur(5px);
}

.btn-probar-sonido:hover {
    background: rgba(102, 126, 234, 0.35);
    border-color: rgba(199, 210, 254, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: #ffffff;
}

.btn-probar-sonido i {
    font-size: 0.9rem;
}

/* Indicador de Estado del Audio Context */
.audio-context-status {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.audio-context-status:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.audio-context-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.audio-context-indicator.active {
    background: #48bb78;
    box-shadow: 0 0 12px rgba(72, 187, 120, 0.8);
}

.audio-context-indicator.inactive {
    background: #f56565;
    box-shadow: 0 0 8px rgba(245, 101, 101, 0.6);
}

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

/* Cronómetro de Descanso */
.cronometro-descanso-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    min-width: 250px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.cronometro-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.cronometro-header i {
    color: #667eea;
}

.cronometro-tiempo {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: #667eea;
    margin: 1rem 0;
    font-family: 'Inter', 'Segoe UI', monospace;
}

.cronometro-controles {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-cronometro {
    padding: 0.5rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    color: #667eea;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-cronometro:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.btn-cronometro.btn-saltar {
    background: rgba(108, 117, 125, 0.1);
    border-color: rgba(108, 117, 125, 0.3);
    color: #6c757d;
}

.btn-cronometro.btn-saltar:hover {
    background: rgba(108, 117, 125, 0.2);
}

.cronometro-finalizado {
    animation: parpadeoPúrpura 0.5s infinite;
}

@keyframes parpadeoPúrpura {
    0%, 100% {
        background: rgba(255, 255, 255, 0.95);
        border-color: rgba(102, 126, 234, 0.2);
    }
    50% {
        background: rgba(102, 126, 234, 0.3);
        border-color: #667eea;
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
}

/* Reloj en Tiempo Real - Sidebar */
.sidebar-clock {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    margin: 1rem 0;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.clock-display {
    text-align: center;
    margin-bottom: 1rem;
}

.clock-display #hora {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Inter', 'Segoe UI', monospace;
    color: #ffffff;
    letter-spacing: 3px;
    display: block;
    text-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.clock-next-alarm {
    text-align: left;
    font-size: 0.8rem;
    color: #e0e7ff;
    display: block;
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.25);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.4);
    backdrop-filter: blur(5px);
}

.clock-next-alarm i {
    color: #c7d2fe;
    font-size: 0.9rem;
}

.clock-next-alarm #textoProximaAlarma {
    font-weight: 500;
    line-height: 1.5;
    font-size: 0.85rem;
    color: #e0e7ff;
}

.clock-next-alarm #textoProximaAlarma div {
    font-size: 0.8rem;
}

.clock-next-alarm #textoProximaAlarma i {
    font-size: 0.9rem;
    margin-right: 0.25rem;
}

.btn-probar-alarma {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.75rem;
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    color: #ffc107;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    backdrop-filter: blur(5px);
}

.btn-probar-alarma:hover {
    background: rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.btn-probar-alarma i {
    font-size: 0.9rem;
}
