/**
 * SheRNI - Custom Overrides for Bootstrap 5.3
 * Professional Pink Palette
 * -----------------------------------------------
 * Primary:   #b5006a  (deep professional rose)
 * Accent:    #d63384  (Bootstrap pink)
 * Light bg:  #fdf2f7
 * Border:    #f3c8df
 * Text:      #2d0a1a
 */

:root {
    --sherni-primary: #b5006a;
    --sherni-primary-hover: #8c0052;
    --sherni-accent: #d63384;
    --sherni-light: #fdf2f7;
    --sherni-border: #f3c8df;
    --sherni-text-dark: #1a0510;
    --sherni-text-muted: #6b3d55;
    --sherni-bg: #fefcfd;
}

/* ── Global ───────────────────────── */
body {
    background: var(--sherni-bg);
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    color: var(--sherni-text-dark);
    font-size: 0.875rem;
}

a {
    text-decoration: none;
}

/* ── Container padding (Mobile: 1rem, Tablet: 3%, Desktop: 10%) ─ */
.sherni-wrap {
    width: 100%;
    padding-left: 10%;
    padding-right: 10%;
}

@media (max-width: 767.98px) {
    .sherni-wrap {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .sherni-wrap {
        padding-left: 3% !important;
        padding-right: 3% !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .sherni-wrap {
        padding-left: 6% !important;
        padding-right: 6% !important;
    }
}

/* ── Brand Button ──────────────────── */
.btn-sherni {
    background: var(--sherni-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8125rem;
    padding: 8px 18px;
    letter-spacing: 0.02em;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.btn-sherni:hover {
    background: var(--sherni-primary-hover);
    color: #fff;
    box-shadow: 0 4px 12px rgba(181, 0, 106, 0.25);
}

.btn-sherni-outline {
    background: transparent;
    color: var(--sherni-primary);
    border: 1.5px solid var(--sherni-border);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.8125rem;
    padding: 7px 16px;
    transition: all 0.2s ease;
}

.btn-sherni-outline:hover {
    background: var(--sherni-light);
    border-color: var(--sherni-primary);
    color: var(--sherni-primary);
}

/* ── Section Padding ───────────────── */
.sherni-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

/* ── Section Headings ──────────────── */
.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--sherni-text-dark);
    line-height: 1.25;
}

.section-sub {
    font-size: 0.8rem;
    color: var(--sherni-text-muted);
    font-weight: 500;
}

.text-sherni {
    color: var(--sherni-primary) !important;
}

.bg-sherni {
    background: var(--sherni-primary) !important;
}

.bg-sherni-light {
    background: var(--sherni-light) !important;
}

.border-sherni {
    border-color: var(--sherni-border) !important;
}

/* ── Topbar ────────────────────────── */
.sherni-topbar {
    background: linear-gradient(90deg, #7a0048 0%, #b5006a 50%, #7a0048 100%);
    color: #fff;
    font-size: 0.75rem;
    padding: 6px 0;
}

.sherni-topbar a {
    color: #ffd6ee;
}

.sherni-topbar a:hover {
    color: #fff;
}

/* ── Navbar ────────────────────────── */
.sherni-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--sherni-border);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 1px 8px rgba(181, 0, 106, 0.06);
}

.sherni-navbar .navbar-brand {
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.sherni-navbar .navbar-brand .brand-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--sherni-primary);
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.sherni-navbar .navbar-brand .brand-sub {
    font-size: 0.63rem;
    color: #9d3a6e;
    font-weight: 600;
}

.sherni-navbar .nav-link {
    font-size: 1rem;
    font-weight: 600 !important;
    color: #3d1128;
    padding: 6px 9px !important;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.18s ease;
}

.sherni-navbar .nav-link:hover,
.sherni-navbar .nav-link.active {
    color: var(--sherni-primary);
    background: var(--sherni-light);
}

/* Mobile nav */
@media (max-width: 1199.98px) {
    .sherni-navbar .sherni-wrap {
        flex-wrap: wrap !important;
    }

    .sherni-navbar .navbar-collapse {
        width: 100%;
        background: #ffffff;
        border-top: 1px solid var(--sherni-border);
        padding: 10px 0 6px;
        margin-top: 8px;
        box-shadow: none;
    }

    .sherni-navbar .nav-link {
        padding: 8px 12px !important;
        border-radius: 6px;
        font-size: 0.9rem;
        white-space: normal;
    }
}

/* ── Hero Carousel ─────────────────── */
.sherni-hero {
    position: relative;
    overflow: hidden;
    background: #1a0510;
    min-height: 440px;
}

.sherni-hero .carousel-item {
    min-height: 440px;
}

.sherni-hero .carousel-item img {
    width: 100%;
    height: 440px;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.65);
}

.sherni-hero .carousel-caption {
    text-align: left;
    left: 8%;
    right: 8%;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
}

.sherni-hero .hero-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffd6ee;
    background: rgba(181, 0, 106, 0.6);
    border: 1px solid rgba(255, 166, 210, 0.3);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    backdrop-filter: blur(8px);
}

.sherni-hero .carousel-caption h2 {
    font-size: 1.85rem;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sherni-hero .carousel-caption p {
    font-size: 0.85rem;
    color: #f0d0e6;
    max-width: 520px;
    line-height: 1.6;
}

@media (min-width: 992px) {
    .sherni-hero {
        min-height: 500px;
    }

    .sherni-hero .carousel-item img {
        height: 500px;
    }

    .sherni-hero .carousel-item {
        min-height: 500px;
    }

    .sherni-hero .carousel-caption h2 {
        font-size: 2.2rem;
    }
}

.sherni-hero .carousel-control-prev,
.sherni-hero .carousel-control-next {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
}

/* ── Search Bar ────────────────────── */
.sherni-searchbar {
    background: #fff;
    border: 1px solid var(--sherni-border);
    border-radius: 14px;
    padding: 20px 24px;
    margin-top: -32px;
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 24px rgba(181, 0, 106, 0.08);
}

.sherni-searchbar .form-control,
.sherni-searchbar .form-select {
    font-size: 0.8125rem;
    border-color: #e8c8d8;
    border-radius: 8px;
    padding: 9px 12px;
    color: #1a0510;
    background: #fdf9fb;
}

.sherni-searchbar .form-control:focus,
.sherni-searchbar .form-select:focus {
    border-color: var(--sherni-primary);
    box-shadow: 0 0 0 3px rgba(181, 0, 106, 0.12);
}

/* ── Cards ─────────────────────────── */
.sherni-card {
    border: 1px solid var(--sherni-border);
    border-radius: 12px;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.sherni-card:hover {
    box-shadow: 0 6px 20px rgba(181, 0, 106, 0.1);
    transform: translateY(-2px);
    border-color: #e690bb;
}

/* ── Impact Stats ──────────────────── */
.stat-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--sherni-light);
    border: 1px solid var(--sherni-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sherni-primary);
    flex-shrink: 0;
}

/* ── Subject Category Icons ────────── */
.cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--sherni-light);
    border: 1px solid var(--sherni-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sherni-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.cat-card:hover .cat-icon {
    background: var(--sherni-primary);
    color: #fff;
}

/* ── Scholar Cards ─────────────────── */
.scholar-avatar {
    width: 110px;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--sherni-border);
    background: var(--sherni-light);
    flex-shrink: 0;
}

.scholar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.field-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.67rem;
    font-weight: 600;
    background: var(--sherni-light);
    color: var(--sherni-primary);
    border: 1px solid var(--sherni-border);
    border-radius: 5px;
    padding: 2px 7px;
}

/* ── Expert Carousel ───────────────── */
.expert-track-wrapper {
    overflow: hidden;
}

.expert-track-wrapper {
    overflow: hidden;
    width: 100%;
}

.expert-track {
    display: flex;
    gap: 14px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}

.expert-card-item {
    width: calc((100% - 4 * 14px) / 5);
    min-width: 210px;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .expert-card-item {
        width: calc(100% - 20px);
        min-width: calc(100% - 20px);
        max-width: calc(100% - 20px);
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .expert-card-item {
        width: calc((100% - 14px) / 2);
        min-width: calc((100% - 14px) / 2);
        max-width: calc((100% - 14px) / 2);
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .expert-card-item {
        width: calc((100% - 2 * 14px) / 3);
        min-width: calc((100% - 2 * 14px) / 3);
    }
}

.expert-photo {
    height: 140px;
    width: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 10px 10px 0 0;
}

/* ── Feed Cards ────────────────────── */
.feed-photo {
    height: 140px;
    width: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px 10px 0 0;
}

.feed-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.95);
    color: var(--sherni-primary);
    border: 1px solid var(--sherni-border);
    border-radius: 5px;
    padding: 2px 7px;
}

/* ── Product Cards ─────────────────── */
.product-header {
    background: linear-gradient(135deg, var(--sherni-light) 0%, #faedf5 100%);
    border-bottom: 1px solid var(--sherni-border);
    padding: 14px 16px;
}

.product-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--sherni-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.metric-box {
    background: var(--sherni-light);
    border: 1px solid var(--sherni-border);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

/* ── Scholarship Ticker ────────────── */
.ticker-window {
    height: 280px;
    overflow: hidden;
    position: relative;
}

@keyframes scrollUp {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

.ticker-inner {
    animation: scrollUp 22s linear infinite;
}

.ticker-inner:hover {
    animation-play-state: paused;
}

.scholarship-item {
    background: var(--sherni-light);
    border: 1px solid var(--sherni-border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

/* ── Footer ─────────────────────────── */
.sherni-footer {
    background: linear-gradient(160deg, #3a0022 0%, #6b003e 50%, #3a0022 100%);
    color: #e8c4d8;
    padding: 24px 0 12px;
    border-top: 1px solid rgba(255, 166, 210, 0.15);
}

.sherni-footer h6 {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ffc2e4;
    margin-bottom: 8px;
}

.sherni-footer a {
    color: #d4a0bc;
    font-size: 0.74rem;
    display: block;
    padding: 1px 0;
    transition: color 0.15s;
}

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

.footer-divider {
    border-color: rgba(255, 166, 210, 0.15);
}

/* ── Dignitary Cards ───────────────── */
.dignitary-photo {
    width: 130px;
    height: 145px;
    object-fit: cover;
    object-position: top;
    border-radius: 10px;
    border: 1px solid var(--sherni-border);
    flex-shrink: 0;
}

/* ── Vertical Pill ─────────────────── */
.profile-pill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid var(--sherni-border);
    border-radius: 999px;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 200px;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(181, 0, 106, 0.06);
    writing-mode: vertical-rl;
}

/* ── Modal ─────────────────────────── */
.sherni-modal .modal-content {
    border: 1px solid var(--sherni-border);
    border-radius: 16px;
}

/* ── Bar Chart ─────────────────────── */
.v_bar_h25 {
    height: 25% !important;
}

.v_bar_h35 {
    height: 35% !important;
}

.v_bar_h20 {
    height: 20% !important;
}

.v_bar_h45 {
    height: 45% !important;
}

.v_bar_h30 {
    height: 30% !important;
}

.v_bar_h60 {
    height: 60% !important;
}

.v_bar_h100 {
    height: 100% !important;
}

.v_bar_h40 {
    height: 40% !important;
}

.v_bar_h75 {
    height: 75% !important;
}

/* Profile detail helpers */
.bio-text {
    font-size: 0.82rem;
    color: var(--sherni-text-muted);
}

.flex-grow-1 {
    flex-grow: 1 !important;
}

.heading-muted-sm {
    font-size: 0.85rem;
    font-weight: 700;
    color: #3d1128;
    margin-bottom: 8px;
}

.verified-lock-icon {
    color: #12b76a;
}

.meta-icon-shrink {
    flex-shrink: 0;
}

.meta-tag-nowrap {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Responsive ─────────────────────── */
@media (max-width: 575.98px) {
    .sherni-hero .carousel-caption h2 {
        font-size: 1.35rem;
    }

    .section-title {
        font-size: 1.15rem;
    }

    .sherni-hero .carousel-item img {
        height: 340px;
    }

    .sherni-hero {
        min-height: 340px;
    }

    .sherni-hero .carousel-caption {
        left: 4%;
        right: 4%;
    }
}

.container,
.container-fluid,
.ed-hero-inner,
.sherni-section {
    max-width: 93% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ── Larger Avatar Image & Detail Space ───────── */
.avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.avatar-img {
    width: 100%;
    max-width: 200px;
    height: 200px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.avatar-initials {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sherni-light);
    color: var(--sherni-primary);
    font-size: 3rem;
    font-weight: 700;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

/* ── Increased Expert Card Height ───────────────── */
.expert-card {
    min-height: 180px;
    /* increase overall card height */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.expert-photo {
    height: 180px;
    /* larger photo */
}

/* ── Scientist of the Month (SoM) Cards ───────────────── */
.som-card {
    background: linear-gradient(0deg, #c94dbf 0%, #c70b768a 100%);
    border: 1px solid rgba(243, 200, 223, 0.22);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(26, 5, 16, 0.12);
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.som-card:hover {
    transform: translateY(-5px);
    border-color: rgba(243, 200, 223, 0.55);
    box-shadow: 0 16px 32px rgba(181, 0, 106, 0.25);
}

.som-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #b5006a 0%, #e690bb 50%, #b5006a 100%);
    opacity: 0.8;
}

.som-avatar-frame {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(243, 200, 223, 0.45) 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    transition: transform 0.28s ease;
}

.som-card:hover .som-avatar-frame {
    transform: scale(1.05);
}

.som-avatar-frame img {
    border-radius: 50%;
}

.som-name {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.som-discipline {
    color: #f7cce4;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.btn-som {
    background: #87084ea1;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 7px 18px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.22s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-som:hover {
    background: #b5006a;
    color: #ffffff;
    border-color: #ffd6ee;
    box-shadow: 0 4px 14px rgba(181, 0, 106, 0.5);
    transform: translateY(-1px);
}

.btn-som i {
    font-size: 0.62rem;
    transition: transform 0.2s ease;
}

.btn-som:hover i {
    transform: translateX(3px);
}

.som-badge-watermark {
    position: absolute;
    bottom: -15px;
    right: -15px;
    width: 105px;
    height: 105px;
    color: #ffffff;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.som-card:hover .som-badge-watermark {
    transform: scale(1.08) rotate(6deg);
}

/* ── Download Navbar Dropdown (Hover on Desktop) ────────── */
.download-dropdown {
    position: relative;
}

.download-dropdown .dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.2em;
    vertical-align: 0.2em;
    content: "";
    border-top: 0.28em solid;
    border-right: 0.28em solid transparent;
    border-bottom: 0;
    border-left: 0.28em solid transparent;
    font-size: 0.75rem;
    color: inherit;
    transition: transform 0.2s ease;
}

.download-dropdown .dropdown-menu {
    border-radius: 10px;
    border: 1px solid var(--sherni-border);
    box-shadow: 0 10px 25px rgba(181, 0, 106, 0.12);
    background: #ffffff;
    z-index: 1050;
}

.download-dropdown .dropdown-item {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sherni-text-dark);
    transition: all 0.18s ease;
    border-radius: 6px;
    margin: 2px 4px;
    width: calc(100% - 8px);
}

.download-dropdown .dropdown-item:hover {
    background: var(--sherni-light);
    color: var(--sherni-primary) !important;
    transform: translateX(2px);
}

@media (min-width: 1200px) {
    .download-dropdown:hover>.dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .download-dropdown:hover .dropdown-toggle::after {
        transform: rotate(180deg);
    }

    .download-dropdown>.dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        transform: translateY(6px);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    }
}

/* ── Discipline Selector & Bar for Top Shernies ────── */
.discipline-bar {
    transition: all 0.25s ease;
}

.discipline-menu-item {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sherni-text-dark);
    padding: 8px 14px;
    border-radius: 8px;
    margin: 2px 6px;
    width: calc(100% - 12px);
    transition: all 0.18s ease;
}

.discipline-menu-item:hover {
    background: var(--sherni-light);
    color: var(--sherni-primary) !important;
    transform: translateX(2px);
}

.discipline-menu-item.active {
    background: var(--sherni-primary) !important;
    color: #ffffff !important;
    font-weight: 700;
}

.discipline-menu-item.active .discipline-icon {
    color: #ffffff !important;
}