/* --- Dark mode: sahifa, navbar, footer, breadcrumb --- */
[data-theme="dark"] .liquid-glass-page {
    color: rgba(230, 230, 245, 0.95);
    background: linear-gradient(165deg, #1a1d24 0%, #232830 25%, #2a2e38 50%, #1e2229 75%, #16191f 100%);
}

[data-theme="dark"] .liquid-glass-page::before {
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(60, 80, 120, 0.2) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 80%, rgba(40, 60, 100, 0.15) 0%, transparent 50%);
}

[data-theme="dark"] .liquid-glass-page h1,
[data-theme="dark"] .liquid-glass-page h2,
[data-theme="dark"] .liquid-glass-page h3 {
    color: #e8eaf0;
}

[data-theme="dark"] .liquid-glass-navbar {
    background: rgba(20, 22, 28, 0.9) !important;
}

[data-theme="dark"] .liquid-glass-footer {
    background: rgba(20, 22, 28, 0.85) !important;
}

[data-theme="dark"] .liquid-glass-page .breadcrumb {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item a {
    color: rgba(220, 220, 235, 0.9);
}

[data-theme="dark"] .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .alert-info { background: rgba(0, 122, 255, 0.15); border-color: rgba(0, 122, 255, 0.3); color: #b8d4ff; }
[data-theme="dark"] .alert-success { background: rgba(40, 167, 69, 0.15); border-color: rgba(40, 167, 69, 0.3); color: #a8e6b8; }
[data-theme="dark"] .alert-warning { background: rgba(255, 193, 7, 0.12); border-color: rgba(255, 193, 7, 0.35); color: #f5e6a8; }
[data-theme="dark"] .alert-danger { background: rgba(220, 53, 69, 0.15); border-color: rgba(220, 53, 69, 0.3); color: #ffb8c0; }

[data-theme="dark"] .liquid-glass-footer a,
[data-theme="dark"] .liquid-glass-page a {
    color: #8ab4f8;
}

[data-theme="dark"] .liquid-glass-page a:hover {
    color: #a8c8ff;
}

/* --- Liquid Glass page: typography, ranglar, layout --- */
.liquid-glass-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: #1a1a2e;
    background: linear-gradient(152deg, #9eb8dc 0%, #b8cce8 22%, #d0dff0 48%, #e1ebf5 72%, #eef4f9 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    transition: background 0.35s ease, color 0.35s ease;
}

.liquid-glass-page h1, .liquid-glass-page h2, .liquid-glass-page h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.site-index .body-content {
    padding-top: 2rem;
}

.site-index .body-content .row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 1.5rem;
}

.liquid-glass-page::before {
    content: '';
    position: fixed;
    inset: 0;
    transition: background 0.35s ease;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(120, 160, 220, 0.4) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 80%, rgba(140, 180, 230, 0.25) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

main > .container, main > .container-fluid {
    padding: 88px 24px 48px;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767px) {
    main > .container, main > .container-fluid {
        padding: 72px 16px 32px;
    }
}

/* --- Liquid Glass navbar (iOS 26 — shaffof, kuchli blur) --- */
header {
    position: relative;
    z-index: 10;
}

.liquid-glass-navbar {
    background: rgba(45, 49, 54, 0.55) !important;
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .liquid-glass-navbar {
        overflow: visible;
    }

    /* Navbar tugmalari: bir xil o'lcham (balandlik va kenglik) */
    .liquid-glass-navbar .navbar-nav .nav-link,
    .liquid-glass-navbar .language-switcher .dropdown-toggle,
    .liquid-glass-navbar .btn-liquid-glass {
        width: 155px;
        min-width: 155px;
        height: 40px;
        padding: 0 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        white-space: nowrap;
    }

    .liquid-glass-navbar .theme-toggle {
        width: 44px;
        min-width: 44px;
        height: 40px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
    }
}

/* --- Mobil: offcanvas-style menyu (blur yo'q, yopiq fon, tozalangan UX) --- */
@media (max-width: 767px) {
    .liquid-glass-navbar {
        z-index: 1040;
    }

    .liquid-glass-navbar .navbar-toggler {
        z-index: 1050;
        position: relative;
    }

    .liquid-glass-navbar .navbar-collapse {
        position: fixed;
        top: 0;
        left: 0;
        width: min(300px, 82vw);
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        padding: calc(64px + env(safe-area-inset-top, 0)) 12px 20px 12px;
        margin: 0;
        background: rgba(35, 38, 44, 0.97) !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        overflow-y: auto;
        z-index: 1035;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
    }

    .liquid-glass-navbar .navbar-collapse:not(.show) {
        transform: translateX(-100%);
        visibility: hidden;
    }

    .liquid-glass-navbar .navbar-collapse.show {
        transform: translateX(0);
        visibility: visible;
    }

    /* Mobil menyu ichidagi elementlar */
    .liquid-glass-navbar .navbar-collapse .navbar-nav {
        flex-direction: column;
        gap: 8px;
    }

    .liquid-glass-navbar .navbar-collapse .nav-link {
        display: block;
        padding: 12px 16px;
        margin: 0;
        border-radius: 12px;
        width: 100%;
    }

    .liquid-glass-navbar .navbar-collapse .d-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .liquid-glass-navbar .navbar-collapse .language-switcher,
    .liquid-glass-navbar .navbar-collapse form {
        width: 100%;
    }

    .liquid-glass-navbar .navbar-collapse .theme-toggle,
    .liquid-glass-navbar .navbar-collapse .language-switcher .dropdown-toggle,
    .liquid-glass-navbar .navbar-collapse .btn-liquid-glass,
    .liquid-glass-navbar .navbar-collapse form button {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
    }

    /* Dropdown mobil menyuda to'g'ri ko'rinsin */
    .liquid-glass-navbar .navbar-collapse .language-switcher .dropdown-menu {
        position: static !important;
        transform: none !important;
        margin-top: 4px;
        margin-left: 0;
    }

    /* Til tanlash: bayroq + matn bitta qatorda */
    .liquid-glass-navbar .navbar-collapse .language-switcher .dropdown-item {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        white-space: nowrap !important;
    }
    .liquid-glass-navbar .navbar-collapse .language-switcher .dropdown-item .fi {
        flex-shrink: 0;
        margin-right: 0.5rem;
    }

    /* Backdrop — JS orqali qo'shiladi, bosilganda menyu yopiladi */
    .lg-navbar-backdrop {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: min(300px, 82vw);
        background: rgba(0, 0, 0, 0.35);
        z-index: 1030;
        cursor: pointer;
    }
}

.liquid-glass-navbar .navbar-brand,
.liquid-glass-navbar .nav-link,
.liquid-glass-navbar .login {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Navigation bo'limlari — Liquid Glass tugma (shaffof, kuchli blur) */
.liquid-glass-navbar .navbar-nav .nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    margin: 0 2px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: none;
}

.liquid-glass-navbar .navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.liquid-glass-navbar .navbar-nav .nav-link:active {
    transform: scale(0.98);
}

.liquid-glass-navbar .navbar-nav .nav-link.active,
.liquid-glass-navbar .navbar-nav .nav-item.active .nav-link {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

.liquid-glass-navbar .nav-link:hover {
    color: #fff !important;
}

.liquid-glass-navbar .btn-liquid-glass {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.liquid-glass-navbar .btn-liquid-glass:active {
    transform: scale(0.98);
}

/* Navbar ichidagi til tanlash — shaffof shisha */
.liquid-glass-navbar .language-switcher .dropdown-toggle,
.liquid-glass-navbar .language-switcher .btn {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 14px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.liquid-glass-navbar .language-switcher .dropdown-toggle:hover,
.liquid-glass-navbar .language-switcher .btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
}

.liquid-glass-navbar .language-switcher .dropdown-toggle:active,
.liquid-glass-navbar .language-switcher .btn:active {
    transform: scale(0.98);
}

/* Til tanlash dropdown — chegaradan chiqmaslik, to‘liq ko‘rinishi */
.liquid-glass-navbar .language-switcher {
    position: relative;
    overflow: visible;
}

.liquid-glass-navbar .language-switcher .dropdown-menu {
    background: rgba(40, 44, 52, 0.75);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    min-width: 120px;
    padding: 6px 0;
    margin-top: 6px;
    overflow: hidden;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.liquid-glass-navbar .language-switcher .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin: 2px 8px;
    padding: 8px 12px;
    white-space: nowrap;
    transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.liquid-glass-navbar .language-switcher .dropdown-item:hover,
.liquid-glass-navbar .language-switcher .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.liquid-glass-navbar .language-switcher .dropdown-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-liquid-glass-sm {
    padding: 6px 14px;
    font-size: 0.9rem;
}

/* --- Liquid Glass footer --- */
footer.liquid-glass-footer {
    position: relative;
    z-index: 10;
}

.liquid-glass-footer {
    background: rgba(45, 49, 54, 0.5) !important;
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: .9em;
    height: auto;
    min-height: 60px;
    transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.liquid-glass-footer a {
    color: rgba(255, 255, 255, 0.9);
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    height: 60px;
}

.footer > .container, .footer > .container-fluid {
    padding-right: 15px;
    padding-left: 15px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th,
.grid-view td:last-child {
    white-space: nowrap;
}

.grid-view .filters input,
.grid-view .filters select {
    min-width: 50px;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* username + logout in navbar */
.navbar .navbar-username {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* align the logout "link" (button in form) of the navbar */
.navbar form.logout-form {
    flex-shrink: 0;
}
.navbar form > button.logout {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

@media(max-width:767px) {
    .navbar form > button.logout {
        display: block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
        max-width: none;
    }
}

.navbar form > button.logout:focus,
.navbar form > button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

.navbar form > button.logout:focus {
    outline: none;
}

/* style breadcrumb widget - liquid glass */
.liquid-glass-page .breadcrumb {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: .75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.breadcrumb-item > a
{
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .liquid-glass-navbar .navbar-nav .nav-link,
    .liquid-glass-navbar .btn-liquid-glass,
    .liquid-glass-navbar .language-switcher .dropdown-toggle,
    .liquid-glass-navbar .language-switcher .btn {
        transition-duration: 0.01ms;
    }
    .liquid-glass-navbar .navbar-nav .nav-link:active,
    .liquid-glass-navbar .btn-liquid-glass:active,
    .liquid-glass-navbar .language-switcher .dropdown-toggle:active,
    .liquid-glass-navbar .language-switcher .btn:active {
        transform: none;
    }
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
[data-theme="dark"] #preloader {
    background-color: #1a1d24;
}
#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}
.spinner-container {
    position: relative;
    width: 100px;
    height: 100px;
}
.preloader-logo {
    width: 60px;
    height: 60px;
    position: absolute;
    top: 20px;
    left: 20px;
    animation: preloader-pulse 1.5s infinite ease-in-out;
}
.spinner-ring {
    width: 100px;
    height: 100px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top: 4px solid #0066cc;
    border-radius: 50%;
    animation: preloader-spin 1s linear infinite;
}
[data-theme="dark"] .spinner-ring {
    border-color: rgba(255,255,255,0.1);
    border-top-color: #4a9eff;
}
@keyframes preloader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes preloader-pulse {
    0%, 100% { opacity: 0.8; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}