/*
 * Alminbar visual system
 * Bootstrap provides the component foundation; this layer supplies the brand.
 */

:root {
    --primary-color: #0288d1;
    --primary-light: #29b6f6;
    --primary-dark: #01579b;
    --primary-glow: rgba(2, 136, 209, 0.1);
    --accent-color: #03a9f4;
    --accent-light: #81d4fa;
    --bg-base: #f5fbff;
    --bg-surface: #ffffff;
    --text-main: #1c2a38;
    --text-muted: #546e7a;
    --border-color: #e1f5fe;
    --radius-lg: 24px;
    --radius-md: 15px;
    --radius-sm: 10px;
    --shadow-sm: 0 4px 14px rgba(1, 87, 155, 0.05);
    --shadow-md: 0 14px 38px rgba(1, 87, 155, 0.08);
    --shadow-lg: 0 28px 70px rgba(1, 87, 155, 0.14);
    --bs-primary: #0288d1;
    --bs-primary-rgb: 2, 136, 209;
    --bs-border-radius: 0.75rem;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 10% 8%, rgba(201, 146, 46, 0.07), transparent 26rem),
        linear-gradient(180deg, #fbfdff 0%, var(--bg-base) 100%);
    color: var(--text-main);
    font-family: "Tajawal", "Noto Sans Arabic", system-ui, sans-serif;
    overflow-x: hidden;
}

::selection {
    color: #fff;
    background: var(--primary-color);
}

.container {
    max-width: 1240px;
}

.site-announcement {
    padding: 0.48rem 0;
    color: rgba(255, 255, 255, 0.78);
    background: var(--primary-dark);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.announcement-status {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.announcement-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #81d4fa;
    box-shadow: 0 0 0 5px rgba(129, 212, 250, 0.12);
}

.site-header {
    top: 0;
    z-index: 1020;
    padding: 0;
    background: rgba(255, 255, 255, 0.91);
    border-bottom: 1px solid rgba(2, 136, 209, 0.09);
    box-shadow: 0 8px 28px rgba(18, 48, 39, 0.05);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.site-header .navbar {
    min-height: 84px;
    padding-block: 0.65rem;
}

.site-brand {
    display: inline-flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
    color: var(--primary-color);
}

.brand-mark {
    display: grid;
    width: 49px;
    height: 49px;
    place-items: center;
    flex: 0 0 auto;
    color: var(--primary-color);
    background: linear-gradient(145deg, #eef7fc, #fff);
    border: 1px solid rgba(2, 136, 209, 0.12);
    border-radius: 15px;
    box-shadow: 0 9px 22px rgba(2, 136, 209, 0.1);
}

.brand-mark svg {
    width: 36px;
    height: 36px;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-copy strong {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.brand-copy small {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
}

.site-nav {
    gap: 0.15rem;
}

.site-nav .nav-link {
    position: relative;
    padding: 0.68rem 0.85rem !important;
    color: #44564f;
    border-radius: 10px;
    font-size: 0.93rem;
    font-weight: 600;
}

.site-nav .nav-link::after {
    position: absolute;
    right: 50%;
    bottom: 0.18rem;
    width: 0;
    height: 2px;
    content: "";
    background: var(--accent-color);
    border-radius: 10px;
    transition: width 0.2s ease, right 0.2s ease;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
    color: var(--primary-color);
    background: var(--primary-glow);
}

.site-nav .nav-link.active::after {
    right: 35%;
    width: 30%;
}

.navbar-toggler {
    padding: 0.55rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: none !important;
}

.auth-buttons {
    display: flex;
    gap: 0.55rem;
}

.user-chip {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.user-avatar {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #fff;
    background: var(--primary-color);
    border-radius: 10px;
}

.btn {
    min-height: 42px;
    gap: 0.45rem;
    padding: 0.62rem 1.15rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-color: transparent;
    box-shadow: 0 9px 22px rgba(2, 136, 209, 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 12px 28px rgba(2, 136, 209, 0.28);
}

.btn-accent {
    color: #fff;
    background: linear-gradient(135deg, #b77d1e, var(--accent-color));
    box-shadow: 0 9px 22px rgba(183, 125, 30, 0.22);
}

.btn-accent:hover,
.btn-accent:focus {
    color: #fff;
    background: linear-gradient(135deg, #9e6a18, #c78d28);
}

.btn-secondary,
.btn-ghost {
    color: var(--primary-color);
    background: #fff;
    border-color: rgba(2, 136, 209, 0.2);
    box-shadow: none;
}

.btn-secondary:hover,
.btn-ghost:hover {
    color: var(--primary-dark);
    background: #f0f7f3;
    border-color: rgba(2, 136, 209, 0.32);
}

/* Home */
.home-banners {
    position: relative;
    padding-block: clamp(1rem, 2.5vw, 2rem) clamp(3.5rem, 6vw, 5.5rem);
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 10%, rgba(2, 136, 209, 0.1), transparent 30%),
        linear-gradient(180deg, #f6fbff 0%, #f8fbf9 100%);
    border-bottom: 1px solid rgba(2, 136, 209, 0.08);
}

.banner-slider {
    position: relative;
    overflow: hidden;
    background: #dce9e2;
    border: 6px solid rgba(255, 255, 255, 0.96);
    border-radius: clamp(20px, 2.5vw, 34px);
    box-shadow: 0 24px 65px rgba(15, 65, 50, 0.15);
}

.banner-slides {
    position: relative;
    aspect-ratio: 3.2 / 1;
}

.banner-slide {
    position: absolute;
    inset: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    transform: scale(1.015);
    transition: opacity 0.55s ease, transform 0.85s ease, visibility 0.55s;
}

.banner-slide.is-active {
    z-index: 1;
    visibility: visible;
    opacity: 1;
    transform: scale(1);
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.banner-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    width: 46px;
    height: 46px;
    padding: 0;
    place-items: center;
    color: #fff;
    background: rgba(1, 87, 155, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    font-family: Arial, sans-serif;
    font-size: 2rem;
    line-height: 1;
    transform: translateY(-50%);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.banner-arrow:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.06);
}

.banner-arrow-next {
    right: 1rem;
}

.banner-arrow-prev {
    left: 1rem;
}

.banner-dots {
    position: absolute;
    right: 50%;
    bottom: 1rem;
    z-index: 3;
    display: flex;
    gap: 0.45rem;
    align-items: center;
    padding: 0.45rem 0.65rem;
    background: rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
    transform: translateX(50%);
    backdrop-filter: blur(10px);
}

.banner-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    background: rgba(1, 87, 155, 0.3);
    border: 0;
    border-radius: 999px;
    transition: width 0.25s ease, background 0.25s ease;
}

.banner-dot.is-active {
    width: 27px;
    background: var(--primary-color);
}

.banner-empty {
    display: grid;
    min-height: 230px;
    place-items: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.76);
    border: 2px dashed rgba(2, 136, 209, 0.2);
    border-radius: 28px;
    font-weight: 700;
}

.hero {
    position: relative;
    padding-block: clamp(4rem, 8vw, 7rem);
    overflow: hidden;
    background:
        linear-gradient(115deg, rgba(225, 245, 254, 0.98), rgba(251, 247, 238, 0.95)),
        #f4f8f5;
    border-bottom: 1px solid rgba(2, 136, 209, 0.08);
}

.hero::before,
.hero::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    top: -220px;
    right: -160px;
    width: 560px;
    height: 560px;
    border: 90px solid rgba(2, 136, 209, 0.035);
}

.hero::after {
    bottom: -190px;
    left: -130px;
    width: 430px;
    height: 430px;
    background: rgba(201, 146, 46, 0.055);
}

.hero-grid {
    position: relative;
    z-index: 1;
    grid-template-columns: 1.08fr 0.92fr;
    gap: clamp(3rem, 7vw, 6rem);
}

.eyebrow,
.hero-kicker {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 1.15rem;
    color: var(--primary-color);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.035em;
}

.hero-kicker {
    padding: 0.48rem 0.8rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(2, 136, 209, 0.12);
    border-radius: 999px;
}

.hero-kicker i {
    width: 7px;
    height: 7px;
    background: var(--accent-color);
    border-radius: 50%;
}

.hero-content h1 {
    max-width: 720px;
    margin-bottom: 1.4rem;
    color: var(--text-main);
    font-size: clamp(2.35rem, 4.5vw, 4.25rem);
    font-weight: 800;
    line-height: 1.24;
    letter-spacing: -0.055em;
}

.hero-content h1 span {
    color: var(--primary-color);
}

.hero-content p {
    max-width: 650px;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: clamp(1rem, 1.5vw, 1.16rem);
    line-height: 1.95;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2.2rem;
}

.hero-actions .btn {
    min-height: 50px;
    padding-inline: 1.5rem;
}

.hero-trust {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    color: #52635c;
    font-size: 0.82rem;
    font-weight: 600;
}

.hero-trust span {
    display: inline-flex;
    gap: 0.42rem;
    align-items: center;
}

.hero-trust span::before {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    color: var(--primary-color);
    content: "✓";
    background: rgba(2, 136, 209, 0.1);
    border-radius: 50%;
    font-size: 0.7rem;
}

.hero-visual {
    position: relative;
    padding: 1rem;
}

.hero-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #dce9e2;
    border: 10px solid rgba(255, 255, 255, 0.9);
    border-radius: 34px 34px 34px 90px;
    box-shadow: var(--shadow-lg);
}

.hero-image-wrapper::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, transparent 52%, rgba(1, 87, 155, 0.34));
}

.hero-image-wrapper img {
    height: clamp(390px, 48vw, 540px);
    object-fit: cover;
    object-position: center;
    transition: transform 0.7s ease;
}

.hero-image-wrapper:hover img {
    transform: scale(1.035);
}

.floating-note {
    position: absolute;
    right: -0.5rem;
    bottom: 2.7rem;
    z-index: 2;
    display: flex;
    gap: 0.8rem;
    align-items: center;
    min-width: 215px;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(1, 87, 155, 0.18);
    backdrop-filter: blur(12px);
}

.floating-note-icon {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    flex: 0 0 auto;
    color: #fff;
    background: var(--primary-color);
    border-radius: 13px;
    font-size: 1.15rem;
}

.floating-note strong,
.floating-note small {
    display: block;
}

.floating-note strong {
    color: var(--text-main);
    font-size: 0.9rem;
}

.floating-note small {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.stats-strip {
    position: relative;
    z-index: 3;
    margin-top: -2rem;
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(2, 136, 209, 0.1);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.stat-item {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
    padding: 1.35rem;
    border-inline-start: 1px solid var(--border-color);
}

.stat-item:first-child {
    border-inline-start: 0;
}

.stat-item strong {
    color: var(--primary-color);
    font-size: 1.65rem;
    font-weight: 800;
}

.stat-item span {
    max-width: 110px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.categories-section {
    padding-block: clamp(5rem, 8vw, 7rem);
}

.section-heading {
    max-width: 670px;
    margin: 0 auto 3.25rem;
    text-align: center;
}

.section-title {
    margin-bottom: 0.8rem;
    color: var(--text-main);
    font-size: clamp(1.9rem, 3vw, 2.7rem);
    letter-spacing: -0.04em;
}

.section-title::after {
    display: none;
}

.section-heading p {
    color: var(--text-muted);
    line-height: 1.8;
}

.categories-grid {
    gap: 1.35rem;
}

.category-card {
    position: relative;
    align-items: flex-start;
    min-height: 330px;
    padding: 2rem;
    overflow: hidden;
    text-align: right;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    box-shadow: var(--shadow-sm);
}

.category-card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    content: "";
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.category-card:hover {
    border-color: rgba(2, 136, 209, 0.2);
    box-shadow: var(--shadow-md);
    transform: translateY(-7px);
}

.category-card:hover::before {
    opacity: 1;
}

.category-icon {
    width: 62px;
    height: 62px;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    background: linear-gradient(145deg, #e1f5fe, #f5fbff);
    border: 1px solid rgba(2, 136, 209, 0.1);
    border-radius: 18px;
}

.category-card:hover .category-icon {
    color: #fff;
    background: var(--primary-color);
    transform: rotate(-4deg) scale(1.04);
}

.category-card h3 {
    color: var(--text-main);
    font-size: 1.2rem;
    font-weight: 800;
}

.category-card p {
    color: var(--text-muted);
    line-height: 1.8;
}

.category-card .btn {
    width: auto !important;
}

/* Primary departments */
.categories-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.department-card {
    --department-accent: var(--primary-color);
    --department-soft: #eaf6f0;
    align-items: stretch;
    min-height: 410px;
    padding: 0;
    overflow: hidden;
    text-align: right;
    background: #fff;
    border-color: rgba(18, 55, 44, 0.1);
}

.department-card::before {
    display: none;
}

.department-card-media {
    --department-accent: #386d8f;
    --department-soft: #eaf3f8;
}

.department-card-books {
    --department-accent: #a87422;
    --department-soft: #fbf2df;
}

.department-card-visual {
    position: relative;
    display: flex;
    min-height: 132px;
    align-items: flex-end;
    justify-content: space-between;
    padding: 1.45rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.9), transparent 8rem),
        linear-gradient(135deg, var(--department-soft), #fff);
    border-bottom: 1px solid rgba(18, 55, 44, 0.07);
}

.department-card-visual::after {
    position: absolute;
    top: -55px;
    left: -35px;
    width: 155px;
    height: 155px;
    content: "";
    border: 28px solid color-mix(in srgb, var(--department-accent) 8%, transparent);
    border-radius: 50%;
}

.department-card-icon {
    position: relative;
    z-index: 1;
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    color: #fff;
    background: var(--department-accent);
    border: 5px solid rgba(255, 255, 255, 0.85);
    border-radius: 21px;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--department-accent) 24%, transparent);
    font-size: 1.8rem;
    transition: transform 0.25s ease;
}

.department-card-number {
    position: absolute;
    top: 1rem;
    left: 1.2rem;
    color: color-mix(in srgb, var(--department-accent) 17%, transparent);
    font-size: 3.6rem;
    font-weight: 900;
    line-height: 1;
}

.department-card-metric {
    position: relative;
    z-index: 1;
    padding: 0.42rem 0.65rem;
    color: var(--department-accent);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid color-mix(in srgb, var(--department-accent) 12%, transparent);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.department-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
}

.department-card-kicker {
    margin-bottom: 0.55rem;
    color: var(--department-accent);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.department-card h3 {
    margin-bottom: 0.65rem;
    font-size: 1.35rem;
}

.department-card p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.department-card-button {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-top: auto;
    color: #fff;
    background: var(--department-accent);
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 800;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--department-accent) 19%, transparent);
}

.department-card-button:hover {
    color: #fff;
    transform: translateY(-2px);
}

.department-card:hover .department-card-icon {
    transform: rotate(-4deg) scale(1.05);
}

@media (max-width: 991.98px) {
    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .department-card {
        min-height: 385px;
    }
}

.latest-section {
    padding-block: clamp(4.5rem, 8vw, 6.5rem);
    background: #fff;
    border-block: 1px solid var(--border-color);
}

.about-section {
    position: relative;
    padding-block: clamp(5rem, 9vw, 8rem);
    overflow: hidden;
}

.about-panel {
    position: relative;
    max-width: 930px;
    padding: clamp(2rem, 5vw, 4rem);
    margin: auto;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), #0288d1);
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
}

.about-panel::after {
    position: absolute;
    bottom: -90px;
    left: -65px;
    width: 240px;
    height: 240px;
    content: "";
    border: 42px solid rgba(255, 255, 255, 0.055);
    border-radius: 50%;
}

.about-panel .section-title,
.about-panel p {
    position: relative;
    z-index: 1;
    color: #fff;
}

.about-panel p {
    max-width: 760px;
    margin: 1.2rem auto 0;
    color: rgba(255, 255, 255, 0.75);
    line-height: 2;
}

/* Inner pages */
.page-header {
    position: relative;
    padding-block: clamp(3.4rem, 7vw, 5.5rem);
    margin-bottom: 3.5rem;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(120deg, var(--primary-dark), #0288d1);
    border: 0;
}

.page-header::after {
    position: absolute;
    top: -150px;
    left: -90px;
    width: 360px;
    height: 360px;
    content: "";
    border: 65px solid rgba(255, 255, 255, 0.045);
    border-radius: 50%;
}

.page-header .container {
    position: relative;
    z-index: 1;
}

.page-header h1,
.page-header p {
    color: #fff !important;
}

.page-header h1 {
    max-width: 820px;
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 4vw, 3.2rem);
    letter-spacing: -0.04em;
}

.page-header p {
    max-width: 760px;
    margin: 0;
    opacity: 0.72;
    font-size: 1.02rem;
}

.layout-sidebar {
    gap: 2rem;
}

.sidebar-card,
.question-card,
.media-card,
.book-card,
.stat-card,
.auth-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar-card {
    padding: 1.5rem;
}

.sidebar-card h3 {
    color: var(--text-main);
    border-bottom-color: var(--border-color);
    font-weight: 800;
}

.question-card {
    padding: 1.65rem;
}

.question-card:hover {
    border-color: rgba(2, 136, 209, 0.2);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.question-title {
    color: var(--text-main);
    font-weight: 800;
}

.question-meta {
    color: #77867f;
}

.answer-section {
    padding: 1.25rem;
    background: linear-gradient(135deg, #f0f8ff, #fbfcff);
    border: 1px solid rgba(2, 136, 209, 0.1);
    border-inline-start: 4px solid var(--primary-color);
    border-radius: 13px;
}

.badge {
    padding: 0.43rem 0.72rem;
    font-weight: 700;
}

.badge-success {
    color: #01579b;
    background: #e1f5fe;
}

.badge-warning {
    color: #8a5b0c;
    background: #fff4d8;
}

.search-input,
.form-control-input,
.form-control,
select.form-control-input {
    min-height: 48px;
    color: var(--text-main);
    background-color: #fff;
    border: 1px solid #e1f5fe;
    border-radius: 12px;
}

.search-input:focus,
.form-control-input:focus,
.form-control:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(2, 136, 209, 0.1);
}

.form-label {
    color: #34463f;
    font-size: 0.88rem;
    font-weight: 700;
}

.category-item-link {
    padding: 0.7rem 0.8rem;
    border: 1px solid transparent;
}

.category-item-link:hover,
.category-item-link.active {
    color: var(--primary-color);
    background: #f0f8ff;
    border-color: rgba(2, 136, 209, 0.08);
}

.media-tabs {
    max-width: 100%;
    padding: 0.35rem;
    overflow-x: auto;
    background: #fff;
    border-color: var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.media-tab {
    flex: 0 0 auto;
    border-radius: 10px;
}

.media-tab.active,
.media-tab:hover {
    color: #fff;
    background: var(--primary-color);
}

.media-grid,
.books-grid {
    gap: 1.5rem;
}

.media-card,
.book-card {
    overflow: hidden;
}

.media-card {
    cursor: pointer;
}

.media-card:focus-visible {
    outline: 3px solid rgba(2, 136, 209, 0.28);
    outline-offset: 4px;
}

.media-card-disabled {
    cursor: not-allowed;
    filter: grayscale(0.65);
    opacity: 0.72;
}

.modal.is-open {
    display: flex;
}

body.modal-open {
    overflow: hidden;
}

.mobile-bottom-nav {
    display: none;
}

.media-card:hover,
.book-card:hover {
    border-color: rgba(2, 136, 209, 0.18);
    box-shadow: var(--shadow-md);
}

.media-thumbnail-wrapper {
    border-bottom: 1px solid var(--border-color);
}

.media-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.media-thumbnail-fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: rgba(255, 255, 255, 0.82);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    font-size: 2.5rem;
}

.media-thumbnail-wrapper::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    pointer-events: none;
    background: linear-gradient(180deg, transparent 55%, rgba(1, 87, 155, 0.32));
}

.media-play-overlay,
.media-duration {
    z-index: 2;
}

.media-play-overlay {
    opacity: 1;
    background: rgba(3, 35, 27, 0.08);
}

.play-button-circle {
    width: 56px;
    height: 56px;
    color: #fff;
    background: rgba(2, 136, 209, 0.92);
    border: 3px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 30px rgba(3, 35, 27, 0.28);
}

.media-card:hover .play-button-circle {
    background: var(--accent-color);
    transform: scale(1.08);
}

.book-cover-wrapper {
    border-radius: 10px 17px 17px 10px;
    box-shadow: 12px 14px 30px rgba(12, 48, 37, 0.2);
}

.alert {
    padding: 1rem 1.15rem;
    border: 0;
    border-radius: 13px;
}

.auth-wrapper {
    max-width: 480px;
    margin-block: 5rem;
}

.auth-card {
    padding: 2.5rem;
}

.auth-header h2 {
    color: var(--text-main);
}

.stat-card {
    box-shadow: var(--shadow-sm);
}

.admin-grid {
    gap: 1rem;
}

.banner-upload-card {
    position: sticky;
    top: 110px;
    border: 1px solid rgba(2, 136, 209, 0.18);
    box-shadow: var(--shadow-md);
}

.banner-upload-card h3,
.banner-list-heading h3 {
    color: var(--text-main);
    font-weight: 800;
}

.banner-admin-hint,
.form-help {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.75;
}

.banner-admin-hint {
    padding: 0.75rem 0.85rem;
    margin-bottom: 1.25rem;
    background: rgba(2, 136, 209, 0.06);
    border-radius: 12px;
}

.banner-form-grid,
.banner-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.banner-switch {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    min-height: 48px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 700;
}

.banner-switch input {
    width: 19px;
    height: 19px;
    accent-color: var(--primary-color);
}

.banner-list-heading {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.banner-list-heading .eyebrow {
    margin-bottom: 0.35rem;
}

.admin-banner-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.admin-banner-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.admin-banner-card.is-disabled .admin-banner-preview img {
    filter: grayscale(0.75);
    opacity: 0.65;
}

.admin-banner-preview {
    position: relative;
    aspect-ratio: 3.2 / 1;
    overflow: hidden;
    background: #eaf1ed;
}

.admin-banner-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-status,
.banner-order {
    position: absolute;
    top: 0.8rem;
    padding: 0.4rem 0.7rem;
    color: #fff;
    background: rgba(3, 35, 27, 0.78);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    font-size: 0.72rem;
    font-weight: 800;
    backdrop-filter: blur(8px);
}

.banner-status {
    right: 0.8rem;
}

.banner-status.is-on {
    background: rgba(5, 150, 105, 0.88);
}

.banner-status.is-off {
    background: rgba(100, 116, 139, 0.88);
}

.banner-order {
    left: 0.8rem;
}

.admin-banner-edit {
    padding: 1.15rem 1.25rem 0.8rem;
}

.banner-edit-grid {
    grid-template-columns: 1.7fr 0.55fr;
}

.banner-edit-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.banner-delete-form {
    padding: 0 1.25rem 1.2rem;
}

.banner-delete-button {
    width: 100%;
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.25);
}

.banner-delete-button:hover {
    color: #fff;
    background: #b91c1c;
    border-color: #b91c1c;
}

.banner-admin-empty {
    padding: 3.5rem 1.5rem;
    color: var(--text-muted);
    text-align: center;
    background: #fff;
    border: 2px dashed rgba(2, 136, 209, 0.2);
    border-radius: 20px;
}

.banner-admin-empty span {
    font-size: 3rem;
}

.banner-admin-empty h4 {
    margin-block: 0.75rem 0.45rem;
    color: var(--text-main);
    font-weight: 800;
}

/* Footer */
.site-footer {
    position: relative;
    padding-block: 4.5rem 1.5rem;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 12% 115%, rgba(129, 212, 250, 0.22), transparent 34%),
        linear-gradient(135deg, #014a85 0%, var(--primary-dark) 48%, #0277bd 100%);
    border-top: 0;
}

.footer-pattern {
    position: absolute;
    top: -170px;
    right: -130px;
    width: 480px;
    height: 480px;
    border: 75px solid rgba(129, 212, 250, 0.08);
    border-radius: 50%;
}

.site-footer .footer-grid {
    grid-template-columns: 1.5fr 0.8fr 0.8fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-brand {
    display: inline-flex;
    gap: 0.7rem;
    align-items: center;
    margin-bottom: 1.25rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
}

.small-mark {
    width: 38px;
    height: 38px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 11px;
}

.footer-about p,
.footer-action p {
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.8;
}

.footer-trust {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}

.footer-trust span {
    padding: 0.38rem 0.55rem;
    color: rgba(255, 255, 255, 0.68);
    background: rgba(129, 212, 250, 0.1);
    border: 1px solid rgba(129, 212, 250, 0.16);
    border-radius: 8px;
    font-size: 0.7rem;
}

.site-footer .footer-links h4,
.footer-action h4 {
    margin-bottom: 1.15rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.site-footer .footer-links a {
    color: rgba(255, 255, 255, 0.6);
}

.site-footer .footer-links a:hover {
    color: #fff;
}

.eyebrow.light {
    margin-bottom: 0.7rem;
    color: var(--accent-light);
}

.footer-action {
    padding: 1.35rem;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(129, 212, 250, 0.19);
    border-radius: 18px;
}

.footer-bottom {
    padding-top: 1.5rem;
    color: rgba(255, 255, 255, 0.42);
    border-top-color: rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
}

.footer-bottom p {
    margin: 0;
}

@media (max-width: 1199.98px) {
    .site-header .navbar-collapse {
        padding: 1rem;
        margin-top: 0.7rem;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 17px;
        box-shadow: var(--shadow-md);
    }

    .site-nav {
        gap: 0.3rem;
    }

    .site-nav .nav-link.active::after {
        display: none;
    }

    .site-footer .footer-grid {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    .footer-action {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: right;
    }

    .hero-content p {
        margin-inline: 0;
    }

    .hero-visual {
        max-width: 650px;
        margin-inline: auto;
    }

    .layout-sidebar,
    .layout-sidebar[style] {
        grid-template-columns: 1fr !important;
    }

    .banner-upload-card {
        position: static;
    }

    .site-footer .footer-grid {
        grid-template-columns: 1fr 1fr;
        text-align: right;
    }

    .footer-about p {
        margin-inline: 0;
    }

    .footer-about,
    .footer-action {
        grid-column: 1 / -1;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-inline: 1rem;
    }

    .site-header .navbar {
        min-height: 72px;
    }

    .brand-mark {
        width: 43px;
        height: 43px;
    }

    .brand-copy strong {
        font-size: 1.05rem;
    }

    .brand-copy small {
        display: none;
    }

    .hero {
        padding-block: 3.5rem 4.5rem;
    }

    .home-banners {
        padding-block: 0.8rem 3.8rem;
    }

    .banner-slider {
        border-width: 4px;
        border-radius: 18px;
    }

    .banner-slides {
        aspect-ratio: 1.55 / 1;
    }

    .banner-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.55rem;
    }

    .banner-arrow-next {
        right: 0.55rem;
    }

    .banner-arrow-prev {
        left: 0.55rem;
    }

    .banner-dots {
        bottom: 0.65rem;
    }

    .hero-content h1 {
        font-size: 2.35rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-trust {
        flex-direction: column;
        gap: 0.6rem;
    }

    .hero-visual {
        padding: 0;
    }

    .hero-image-wrapper {
        border-width: 6px;
        border-radius: 24px 24px 24px 56px;
    }

    .hero-image-wrapper img {
        height: 360px;
    }

    .floating-note {
        right: 0.7rem;
        bottom: 1.4rem;
        min-width: 195px;
    }

    .stats-panel {
        grid-template-columns: 1fr;
    }

    .stat-item,
    .stat-item:first-child {
        justify-content: flex-start;
        border-block-start: 1px solid var(--border-color);
        border-inline-start: 0;
    }

    .stat-item:first-child {
        border-block-start: 0;
    }

    .categories-grid,
    .books-grid,
    .media-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        min-height: 290px;
    }

    .page-header {
        margin-bottom: 2.2rem;
    }

    .question-header,
    .question-meta {
        flex-direction: column;
    }

    .form-grid[style] {
        grid-template-columns: 1fr !important;
    }

    .banner-form-grid,
    .banner-edit-grid {
        grid-template-columns: 1fr;
    }

    .banner-list-heading,
    .banner-edit-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-banner-preview {
        aspect-ratio: 1.65 / 1;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .site-footer .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-about,
    .footer-action {
        grid-column: auto;
    }
}

@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1080;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: end;
        min-height: 72px;
        padding: 7px 8px calc(6px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid rgba(2, 136, 209, 0.12);
        box-shadow: 0 -10px 32px rgba(12, 48, 37, 0.11);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        transition: transform 0.25s ease;
    }

    .mobile-nav-item {
        position: relative;
        display: flex;
        min-width: 0;
        min-height: 56px;
        flex-direction: column;
        gap: 0.25rem;
        align-items: center;
        justify-content: center;
        color: #77877f;
        border-radius: 12px;
        font-size: 0.66rem;
        font-weight: 700;
    }

    .mobile-nav-item svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .mobile-nav-item.active {
        color: var(--primary-color);
        background: rgba(2, 136, 209, 0.07);
    }

    .mobile-nav-item.active::before {
        position: absolute;
        top: 0;
        width: 20px;
        height: 3px;
        content: "";
        background: var(--accent-color);
        border-radius: 0 0 6px 6px;
    }

    .mobile-nav-action {
        position: relative;
        top: -17px;
        display: flex;
        flex-direction: column;
        gap: 0.18rem;
        align-items: center;
        color: var(--primary-color);
        font-size: 0.67rem;
        font-weight: 800;
    }

    .mobile-nav-action > span {
        display: grid;
        width: 54px;
        height: 54px;
        place-items: center;
        color: #fff;
        background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
        border: 5px solid #fff;
        border-radius: 50%;
        box-shadow: 0 10px 25px rgba(2, 136, 209, 0.28);
        font-family: system-ui, sans-serif;
        font-size: 1.8rem;
        font-weight: 300;
        line-height: 1;
    }

    .mobile-nav-action small {
        font-size: inherit;
        font-weight: inherit;
    }

    .site-footer {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }

    body.modal-open .mobile-bottom-nav {
        transform: translateY(120%);
    }

    .modal {
        z-index: 1090;
    }
}
