/**
 * Estilos Front-end para Rentas Centro Holístico
 * v2.0.16 - Añade estilos para botones de Profile Builder
 */

/* --- INICIO v2.0.16: Estilos para botones de Profile Builder --- */
#wppb-submit,
/* Botón de Login */
.wppb-register-user input[type="submit"]

/* Botón de Registro */
    {
    background-color: var(--chr-primary-color, #ff8c00) !important;
    /* Naranja Kumara */
    color: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    padding: 12px 25px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    width: auto !important;
    /* Evitar que ocupen todo el ancho si no se desea */
    margin-top: 10px !important;
}

#wppb-submit:hover,
.wppb-register-user input[type="submit"]:hover {
    background-color: var(--chr-primary-color, #e67d00) !important;
    /* Naranja más oscuro */
}

/* --- FIN v2.0.16 --- */


/* --- INICIO v2.0.13: Ancho completo para Consultorios --- */
@media (min-width: 981px) {
    .single-consultorio #main-content .container {
        width: 100% !important;
        max-width: 1215px !important;
        /* El ancho que pediste */
    }

    .single-consultorio #left-area {
        width: 100% !important;
        padding: 0 !important;
        /* Quitar paddings extra si los hay */
    }

    .single-consultorio #sidebar {
        display: none !important;
    }
}

/* --- FIN v2.0.13 --- */


/* --- INICIO v2.0.12: Ocultar Título y Imagen Destacada por defecto --- */
.single-consultorio .entry-title,
.single-consultorio .et_post_meta_wrapper {
    display: none !important;
}

.single-consultorio .et_main_content_area>.et_featured_image {
    display: none !important;
}

/* --- Fin v2.0.12 --- */


/* --- Estilos Generales del Contenedor de la Aplicación --- */
#chr-booking-app {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 30px auto;
}

/* (Estilos del calendario, slots, etc. ... idénticos a la v2.0.14 ... ) */
/* ... */
.flatpickr-day.disabled,
.flatpickr-day.not-month {
    color: #ccc;
}

#chr-time-slots-container {
    margin-top: 20px;
    min-height: 60px;
    text-align: center;
}

.chr-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    justify-content: center;
    padding: 10px;
}

.chr-slot-button {
    border: 1px solid;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

.chr-slot-available {
    background-color: #e6f7e9;
    border-color: #b7e4c7;
    color: #2d6a4f;
}

.chr-slot-available:hover {
    background-color: #d8f3dc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.chr-slot-button.chr-slot-selected {
    background-color: var(--chr-primary-color, #ff8c00);
    /* Naranja Kumara */
    border-color: var(--chr-primary-color, #e67d00);
    /* Naranja Kumara más oscuro */
    color: #fff;
}

.chr-slot-occupied {
    background-color: #f0f0f0;
    /* Gris claro */
    color: #aaa;
    border-color: #ddd;
    cursor: not-allowed;
    text-decoration: line-through;
    /* Tachado */
}

#chr-selected-times {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

#chr-selected-times h4 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.chr-selected-slots-list {
    min-height: 40px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.chr-no-selection {
    color: #777;
    font-style: italic;
    width: 100%;
}

.chr-selected-tag {
    display: inline-block;
    background-color: #ffedd5;
    /* Naranja claro */
    color: #9a3412;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid #fed7aa;
}

/* --- (Estilo del Contenedor de Precio Total) --- */
#chr-total-price-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#chr-total-price-container h4 {
    font-size: 1.3em;
    font-weight: bold;
    color: #2d6a4f;
    /* Verde */
    margin: 0;
}

#chr-confirm-booking {
    background-color: var(--chr-primary-color, #ff8c00) !important;
    /* Naranja Kumara */
    color: #fff !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 5px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    margin-top: 15px !important;
}

#chr-confirm-booking:hover {
    background-color: var(--chr-primary-color, #e67d00) !important;
    /* Naranja más oscuro */
}

#chr-booking-message,
#chr-mi-cuenta-message {
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    word-break: break-word;
}

.chr-success {
    background-color: #e6ffe6;
    color: #28a745;
    border: 1px solid #c3e6cb;
}

.chr-error {
    background-color: #ffe6e6;
    color: #dc3545;
    border: 1px solid #f5c6cb;
}

/* Info message for edit mode */
.chr-info {
    background-color: #e6f7ff;
    color: #0056b3;
    border: 1px solid #bed4fa;
}

.chr-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--chr-primary-color, #ff8c00);
    /* Naranja Kumara */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.chr-login-message {
    padding: 20px;
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    border-radius: 5px;
    text-align: center;
    margin: 20px 0;
}

.chr-login-message a {
    color: #0056b3;
    text-decoration: underline;
}

.chr-login-message a:hover {
    color: #003d80;
}

/* --- Estilos para Mi Cuenta --- */
.chr-mi-cuenta-container {
    max-width: 900px;
    margin: 30px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chr-user-welcome-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.chr-user-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.chr-user-welcome-box h3 {
    margin: 0;
    font-size: 22px;
    color: #333;
}

.chr-logout-link {
    font-size: 14px;
    color: #dc3545;
    text-decoration: none;
    font-weight: bold;
}

.chr-logout-link:hover {
    text-decoration: underline;
}

.chr-user-details p {
    margin: 5px 0;
    color: #555;
    font-size: 15px;
}

.chr-user-details p strong {
    color: #333;
}

.chr-rentas-header {
    font-size: 20px;
    color: #333;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.chr-rentas-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.chr-rentas-table th,
.chr-rentas-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.chr-rentas-table th {
    background-color: #f8f8f8;
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
}

.chr-rentas-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.chr-rentas-table tbody tr:hover {
    background-color: #f1f1f1;
}

.chr-renta-status-confirmada .chr-renta-status {
    color: #28a745;
    font-weight: bold;
}

.chr-renta-status-pendiente .chr-renta-status {
    color: #ffc107;
    font-weight: bold;
}

.chr-renta-status-cancelada .chr-renta-status {
    color: #dc3545;
    font-weight: bold;
    text-decoration: line-through;
}

.chr-column-total {
    font-weight: bold;
    color: #2d6a4f;
}

.chr-renta-accion {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chr-renta-accion .et_pb_button {
    padding: 8px 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border-radius: 5px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    text-decoration: none !important;
    color: #fff !important;
    text-align: center;
}

.chr-edit-button {
    background-color: var(--chr-primary-color, #ff8c00) !important;
    border-color: var(--chr-primary-color, #ff8c00) !important;
}

.chr-edit-button:hover {
    background-color: var(--chr-primary-color, #e67d00) !important;
}

.chr-cancel-button {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.chr-cancel-button:hover {
    background-color: #c82333 !important;
}

.chr-cancel-button:disabled {
    background-color: #e0e0e0 !important;
    cursor: not-allowed !important;
}

.chr-24h-notice {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.chr-view-account-button {
    background-color: var(--chr-primary-color, #ff8c00) !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 25px !important;
    border-radius: 5px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    margin-top: 10px !important;
    display: inline-block;
    text-decoration: none !important;
}

.chr-view-account-button:hover {
    background-color: var(--chr-primary-color, #e67d00) !important;
}

/* --- Inline Auth Forms (Phase 4) --- */
#chr-auth-container {
    background-color: #fcfcfc;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
}

#chr-auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.chr-auth-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #777;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.chr-auth-tab:hover {
    color: var(--chr-primary-color, #ff8c00);
}

.chr-auth-tab.active {
    color: var(--chr-primary-color, #ff8c00);
    border-bottom-color: var(--chr-primary-color, #ff8c00);
}

.chr-auth-form-container h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.chr-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.chr-form-row input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    width: 100%;
}

.chr-form-row input:focus {
    border-color: var(--chr-primary-color, #ff8c00);
    outline: none;
    box-shadow: 0 0 5px rgba(255, 140, 0, 0.3);
}

#chr-submit-register-booking,
#chr-submit-login-booking {
    width: 100%;
    margin-top: 10px;
    background-color: var(--chr-primary-color, #ff8c00) !important;
    color: #fff !important;
    border: none !important;
    padding: 12px !important;
    border-radius: 5px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

#chr-submit-register-booking:hover,
#chr-submit-login-booking:hover {
    background-color: var(--chr-primary-color, #e67d00) !important;
}

@media (max-width: 600px) {
    .chr-form-row {
        flex-direction: column;
        gap: 10px;
    }
}

/* --- Media Queries para Responsividad --- */
@media (max-width: 768px) {

    #chr-booking-app,
    .chr-mi-cuenta-container {
        padding: 15px;
        margin: 15px auto;
    }

    .chr-calendar-title {
        font-size: 20px;
    }

    .flatpickr-day {
        font-size: 12px;
        line-height: 30px;
        height: 30px;
    }

    .chr-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .chr-slot-button {
        padding: 8px 10px;
        font-size: 14px;
    }

    #chr-selected-times h4 {
        font-size: 18px;
    }

    .chr-user-info-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chr-logout-link {
        margin-top: 10px;
    }

    .chr-rentas-table thead {
        display: none;
    }

    .chr-rentas-table,
    .chr-rentas-table tbody,
    .chr-rentas-table tr,
    .chr-rentas-table td {
        display: block;
        width: 100%;
    }

    .chr-rentas-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }

    .chr-rentas-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .chr-rentas-table td:last-child {
        border-bottom: 0;
    }

    .chr-rentas-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
    }

    /* --- INICIO v2.0.14: Actualizar data-labels responsivos --- */
    /* SE COMENTAN ESTAS REGLAS PORQUE ENTRAN EN CONFLICTO CON LA TABLA DE CLIENTES */
    /* SE DEBE USAR attr(data-label) COMO ESTÁ DEFINIDO ARRIBA */
    .chr-rentas-table td:nth-of-type(1)::before {
        /* content: "Consultorio"; */
    }

    .chr-rentas-table td:nth-of-type(2)::before {
        /* content: "Fecha"; */
    }

    .chr-rentas-table td:nth-of-type(3)::before {
        /* content: "Horario"; */
    }

    .chr-rentas-table td:nth-of-type(4)::before {
        /* content: "Total"; */
    }

    .chr-rentas-table td:nth-of-type(5)::before {
        /* content: "Estado"; */
    }

    .chr-rentas-table td:nth-of-type(6)::before {
        /* content: "Acción"; */
    }

    /* Para la tabla de historial (que tiene una columna menos) */
    .chr-rentas-header+.chr-rentas-table td:nth-of-type(4)::before {
        /* content: "Total"; */
    }

    .chr-rentas-header+.chr-rentas-table td:nth-of-type(5)::before {
        /* content: "Estado"; */
    }

    /* --- FIN v2.0.14 --- */

    .chr-renta-accion {
        justify-content: flex-end;
    }

    .chr-renta-accion .et_pb_button {
        width: 100%;
    }
}

@media (max-width: 400px) {
    #chr-booking-app {
        padding: 10px;
    }

    .flatpickr-calendar {
        font-size: 0.9rem;
    }

    .flatpickr-day {
        line-height: 32px;
        height: 32px;
        font-size: 11px;
    }

    .chr-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 5px;
    }

    .chr-slot-button {
        padding: 8px 5px;
        font-size: 12px;
    }

    .chr-calendar-title {
        font-size: 18px;
    }

    #chr-selected-times h4 {
        font-size: 16px;
    }

    .chr-view-account-button,
    #chr-confirm-booking {
        padding: 10px 20px !important;
        font-size: 16px !important;
    }
}