:root {
    --primary-color: #103663;
    --secondary-color: #A30064;
    --blue: #3BA2FF;
    --light-blue: #00CEBE;
    --gray: #8E8E8E;
    --light-gray: #EEE5FF;
    --red: #DE0D35;
    --text-color: #333;
    --background-color: #fcfcfc;
    --light-bg: #FAF7FF;
    --border-color: #C3C3C3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.45s;
}

html,
body {
    height: 100vh;
    width: 100vw;
    font-family: "Roboto";
    background-color: var(--background-color);
    color: #333;
    overflow: hidden;
    font-size: 16px;
}

.dataTables_wrapper {
    padding: 0 .9rem;
    overflow-x: auto;

    thead th.table-active {
        display: table-cell !important;
        /* Anular el display: flex */
        text-align: center !important;
        /* Forzar centrado */
        flex-direction: row !important;
        /* Remover flexbox */
        align-items: normal !important;
        /* Remover flexbox */
    }

    .dataTables_length {
        height: 100%;
        align-self: center;
        display: flex;
        flex-wrap: wrap;
        align-content: center;
    }

    .dataTables_paginate {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
    }

    .dataTables_paginate .pagination {
        margin: 0 !important;
        padding: 0 !important;
    }

    .dataTables_paginate .paginate_button,
    .dataTables_paginate .page-item,
    .dataTables_paginate .page-link {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        margin: 0 !important;
        color: #007bff;
    }

    .dataTables_paginate .page-item.active .page-link {
        background: #E5EFFC !important;
        color: #8E8E8E !important;
        border-radius: 12px;
        font-weight: 600;
    }

    /* Desactivar estilos en botones deshabilitados */
    .dataTables_paginate .page-item.disabled .page-link {
        color: #999 !important;
        cursor: default;
    }
}

.table-rounded {
    font-size: .9rem;
    width: 100%;
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden;
    margin: 0 auto;
    clear: both;

    thead th {
        position: sticky;
        top: 0;
        z-index: 999;
        padding: .5rem 0rem;
        background-color: #EDE6FC !important;
        color: #103663 !important;
        border: none !important;
    }

    .table-rounded th.sorting_asc {
        text-align: center !important;
    }

    th,
    td {
        text-align: center !important;
        padding: .3rem;
        color: #103663 !important;
        border-color: #A382D1 !important;
        border-bottom: none !important;
    }

    /* Filas impares */
    tbody tr:nth-child(odd) {
        background-color: #F9F7FD;

        box-shadow: none !important;
    }

    /* Filas pares */
    tbody tr:nth-child(even) {
        background-color: #ffff;
    }

    /* Hover */
    tbody tr:hover {
        background-color: #eef4ff !important;
    }

    .table-active {
        text-align: center !important;
        display: flex;
        flex-direction: row;
        align-items: center;
        font-size: 1rem;
        color: var(--primary-color);
        font-weight: 600;
    }

    .table-icon {
        height: 40px;
        width: 40px;
        font-size: 1rem;
        color: #fff;
        margin: 0px 1rem;
        align-content: center;
        background-color: var(--primary-color);
        border-radius: 12px;
    }

    .table-icon.rd {
        background-color: var(--secondary-color);
    }

    .table-icon.hscms {
        background-color: #0dcaf0;
    }

    /* Filas impares */
    .odd .table-active {
        background-color: #dbd5fc !important;
        box-shadow: none !important;
    }

    /* Filas pares */
    .even .table-active {
        background-color: #EDE6FC !important;
    }

}

tbody tr:hover {
    background-color: #eef4ff !important;
}

table.dataTable.table-striped>tbody>tr:nth-of-type(2n+1)>* {
    box-shadow: none !important;
}

.paquete-action {
    max-width: 130px;
}

#detallesTable {

    tbody,
    td,
    tfoot,
    th,
    thead,
    tr {
        border-color: inherit;
        border-style: solid;
        border-width: 0;
    }

    .form-control:disabled {
        background-color: rgba(205, 205, 205, 0.15) !important;
        opacity: 1;
    }
}

.tipo-cell,
.cantidad-cell {
    max-width: 55px;
    width: fit-content;

    input {
        width: 100%;
    }
}

.swal2-popup .select2-container {
    width: 100% !important;
}

.select2-results__option {
    display: flex;
    align-items: center;
}

.select2-results__option i {
    margin-right: 8px;
}

.select2-container--default .select2-selection--single {
    height: 40px;
    padding: 6px 12px;
    font-size: 1ren;
}

.paquete-input {
    width: 100% !important;
    padding: 15px !important;
    font-size: 1rem !important;
    margin-bottom: 1rem !important;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 0 !important;
    color: var(--primary-color);
    font-weight: 600;
    width: fit-content;
}

.section-header {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.swal2-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: .75rem;
}

.swal2-confirm {
    background-color: var(--blue) !important;
}

.swal2-cancel {
    background-color: var(--red) !important;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Estilos del header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    height: calc(50px + 45px);
    width: 100%;
    z-index: 1000;
    align-items: center;

    .top-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 50px;
        padding: 5px 20px;
        background-color: var(--secondary-color);

        .account-action {
            display: flex;
            flex-direction: row;
            align-items: center;
            color: #FFF;
            font-weight: 600;
            gap: 1rem;
        }

        .icon-white2 {
            color: #FFF;
            font-size: 1.6rem;
        }

        .dropdown-toggle::after {
            color: #FFF;
            font-size: 1.3rem;
            margin: 0;
        }

        .dropdown-item {
            font-size: .9rem;
        }
    }

    .nav-header {
        display: flex;
        height: 45px;
        background-color: var(--primary-color);
        justify-content: center;

        .nav {
            gap: 1.5rem;
            align-items: center;
        }

        .nav-link {
            text-transform: uppercase;
            display: flex;
            font-size: .9rem;
            font-weight: 500;
            padding: 8px 12px;
            color: var(--blue) !important;
        }

        .nav-item {
            position: relative;
        }

        .nav-item:hover>.nav-link {
            font-size: 1rem;
        }

        .nav-item.active>.nav-link {
            color: #FFFF !important;
            font-size: 1.1rem;
        }

        .dropdown-menu {
            top: 100% !important;
            left: 0 !important;
            inset: unset !important;
            transform: none !important;
            min-width: 298px !important;
        }

        .dropdown-col {
            display: flex;
            flex: 33%;
            flex-direction: column;
            color: #333;
        }

        .dropdown-item {
            text-transform: uppercase;
            font-weight: 500;
        }

        .dropdown-item:hover {
            font-size: 1rem;
            font-weight: 500;
        }
    }
}

/* Estilos del main*/
.main {
    position: relative;
    margin-top: calc(50px + 45px);
    height: calc(100vh - (50px + 45px));
    overflow-y: auto;
    overflow-x: hidden;

    .content {
        padding: 1.2rem 2rem;
        min-height: 83vh;
    }
}


/* Estilos del footer */
footer {
    width: 100%;

    .footer-bar {
        background-color: var(--blue);
        padding: .5rem 0;
        text-align: center;
        color: #fff;

        h4 {
            font-size: 1.2rem;
            margin-bottom: 0 !important;
        }
    }

    .footer-container {
        padding: 1.4rem 3rem 3.5rem 3rem;
        color: #FFF;
        background-color: var(--primary-color);
        justify-content: center;
        align-content: center;

        .col-md-4 {
            display: flex;
            justify-content: center;
        }

        .logo-footer {
            object-fit: contain;
            height: 60px;
            justify-self: center;
            text-align: center;

        }

        .footer-icons {
            display: flex;
            flex-direction: column;
            text-align: center;
            line-height: normal;
        }

        .footer-item i {
            font-size: 1.3rem;
        }

        .footer-details {
            display: flex;
            flex-direction: column;
            line-height: calc(1.4rem + 10px);
        }

        .footer-details p {
            font-size: 1.1rem;
            margin-bottom: 0 !important;
        }

        .footer-olas {
            object-fit: contain;
            margin-top: 2rem;
            width: 80%;
            display: flex;
            justify-self: center;
        }

        .col-md-7 {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-content: center;
        }
    }
}


/* Estilos custom */
button {
    color: #fff !important;
    font-size: .625rem;
    border: none;
    border-radius: 12px;
}

.btn {
    font-weight: 600;
    color: #fff !important;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: .9rem;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    width: fit-content;
}

.btn:hover {
    background-color: var(--btn-bg-color, #666) !important;
    filter: brightness(0.9) contrast(0.8);
    transform: scale(1.015);
}

.btn:disabled {
    background-color: var(--btn-bg-color, #666) !important;
    filter: brightness(0.8) opacity(0.8) !important;
}

.btn-primary {
    --btn-bg-color: var(--light-blue);
    background-color: var(--btn-bg-color);
    color: #fff;
}

.btn-danger {
    --btn-bg-color: #dc3545;
    background-color: var(--btn-bg-color);
    color: #fff;
}

.btn-secondary {
    --btn-bg-color: var(--gray);
    background-color: var(--btn-bg-color);
    color: #fff;
}

.btn-confirmar {
    --btn-bg-color: var(--blue);
    background-color: var(--btn-bg-color);
    color: #fff;
}

.btn-paquetes {
    --btn-bg-color: var(--light-blue);
    background-color: var(--btn-bg-color);
}

.btn-agregar {
    --btn-bg-color: var(--light-blue);
    background-color: var(--btn-bg-color);
    font-weight: 500;
}

.btn-auth {
    --btn-bg-color: var(--primary-color);
    background-color: var(--btn-bg-color);
    width: 80%;
    margin: 5% 10% 0 10%;
    padding: 0.75rem;
    color: white;
}

input {
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    font-size: .75rem;
    color: var(--primary-color) !important;
}

.form-group {
    margin: 1rem 0;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: .75rem;
}

.fa-custom-rd {
    background-color: currentColor;
    -webkit-mask-image: url('../assets/logo/Logo_REDDoctors1.png');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url('../assets/logo/Logo_REDDoctors1.png');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    width: 85%;
    height: 1.4rem;
    display: inline-block;
}

.fa-custom-hscms {
    background-color: currentColor;
    -webkit-mask-image: url('../assets/logo/Logo_HSCMS.png');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url('../assets/logo/Logo_HSCMS.png');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    width: 85%;
    height: 1.4rem;
    display: inline-block;
}

/* Ocultar el pseudo-elemento de Font Awesome */
.fa-custom-rd::before {
    content: "" !important;
}

.fa-custom-hscms::before {
    content: "" !important;
}

#agendaModal .modal-content {
    max-height: 75vh !important;

    h3 {
        margin-top: -25px !important;
    }
}

/* Estilos para modal */
.modal {
    flex: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);

    .modal-content {
        display: flex;
        position: absolute;
        top: 50%;
        left: 50%;
        min-width: 35vw;
        width: 100%;
        max-width: 86vw;
        min-height: 50vh;
        height: fit-content;
        max-height: calc(100vh - 30vh);
        background-color: #fff;
        padding: 1.3rem 1.5rem;
        border-radius: 8px;
        transform: translate(-50%, -50%);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        overflow-y: auto;

        h1,
        h2,
        h3,
        h4,
        h5,
        h5 {
            font-weight: 600;
            color: var(--primary-color);
            margin-bottom: .5rem;
            width: fit-content;
        }
    }

    .close-modal {
        display: flex;
        width: fit-content;
        right: 0;
        margin-left: auto;
        text-align: end;
        justify-self: flex-end;
        cursor: pointer;
        font-size: 1.5rem;
    }
}

.auth-modal {
    align-self: center;
    justify-self: center;
    width: 45% !important;
    padding: 1.2rem;
}

.auth-tab-content {
    text-align: center;
    padding: 12px;
    transition: all 0.3s ease-in-out;
}

.auth-tab-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .5rem;
    color: var(--primary-color);
}

.form-group {
    margin: 1rem 0;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: .75rem;
}

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

    .paquete-info {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .icono-container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        background-color: #f8f9fa;
        border-radius: 8px;
        font-size: 24px;
        color: #6c757d;
    }

    .nombre-container h3 {
        margin: 0;
        font-size: 1.5rem;
        color: #333;
    }

    .modal-actions {
        display: flex;
        gap: 10px;
    }
}


.form-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;

    .form-row {
        display: flex;
        gap: 20px;
    }

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

    .form-control {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
    }

    .form-control-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/*estilos del modal-agenda*/
.agenda {
    width: 100%;
    height: 90%;
    max-height: 440px;
    border: 1px solid #E5EFFC;
    border-radius: 12px !important;
    border-collapse: separate;
    background-color: #FFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    table-layout: fixed;
    overflow: hidden;
    justify-self: center;
    align-self: center;
    text-align: center;

    .thead-calendario {
        background-color: var(--primary-color);
        color: #fff;
        font-size: 1.2rem;
        padding: 15px;
    }

    thead th:first-child {
        justify-content: space-between;
        border-radius: 12px 12px 0 0;
    }

    td {
        position: relative;
        object-fit: contain;
        text-align: center;
        padding: 8px;
        background-color: #f9fbff;
        transition: all 0.3s ease;
        cursor: pointer;
    }

    .dias-semana td {
        font-size: .9rem;
        font-weight: 600;
        background-color: #FFF !important;
        color: #103663;
        text-align: center;
        width: 75px;
        height: 45px;
    }

    .dias-semana td:hover {
        box-shadow: none !important;
        cursor: default !important;
    }

    td:not(.dias-semana td) {
        font-size: .8rem;
        font-weight: regular;
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    }

    td:not(.dias-semana td):hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    td:not(.has-event td):hover {
        background-color: #e4e4e47e;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .prev-ag,
    .sig-ag {
        text-decoration: none;

        i {
            cursor: pointer;
            padding: 0 10px;
            transition: transform 0.2s;
            color: #FFF;
            fill: #FFF;
        }

        i:hover,
        i:hover {
            transform: scale(1.1);
        }
    }

    .fa-solid,
    .fas {
        color: #7777;
        fill: #7777;
    }

    .fa-lock {
        position: absolute;
        font-size: 1.4rem;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .hoy {
        color: #fff;
        font-weight: bold;
        position: relative;
        z-index: 100;
    }

    .hoy::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 1.8rem;
        height: 1.8rem;
        background-color: var(--primary-color);
        border-radius: 50%;
        z-index: -1;
    }

    .dia-seleccionado {
        color: #FFF !important;
        font-weight: bold;
        position: relative;
        z-index: 100;
    }

    .dia-seleccionado::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 1.8rem;
        height: 1.8rem;
        background-color: #3BA2FF;
        border-radius: 50%;
        z-index: -1;
    }

    .sig-fecha,
    .prev-fecha {
        background-color: #c1c1c1 !important;
        opacity: 0.5;
        cursor: default !important;
    }
}

.calendar-container {
    margin-top: 40px;
    max-height: 450px;
    padding-right: 1rem;
    overflow-y: auto;

    .agenda-grid {
        display: grid;
        grid-template-columns: 45px 1fr;
        position: relative;
        height: 100%;
    }

    .horas {
        display: grid;
        grid-template-rows: repeat(24, 25px);
        font-size: 0.7rem;
        color: #666;
        list-style-type: none;
        padding: 0 !important;

    }

    .horas>li {
        padding: 4px;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
        box-sizing: border-box;
    }

    .col-dia {
        position: relative;
    }

    .slot {
        position: absolute;
        left: 0;
        right: 0;
        padding: 5px;
        font-size: 0.85rem;
        border-radius: 4px;
        box-sizing: border-box;
        transition: all 0.2s ease;
    }

    .slot:hover {
        opacity: 0.8;
        cursor: pointer;
    }
}

/* Estilos para el form de horario */
.formulario-pasos {

    #fecha {
        font-weight: 600;
        color: #333;
        margin-bottom: 20px;
    }

    .paso {
        flex-direction: column;
        max-height: 510px;
        min-height: 50%;
        justify-content: space-between;
    }

    #paso-1 {
        display: flex;
        gap: 1rem;
        max-height: 600px;
        overflow-y: auto;
    }

    #paso-1 .paquete-quirofano {
        justify-self: center;
        margin: 0 auto
    }

    #paso-4 {
        margin-top: -1.9rem;
        padding-right: 1rem;
        max-height: 500px;
        overflow-y: scroll;

        .resumen-informacion {
            margin: .5rem 0px
        }
    }

    #confirmar-horario {
        width: 100%;
        padding: 10px;
    }

    .opciones-intervencion {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }

    .paquete-quirofano {
        background: #f8f9fa;
        padding: 1.1rem;
        border-radius: 12px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        font-family: 'Segoe UI', sans-serif;
        max-width: 500px;

        h4 {
            color: #007bff;
        }

        ul {
            padding-left: 1rem;
        }

        .nota {
            font-size: 0.9rem;
            color: #555;
            margin-top: 1rem;
        }
    }

    .card-opcion {
        max-width: 45%;
        cursor: pointer;
        border: 2px solid #ccc;
        border-radius: 10px;
        text-align: center;
        transition: all 0.3s;
        flex: 1;
    }

    .card-opcion input:checked+.card-contenido {
        border: 2px solid #007bff;
        background-color: #e6f0ff;
        box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
    }

    .card-contenido {
        border: 2px solid transparent;
        border-radius: 10px;
        padding: 1rem;
        transition: all 0.3s;
    }

    .card-contenido i {
        font-size: 2rem;
        display: block;
        margin-bottom: 0.5rem;
    }

    .table-rounded td {
        text-align: left !important;
    }

}


@media (max-width: 1390px) {

    html,
    body {
        font-size: 14px !important;
    }
}

@media (max-width: 900px) {

    html,
    body {
        font-size: 12px;
        width: 100dvw;
        height: 100dvh;
    }
}

@media (max-width: 660px) {

    html,
    body {
        font-size: 11px;
    }
}

@media (max-width: 420px) {

    html,
    body {
        font-size: 10px;
    }
}