/* Apartamenticos - Custom Styles (AdminLTE 4 provides base layout) */

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ── Tipografía compacta para todos los grids del proyecto ──
   Se aplica a cualquier .table de Bootstrap, con o sin DataTables.
   Las páginas con tablas de datos heredan este estilo automáticamente. */
.table > thead > tr > th,
.table thead th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.table > tbody > tr > td,
.table tbody td {
    font-size: 0.78rem;
    vertical-align: middle;
}

/* tfoot: mismo tamaño que tbody pero negrita (totales) */
.table > tfoot > tr > th,
.table > tfoot > tr > td,
.table tfoot th,
.table tfoot td {
    font-size: 0.78rem;
    vertical-align: middle;
}

/* Excepciones: tablas dentro de modales pueden necesitar texto un pelín
   más legible al estar el cuerpo más reducido. Si quieres ajustar para
   alguna pantalla concreta, usa una clase override (.table-readable, etc). */

/* ── DataTables: flechas de ordenación limpias y alineadas ── */
/* Quitamos los background-images con flechas Unicode borrosas que vienen de
   dataTables.bootstrap5.min.css y los reemplazamos por iconos Font Awesome
   alineados verticalmente con el texto del header. */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
    background-image: none !important;
    cursor: pointer;
    position: relative;
    padding-right: 1.5rem !important;
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after,
table.dataTable thead .sorting_asc_disabled::after,
table.dataTable thead .sorting_desc_disabled::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.7em;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.35;
    content: "\f0dc"; /* fa-sort */
    color: inherit;
    /* Anulamos los pseudo-elementos por defecto de DataTables. */
    bottom: auto;
    line-height: 1;
}

table.dataTable thead .sorting_asc::after {
    content: "\f0de"; /* fa-sort-up */
    opacity: 0.85;
}

table.dataTable thead .sorting_desc::after {
    content: "\f0dd"; /* fa-sort-down */
    opacity: 0.85;
}

/* Algunas versiones de DataTables usan ::before. Lo deshabilitamos para
   que no aparezca un segundo glifo descolocado. */
table.dataTable thead .sorting::before,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_desc::before {
    content: none !important;
}

/* Hover sobre header ordenable */
table.dataTable thead th.sorting:hover::after {
    opacity: 0.7;
}

/* ── Agency brand marks (Airbnb, Booking.com) ── */
.agency-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.5rem;
    min-width: 1.5rem;
    border-radius: 0.25rem;
    font-weight: 700;
    line-height: 1;
}
.agency-airbnb {
    color: #FF5A5F;
    font-size: 1.4rem;
    background: transparent;
}
.agency-booking {
    background: #003580;
    color: #fff;
    font-size: 0.85rem;
    padding: 0 0.4rem;
    letter-spacing: -0.02em;
}

/* ── Sidebar transitions ── */
.app-sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Layout vertical para que sidebar-wrapper pueda hacer scroll
       cuando el contenido del menú excede el viewport. */
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-sidebar > .sidebar-brand {
    flex: 0 0 auto;
}

.app-sidebar > .sidebar-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.app-sidebar > .sidebar-wrapper::-webkit-scrollbar {
    width: 6px;
}
.app-sidebar > .sidebar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.app-sidebar > .sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Transición AdminLTE 4 para submenús del sidebar (max-height + opacidad). */
.sidebar-menu .nav-treeview {
    display: block !important;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

.sidebar-menu .menu-open > .nav-treeview {
    max-height: 800px;
    opacity: 1;
}

.sidebar-menu .nav-link .nav-arrow {
    transition: transform 0.25s ease;
}

.sidebar-menu .menu-open > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

/* Desktop: smooth collapse width */
.sidebar-collapse .app-sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapse .app-main {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-main {
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile sidebar overlay backdrop */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1035; /* just below sidebar z-index */
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    cursor: pointer;
}

.sidebar-overlay.active {
    background: rgba(0, 0, 0, 0.5);
}

/* Mobile: slide in from left */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar-open .app-sidebar {
        transform: translateX(0) !important;
    }

    /* Ensure main content takes full width on mobile */
    .app-main {
        margin-left: 0 !important;
    }
}
