/* =========================
   NAVBAR LINKS
========================= */

#mainNav .nav-link {
    position: relative;
    color: #fff !important;
    opacity: 0.55;
    transition: all 0.25s ease;
}

/* ACTIVO */
#mainNav .nav-link.active {
    opacity: 1;
}

/* HOVER = ILUMINAR */
#mainNav .nav-link:hover {
    opacity: 1;
}

/* SUBRAYADO (solo activo o hover) */
#mainNav .nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0%;
    height: 2px;
    background: #1cc88a;
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* ACTIVO MÁS VISIBLE */
#mainNav .nav-link.active::after {
    width: 60%;
    opacity: 1;
}

/* ACTIVO MÁS VISIBLE EN HOVER */
#mainNav .nav-link.active:hover::after {
    width: 60%;
    opacity: 1;
}

/* HOVER SUAVE */
#mainNav .nav-link:hover::after {
    width: 40%;
    opacity: 0.6;
}

.brand-wrapper {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.78);
    text-transform: none;
    margin-top: 2px;
}

@media (min-width: 992px) {

    #mainNav .navbar-nav > li.nav-item > a.nav-link.active {
        background: transparent !important;
    }

    #mainNav .navbar-brand {
        font-size: 1.75em;
        transition: font-size 0.3s;
    }
}

.text-justified {
    text-align: justify !important;
}

/* =========================
   NAVBAR BASE
========================= */

#mainNav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
    backdrop-filter: blur(12px);
    background: rgba(44, 62, 80, 0.65) !important;
    transition: all 0.3s ease;
    padding: 18px 0;
}

#mainNav.shrink {
    padding: 8px 0;
    background: rgba(44, 62, 80, 0.9) !important;
}

#mainNav .nav-link {
    color: #fff !important;
    transition: 0.2s;
}

#mainNav .nav-link:hover {
    opacity: 1;
    transform: translateY(-1px);
}

#mainNav .nav-link.active {
    opacity: 1;
    transform: translateY(-1px);
}

/* =========================
   NAVBAR MOBILE
========================= */

@media (max-width: 991.98px) {

    #mainNav .navbar-nav {
        margin-top: 0;
    }

    /* CONTENEDOR */
    #mainNav .navbar-collapse {
        background: transparent;
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 15px;
        margin-left: 10px;
        margin-right: 10px;
        -webkit-box-shadow: inset 0 0 15px 2px rgba(0, 0, 0, 0.25);
        box-shadow: inset 0 0 15px 2px rgba(0, 0, 0, 0.25);
        -webkit-border-radius: 5px 5px 5px 5px;
        border-radius: 5px 5px 5px 5px;
    }

    /* LINKS BASE */
    #mainNav .nav-link {
        padding: 12px 16px;
        margin: 4px 10px;
        border-radius: 10px;
        opacity: 0.55;
        font-weight: 400;
        transition: all 0.2s ease;
        transform: none !important;
    }

    /* HOVER SIMPLE */
    #mainNav .nav-link:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.06);
    }

    /* ACTIVO MUY CLARO */
    #mainNav .nav-link.active {
        opacity: 1;
        font-weight: 600;
        background: rgba(28, 200, 138, 0.18);
        border-left: 4px solid #1cc88a;
        border-right: 4px solid #1cc88a;
        color: #ffffff !important;
        -webkit-box-shadow: 0 0 15px 2px rgba(0, 0, 0, 0.25);
        box-shadow: 0 0 15px 2px rgba(0, 0, 0, 0.25);
    }

    /* QUITAMOS SUBRAYADO */
    #mainNav .nav-link::after {
        display: none;
    }
}

/* =========================
   LAYOUT GENERAL
========================= */

.container {
    max-width: 900px;
}

.page-wrapper {
    padding-top: 120px;
    padding-bottom: 40px;
}

.claseimportante {
    display: none !important;
}

/* =========================
   BODY / FONDO
========================= */

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: none;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("../assets/img/sala_comun.jpg") center / cover no-repeat;
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.25);
}

/* =========================
   TARJETA EFECTO CRISTAL
========================= */

.glass-card {
    backdrop-filter: blur(4px);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    color: white;
}

/* =========================
   CONTENEDOR CALENDARIO
========================= */

#contanier-cal {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

#contanier-cal::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(0, 0, 0, 0.45),
        rgba(0, 0, 0, 0.35)
    );
    border-radius: 20px;
}

#contanier-cal > * {
    position: relative;
    z-index: 2;
}

/* =========================
   CALENDARIO BASE
========================= */

.fc {
    border-radius: 15px;
    padding: 10px;
}

.fc .fc-scrollgrid-section-sticky > * {
    background: transparent !important;
}

.fc-theme-standard .fc-scrollgrid {
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* =========================
   TITULO
========================= */

.titulo {
    text-align: center;
    color: #fff;
    font-weight: 600;
    margin-bottom: 25px;
}

.fc-toolbar-title {
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.2em !important;
}

/* =========================
   BOTONES
========================= */

.fc-button {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: white !important;
    border-radius: 10px !important;
    backdrop-filter: blur(4px);
}

.fc-button:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

.fc-prev-button {
    margin-left: 0.5em !important;
    margin-right: 0.5em !important;
}

.fc .fc-button:disabled {
    opacity: 0.15 !important;
    cursor: not-allowed !important;
}

/* =========================
   CABECERA DIAS
========================= */

.fc-col-header {
    background: transparent !important;
}

.fc-col-header-cell {
    background: transparent !important;
}

.fc-col-header-cell:hover {
    background: transparent !important;
}

.fc-col-header-cell-cushion {
    text-transform: capitalize;
    font-size: 0.9rem;
    color: white !important;
    font-weight: 500;
}

/* =========================
   MANTENER LINEAS DE TABLA
========================= */

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: rgba(255, 255, 255, 0.25);
}

/* =========================
   CELDAS CALENDARIO
========================= */

.fc-daygrid-day {
    position: relative;
    vertical-align: top;
}

.fc-daygrid-day-frame {
    position: relative;
    height: 120px;
}

.fc-day-disabled .fc-daygrid-day-frame .fc-daygrid-day-events {
    cursor: not-allowed !important;
}

/* =========================
   CONTENEDORES EVENTOS
========================= */

.fc-daygrid-day-events,
.fc-daygrid-event-harness,
.fc-daygrid-event,
.fc-event-reservado {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    z-index: 2;
    cursor: pointer !important;
}

.fc-event,
.fc-event-reservado {
    background-image: url('../assets/img/sello_reservado.png');
    background-size: 70% auto;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.35) !important;
    cursor: not-allowed !important;
}

/* =========================
   NUMERO DEL DIA
========================= */

.fc-daygrid-day-number {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 600;
    color: white !important;
    z-index: 3;
}

/* =========================
   NUMERO DIA CON EVENTO
========================= */

.fc-daygrid-day.has-event .fc-daygrid-day-number {
    top: 0%;
    left: 5%;
    transform: none;
    font-size: clamp(1.75rem, 2.5vw, 2.5rem);
    opacity: 0.2;
    cursor: not-allowed !important;
}

/* =========================
   DIA PASADO
========================= */

.fc-daygrid-day.day-past {
    background-color: rgba(0, 0, 0, 0.35);
    cursor: not-allowed !important;
}

.fc-daygrid-day.day-past .fc-daygrid-day-events {
    cursor: not-allowed !important;
}

.fc-daygrid-day.day-past .fc-daygrid-day-number {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* =========================
   HOVER DIAS DISPONIBLES
========================= */

.fc-daygrid-day:not(.day-past):not(.has-event):not(.fc-day-disabled):hover {
    background-color: rgba(255, 255, 255, 0.25);
    cursor: pointer;
}

/* =========================
   BOTON PRINCIPAL
========================= */

.btn-primary {
    background: linear-gradient(45deg, #ff7a18, #ff0058);
    border: none;
    border-radius: 30px;
    padding: 10px;
    font-weight: 500;
    color: white;
}

.btn-primary:hover {
    transform: scale(1.05);
}

/* =========================
   MODAL
========================= */

.modal-content {
    border-radius: 20px;
}

/* =========================
   LOADING OVERLAY
========================= */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: #fff;
    font-family: sans-serif;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {

    to {
        transform: rotate(360deg);
    }
}

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

@media (max-width: 768px) {

    .page-wrapper {
        padding-top: 100px;
    }

    .container {
        max-width: 100% !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .glass-card {
        padding: 5px;
    }

    .fc-daygrid-day-number {
        font-size: 1.4rem;
    }

    .fc-col-header-cell-cushion {
        font-size: 0.65rem;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 4px;
        align-items: center;
        margin-bottom: 5px;
    }

    .fc-toolbar-title {
        font-size: 1rem;
    }

    .fc-button {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    .fc-daygrid-day-frame {
        height: 70px;
    }

    #contanier-cal {
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 20px;
    }

    #calendar {
        width: 100%;
    }

    h2.text-center.mb-4 {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    .modal-body .mb-3 {
        margin-bottom: 0.5rem;
    }

    .modal-footer .btn {
        padding: 6px;
        font-size: 0.9rem;
    }

    .fc-daygrid-day.has-event .fc-daygrid-day-number {
        top: 0%;
        left: 2%;
        font-size: 1rem;
        transform: none;
    }

    .fc-event,
    .fc-event-reservado {
        background-size: contain;
    }

    .text-justified {
        text-align: justify !important;
    }
}