:root {
    --ui-bg: #070d1f;
    --ui-bg-soft: #0c1734;
    --ui-surface: rgba(13, 27, 58, 0.72);
    --ui-surface-solid: #101c3c;
    --ui-text: #e9f0ff;
    --ui-text-muted: #9db0d6;
    --ui-border: rgba(144, 181, 255, 0.2);
    --ui-primary: #2f7cf8;
    --ui-primary-soft: #63c7ff;
    --ui-success: #17b679;
    --ui-warning: #f5a524;
    --ui-danger: #ea5455;
    --ui-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

[data-bs-theme="light"] {
    --ui-bg: #ecf2ff;
    --ui-bg-soft: #dfe9ff;
    --ui-surface: rgba(255, 255, 255, 0.76);
    --ui-surface-solid: #ffffff;
    --ui-text: #0d1a3d;
    --ui-text-muted: #52638b;
    --ui-border: rgba(43, 96, 198, 0.16);
    --ui-primary: #1f66de;
    --ui-primary-soft: #38a6f8;
    --ui-shadow: 0 14px 32px rgba(13, 26, 61, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--ui-text);
    background:
        radial-gradient(1200px 720px at -10% -18%, rgba(56, 166, 248, 0.34), transparent 50%),
        radial-gradient(900px 620px at 105% 0, rgba(47, 124, 248, 0.3), transparent 52%),
        linear-gradient(140deg, var(--ui-bg), var(--ui-bg-soft));
    min-height: 100vh;
    transition: background-color .25s ease, color .25s ease;
}

.main-navbar {
    background: color-mix(in srgb, var(--ui-surface) 84%, transparent) !important;
    border-bottom: 1px solid var(--ui-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform .25s ease, background-color .25s ease, border-color .25s ease;
    z-index: 1030;
}

.navbar-brand-text {
    letter-spacing: .04em;
    font-weight: 700;
}

.main-navbar .nav-link {
    color: var(--ui-text-muted);
    font-weight: 500;
    border-radius: 10px;
    transition: color .2s ease, background-color .2s ease;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link:focus-visible {
    color: var(--ui-text);
    background: rgba(255, 255, 255, 0.08);
}

.main-navbar.navbar-scrolled {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    border: 0;
    background: linear-gradient(130deg, var(--ui-primary), var(--ui-primary-soft));
    box-shadow: 0 10px 24px rgba(33, 112, 240, 0.34);
}

.btn-primary:hover {
    filter: saturate(1.08) brightness(1.04);
    transform: translateY(-1px);
}

.btn-outline-light,
.btn-outline-secondary,
.btn-outline-danger {
    border-color: var(--ui-border);
    color: var(--ui-text);
}

.btn-outline-light:hover,
.btn-outline-secondary:hover,
.btn-outline-danger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: transparent;
}

.glass-card,
.card {
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow);
    border-radius: 18px;
    color: var(--ui-text);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.glass-card:hover,
.card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 173, 255, 0.42);
}

.card-header {
    background: color-mix(in srgb, var(--ui-surface-solid) 75%, transparent);
    border-bottom: 1px solid var(--ui-border);
    color: var(--ui-text);
}

.section-wrap {
    position: relative;
    padding: 2.2rem;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--ui-border);
    overflow: hidden;
}

.section-wrap > * {
    position: relative;
    z-index: 1;
}

.section-wrap::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    top: -120px;
    right: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 166, 248, .22), transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
}

.gradient-text {
    background: linear-gradient(130deg, #71b4ff, #4df4d1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-subtitle,
.text-muted {
    color: var(--ui-text-muted) !important;
}

.feature-card {
    height: 100%;
    padding: 1.2rem;
}

.feature-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(47, 124, 248, 0.24), rgba(56, 166, 248, 0.1));
    color: #8ad3ff;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 12px;
    border: 1px solid var(--ui-border);
    background: color-mix(in srgb, var(--ui-surface-solid) 66%, transparent);
    color: var(--ui-text);
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: color-mix(in srgb, var(--ui-text-muted) 72%, transparent);
}

.form-control:focus,
.form-select:focus {
    color: var(--ui-text);
    border-color: rgba(73, 156, 255, 0.56);
    box-shadow: 0 0 0 .22rem rgba(47, 124, 248, 0.18);
    background: color-mix(in srgb, var(--ui-surface-solid) 74%, transparent);
}

.table,
.table th,
.table td,
.table-striped > tbody > tr:nth-of-type(odd) > * {
    color: var(--ui-text);
    border-color: var(--ui-border);
}

.badge.bg-dark {
    background: #223d75 !important;
}

.hover-effect:hover {
    color: #86d0ff !important;
}

.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: "";
    position: absolute;
    left: 20%;
    bottom: 4px;
    width: 60%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(130deg, var(--ui-primary), var(--ui-primary-soft));
    transform: scaleX(0);
    transition: transform .2s ease;
}

.hover-underline:hover::after {
    transform: scaleX(1);
}

.reveal-up {
    opacity: 1;
    transform: none;
}

.js-reveal .reveal-up {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .38s ease, transform .38s ease;
}

.js-reveal .reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

main {
    position: relative;
    z-index: 1;
}

.footer-modern {
    border-top: 1px solid var(--ui-border);
    background: color-mix(in srgb, var(--ui-surface) 78%, transparent);
}

.social-link {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--ui-text-muted);
    border: 1px solid var(--ui-border);
    transition: all .2s ease;
}

.social-link:hover {
    color: var(--ui-text);
    transform: translateY(-2px);
    border-color: rgba(80, 167, 255, 0.5);
}

.loader {
    opacity: 1;
    transition: opacity .35s ease;
}

.modal-backdrop {
    z-index: 1080;
}

.modal {
    z-index: 1090;
}

.modal-content {
    border: 1px solid var(--ui-border);
    background: var(--ui-surface-solid);
    color: var(--ui-text);
}

.modal-header,
.modal-footer {
    border-color: var(--ui-border);
}

.admin-panel-card {
    border: 1px solid var(--ui-border);
    background: var(--ui-surface);
    border-radius: 16px;
    box-shadow: var(--ui-shadow);
    overflow: hidden;
}

.admin-panel-card .card-header {
    background: color-mix(in srgb, var(--ui-surface-solid) 82%, transparent);
}

.admin-tools .form-select,
.admin-tools .form-control,
.admin-tools .btn {
    min-height: 42px;
}

.theme-transitioning {
    opacity: .8;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .section-wrap {
        padding: 1.4rem;
        border-radius: 18px;
    }
    .main-navbar .navbar-nav {
        margin-top: .75rem;
        gap: .35rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.85rem;
    }
}
