/* --- CLIENT STYLES v19.5 --- */
.days-row { display: flex; justify-content: center; gap: 12px; margin: 1.5rem 0; flex-wrap: wrap; }
.day-selector { position: relative; }
.day-selector input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.day-selector label {
    display: flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; background: white; border: 2px solid #e2e8f0;
    border-radius: 50%; font-weight: 900; font-size: 0.8rem; cursor: pointer;
    transition: var(--transition); color: var(--text-muted);
}
.day-selector input:checked + label {
    background: var(--primary); border-color: var(--primary);
    color: #2d2600; transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 204, 2, 0.3);
}

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.8rem; width: 100%; margin-top: 1rem; }
.calendar-day {
    background: white; border-radius: var(--radius); padding: 1.2rem;
    min-height: 160px; border: 1px solid #f1f5f9;
    transition: var(--transition); display: flex; flex-direction: column;
}

.ex-pill {
    background: #f8fafc; padding: 0.7rem; border-radius: 0.8rem;
    font-size: 0.75rem; font-weight: 800; margin-bottom: 0.5rem;
    cursor: pointer; border-left: 4px solid var(--primary);
    transition: var(--transition); word-break: break-word; line-height: 1.3;
}
.ex-pill:hover { transform: translateX(3px); background: #fff; box-shadow: var(--shadow); }

/* MEJORA: Ejercicio completado sin tachado molesto */
.ex-pill.completed { 
    border: 2px solid #10b981;
    border-left-width: 6px;
    background: #f0fdf4;
    color: #065f46;
    opacity: 0.9;
    text-decoration: none; /* QUITA LAS ?? Y EL TACHADO */
}

.health-visual-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.health-meter-box { background: white; padding: 1.5rem; border-radius: var(--radius); border: 1px solid #f1f5f9; }
.meter-track { height: 12px; background: #f1f5f9; border-radius: 10px; overflow: hidden; margin-top: 0.8rem; }
.meter-fill { height: 100%; border-radius: 10px; transition: width 1s ease-in-out; }

/* ===== RESPONSIVE CALENDAR ===== */
@media (max-width: 900px) {
    .calendar-grid { 
        grid-template-columns: 1fr; 
        gap: 0.6rem;
    }
    .calendar-day { 
        min-height: auto; 
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    /* Días de la semana */
    .days-row {
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .day-selector label {
        width: 40px;
        height: 40px;
        font-size: 0.7rem;
    }
    
    /* Grid del calendario */
    .calendar-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .calendar-day {
        padding: 10px;
        min-height: auto;
    }
    
    .day-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.6rem;
    }
    
    .day-name {
        font-size: 0.75rem;
        font-weight: 800;
    }
    
    .day-number {
        font-size: 1.1rem;
        font-weight: 900;
    }
    
    /* Pills de ejercicios */
    .ex-pill {
        font-size: 0.7rem;
        padding: 0.6rem;
        margin-bottom: 0.4rem;
        line-height: 1.2;
    }
    
    .ex-pill.completed {
        font-size: 0.7rem;
    }
    
    /* Meter boxes de salud */
    .health-meter-box {
        padding: 1rem;
    }
    
    .meter-track {
        height: 10px;
    }
}

@media (max-width: 480px) {
    .days-row {
        gap: 6px;
    }
    
    .day-selector label {
        width: 35px;
        height: 35px;
        font-size: 0.65rem;
    }
    
    .calendar-day {
        padding: 8px;
        font-size: 0.65rem;
    }
    
    .ex-pill {
        font-size: 0.65rem;
        padding: 0.5rem;
    }
}

/* ===== BUG FIX #1: Botones en apuntes siempre visibles ===== */
.notes-exercise-card .btn,
.modal-content .btn {
    color: #000 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.notes-exercise-card .btn-primary,
.modal-content .btn-primary {
    background: var(--primary) !important;
    color: #000 !important;
}

.notes-exercise-card .btn-outline,
.modal-content .btn-outline {
    background: #ffffff !important;
    color: var(--text) !important;
    border: 2px solid #f1f5f9 !important;
}

/* ===== BUG FIX #2: Modal de consulta centrado correctamente ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    position: relative;
    margin: auto;
    transform: none;
}

/* ===== FORMULARIO DE CONSULTA - ESTILOS MEJORADOS ===== */

.consultation-modal {
    max-width: 550px;
    width: 90%;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    overflow: hidden;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.modal-header .btn-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
}

.modal-header .btn-close:hover {
    background: #e0e0e0;
    color: #333;
}

.modal-body {
    padding: 25px;
}

.consultation-form {
    padding: 25px !important;
}

.consultation-form .form-group {
    margin-bottom: 20px;
}

.consultation-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 15px;
}

.consultation-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.consultation-form textarea:focus {
    outline: none;
    border-color: #ffcc02;
    box-shadow: 0 0 0 4px rgba(255, 204, 2, 0.15);
}

.consultation-form textarea::placeholder {
    color: #999;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.form-actions .btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.form-actions .btn-primary {
    background: #ffcc02 !important;
    border: none;
    color: #000 !important;
}

.form-actions .btn-primary:hover {
    background: #e6b800 !important;
    transform: translateY(-2px);
}

.form-actions .btn-outline {
    background: #fff !important;
    border: 2px solid #ddd;
    color: #666 !important;
}

.form-actions .btn-outline:hover {
    border-color: #ccc;
    background: #f5f5f5 !important;
}

/* ===== ESTILOS GENERALES DE FORMULARIOS ===== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #ffcc02;
    box-shadow: 0 0 0 3px rgba(255, 204, 2, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* ===== BUG FIX #4: Ocultar sección Propuesta de Evolución ===== */
#health-request-form {
    display: none !important;
}

.evolution-proposal-section {
    display: none !important;
}

/* ===== MEJORAS UI v2.0 - Estado de ejercicios más claro ===== */

/* Tarjetas de ejercicio con estado */
.notes-exercise-card {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}

.notes-exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.notes-exercise-card.exercise-completed {
    background: #f0fdf4;
}

.notes-exercise-card.exercise-pending {
    background: #fffbeb;
}

.notes-exercise-card.exercise-in-progress {
    background: #eef2ff;
}

/* Badge de estado */
.exercise-status-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Estadísticas mejoradas */
.stats-grid-improved {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-success {
    border-left-color: #10b981;
}

.stat-warning {
    border-left-color: #f59e0b;
}

.stat-danger {
    border-left-color: #ef4444;
}

.stat-info-color {
    border-left-color: #3b82f6;
}

/* Barra de progreso grande */
.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffcc02, #f59e0b);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: #000;
    font-weight: bold;
    font-size: 0.8rem;
    border-radius: 15px;
}

/* Botón de éxito sólido */
.btn-success-solid {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: white !important;
}

.btn-success-solid:hover {
    background: #059669 !important;
    border-color: #059669 !important;
}

/* Responsive para las mejoras */
@media (max-width: 768px) {
    .stats-grid-improved {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .exercise-status-badge {
        font-size: 0.6rem !important;
        padding: 0.4rem 0.8rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid-improved {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        text-align: left;
    }
}


/* ===== GESTIÓN DE SUSCRIPCIONES ===== */

.subscription-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.subscription-alert h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 800;
}

.subscription-alert p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
}

.subscription-alert.alert-warning {
    background: #fff3cd;
    border-left-color: #ff9800;
    color: #856404;
}

.subscription-alert.alert-danger {
    background: #f8d7da;
    border-left-color: #dc2626;
    color: #721c24;
}

.subscription-management-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.subscription-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subscription-actions-grid button {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
}

.btn-warning {
    background: #ff9800 !important;
    color: white !important;
    border: none !important;
}

.btn-warning:hover {
    background: #f57c00 !important;
}

.btn-danger {
    background: #dc2626 !important;
    color: white !important;
    border: none !important;
}

.btn-danger:hover {
    background: #b91c1c !important;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Modal de acceso denegado */
.access-denied-modal .card {
    animation: slideIn 0.3s ease;
}

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

/* Responsive para gestión de suscripciones */
@media (max-width: 768px) {
    .subscription-alert {
        padding: 0.8rem;
    }
    
    .subscription-alert h4 {
        font-size: 0.9rem;
    }
    
    .subscription-alert p {
        font-size: 0.85rem;
    }
    
    .subscription-management-box {
        padding: 0.8rem;
    }
    
    .subscription-actions-grid button {
        padding: 0.7rem;
        font-size: 0.75rem;
    }
}



/* ============================================
   PROFILE FIXES - Subscription Card Visibility
   ============================================ */

/* Ensure subscription card buttons and text are visible */
.subscription-card {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%) !important;
    color: white !important;
}

.subscription-card h3,
.subscription-card h4,
.subscription-card .badge {
    color: white !important;
}

.subscription-card .sub-info p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.subscription-card .sub-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subscription-card .sub-actions button,
.subscription-card .sub-actions a {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    text-align: center !important;
}

.subscription-card .sub-actions button:hover,
.subscription-card .sub-actions a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}

/* Payment History Table Styles */
.payments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.payments-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.payments-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #666;
}

.payments-table tr:hover {
    background: #f8f9fa;
}

/* Payment Status Badges */
.badge-completed {
    background: #4caf50;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.badge-pending {
    background: #ff9800;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.badge-failed {
    background: #e74c3c;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

/* Support Contact Section */
.support-section,
.contact-support {
    text-align: center !important;
    padding: 20px;
}

.support-section h4,
.contact-support h4 {
    text-align: center !important;
    color: white !important;
}

.support-section p,
.contact-support p {
    text-align: center !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.support-section button,
.support-section a,
.contact-support button,
.contact-support a {
    margin: 0 auto;
    display: block;
    text-decoration: none;
}



/* ===== BANNER DE COOKIES ===== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 4px solid #ffcc02;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.cookie-banner-text h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.cookie-banner-text a {
    color: #ffcc02;
    text-decoration: underline;
    font-weight: bold;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-banner-buttons button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-accept-all {
    background: #ffcc02;
    color: #333;
}

.btn-accept-all:hover {
    background: #e6b800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 204, 2, 0.3);
}

.btn-accept-necessary {
    background: #f0f0f0;
    color: #333;
}

.btn-accept-necessary:hover {
    background: #e0e0e0;
}

.btn-configure {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
}

.btn-configure:hover {
    border-color: #ffcc02;
    color: #333;
}

/* ===== MODAL DE CONFIGURACIÓN ===== */

.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
}

.cookie-modal-overlay.show {
    opacity: 1;
}

.cookie-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cookie-modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 {
    margin: 0;
    font-size: 22px;
    color: #333;
}

.cookie-modal-header .btn-close {
    background: #f0f0f0;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.cookie-modal-header .btn-close:hover {
    background: #e74c3c;
    color: white;
    transform: rotate(90deg);
}

.cookie-modal-body {
    padding: 30px;
}

.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #ffcc02;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cookie-category h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.cookie-category p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.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: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4caf50;
}

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

.switch.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.switch.disabled .slider {
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-modal-footer button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save {
    background: #4caf50;
    color: white;
}

.btn-save:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .cookie-banner-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-banner-buttons button {
        width: 100%;
    }
    
    .cookie-modal-content {
        margin: 10px;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 20px;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-modal-footer button {
        width: 100%;
    }
}
