/* padding-top removed: it existed only to clear the formerly position:fixed header.
   The header is sticky now, so this was 104px of dead space above the nav. */
body {
    margin: 0;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
    background-color: #f8f9fa;
}

body.has-breadcrumb {
    /* Was 148px: clearance for the header when it was position:fixed, plus the
       breadcrumb. The header is sticky now, so it occupies real space in the flow
       and this was pure dead margin above the bar on every page with a breadcrumb.
       (The no-breadcrumb equivalent, body{padding-top:104px}, is gone too.) */
    padding-top: 0;
}

/* Scoped to the site chrome. As a bare element selector this pinned EVERY <header> on
   the site to the viewport, including in-page section headers. */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-header {
    background-color: #0a1e3d;
    color: white;
    height: 62px;
    transition: height 0.3s ease;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.top-header-content {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-section i {
    font-size: 2rem;
    color: #ffc107;
    transition: font-size 0.3s ease;
}

.logo-section span {
    font-weight: bold;
    font-size: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 24px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
    white-space: nowrap;
    transition:
        gap 0.3s,
        font-size 0.3s;
}

.user-info a,
.user-info span {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

#main-header.scrolled .top-header {
    height: 52px;
}

#main-header.scrolled .logo-section i {
    font-size: 1.5rem;
}

#main-header.scrolled .user-info {
    font-size: 13px;
    gap: 15px;
}

#main-header.scrolled .top-header-content {
    padding: 0 28px;
}

.main-navbar {
    background-color: var(--sma-navy-900);
    padding: 10px 0;
    position: relative;
}

.breadcrumb-content {
    display: flex;
    align-items: center;
}

.library-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #243b53;
}

/* left logo */
.breadcrumb-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.95;
    margin-right: 2px;
}

/* separator */
.breadcrumb-separator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sma-ink-subtle);
    font-size: 12px;
    margin: 0 2px;
}

/* links */
.breadcrumb-link {
    color: #243b53;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.95;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.breadcrumb-link:hover {
    color: #0e2a47;
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* current page */
.breadcrumb-current {
    color: #0f2a43;
    font-weight: 700;
}

.main-navbar-content {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 12px 0;
    display: block;
    transition: opacity 0.2s;
}

.nav-links li a:hover {
    opacity: 0.8;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.search-box {
    position: relative;
}

.search-box.is-open .search-submit i {
    color: #d9e8ff;
}

.search-submit {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.search-submit i {
    color: white;
    font-size: 16px;
}

.search-box input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 7px 16px 7px 40px;
    color: white;
    width: 220px;
    font-size: 13px;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #dbe4ee;
    background: var(--sma-surface);
    box-shadow: 0 12px 28px rgba(15, 42, 67, 0.16);
    z-index: 1200;
}

.search-suggestion-group {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7e90;
    background: var(--sma-surface-sunken);
    border-top: 1px solid #edf2f7;
}

.search-suggestion-group:first-child {
    border-top: none;
}

.search-suggestion-item {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    border-bottom: 1px solid #edf1f6;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover,
.search-suggestion-item:focus {
    background: var(--sma-surface-sunken);
}

.search-suggestion-item-category .search-suggestion-title::before {
    content: "#";
    margin-right: 4px;
    color: #3b82f6;
    font-weight: 800;
}

.search-suggestion-title {
    color: #0f2a43;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.search-suggestion-author {
    color: #5c6f83;
    font-size: 12px;
    margin-top: 2px;
    line-height: 1.3;
}

.search-suggestion-empty {
    padding: 12px;
    color: #5c6f83;
    font-size: 12px;
    border-bottom: 1px solid #edf1f6;
}

.search-suggestion-view-all {
    background: var(--sma-surface-sunken);
}

.search-suggestion-view-all .search-suggestion-title {
    color: var(--sma-info);
    font-weight: 700;
}

.book-mark-text {
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
}

.icon-buttons {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background-color: transparent;
    border: none;
    color: white;
    cursor: pointer;
    position: relative;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #be9b41;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-buttons .dropdown .icon-btn {
    text-decoration: none;
}

.icon-buttons .dropdown-toggle::after,
.icon-btn.no-caret::after {
    display: none !important;
}

.user-notification-menu {
    width: 320px;
    min-width: 320px;
    margin-top: 8px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #dbe4ee;
    box-shadow: 0 10px 24px rgba(15, 42, 67, 0.14);
    overflow: hidden;
    background: var(--sma-surface);
}

.notification-head {
    font-size: 13px;
    font-weight: 800;
    color: #0f2a43;
    padding: 10px 12px;
    border-bottom: 1px solid #e4e9f0;
    background: var(--sma-surface-sunken);
}

.user-notification-menu .dropdown-item.notification-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #eff3f7;
    text-decoration: none;
    white-space: normal;
}

.user-notification-menu .dropdown-item.notification-item:last-child {
    border-bottom: none;
}

.user-notification-menu .dropdown-item.notification-item:hover,
.user-notification-menu .dropdown-item.notification-item:focus {
    background: var(--sma-surface-sunken);
}

.notification-title {
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 2px;
}

.notification-title.notif-approved {
    color: var(--sma-success);
}

.notification-title.notif-rejected {
    color: #b91c1c;
}

.notification-text {
    font-size: 12px;
    color: #243b53;
    font-weight: 600;
    line-height: 1.35;
}

.notification-time {
    margin-top: 2px;
    font-size: 11px;
    color: #6b7e90;
}

.notification-empty {
    padding: 14px 12px;
    font-size: 12px;
    color: #6b7e90;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    margin-right: 15px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

main {
    min-height: 70vh;
}

/* Scoped: a bare footer selector repainted any in-page footer navy. */
footer.sma-footer {
    background-color: var(--sma-navy-900);
    color: white;
    padding: 40px 0;
    margin-top: auto;
    width: 100%;
    /* Ensure footer takes full width */
}

/* 1. This is the wrapper that centers everything */
footer .container-footer {
    max-width: 1280px;
    margin: 0 auto;
    /* Centers the container */
    padding: 0 40px;
    /* Matches your header padding */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 60px;
}

.footer-left {
    flex: 1;
}

.footer-left h2 {
    margin-top: 0;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
}

.footer-left p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 500px;
}

.footer-right {
    display: flex;
    gap: 80px;
    text-align: end;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: white;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    max-width: 1280px;
    margin: 30px auto 0;
    padding: 20px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom-links {
    display: flex;
    gap: 30px;
}

.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-bottom-links a:hover {
    color: white;
}

.copyright {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

@media (max-width: 992px) {
    body.has-breadcrumb {
        padding-top: 0;   /* see the note on the base rule */
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--sma-navy-900);
        flex-direction: column;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        gap: 0;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .nav-links.active {
        max-height: 300px;
        padding-bottom: 10px;
    }

    .nav-links li a {
        padding: 15px 40px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links li a:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .search-box input {
        width: 180px;
    }

    .book-mark-text {
        display: none;
    }

    .main-navbar-content,
    .top-header-content {
        padding: 0 20px;
    }

    .breadcrumb-content {
        min-height: 38px;
    }

    .library-breadcrumb {
        font-size: 13px;
        padding: 8px 0;
        gap: 6px;
    }

    .user-notification-menu {
        width: 290px;
        min-width: 290px;
    }
}

@media (max-width: 768px) {
    body.has-breadcrumb {
        padding-top: 0;   /* see the note on the base rule */
    }

    .user-info {
        gap: 15px;
    }

    .user-info .email-address {
        display: none;
    }

    .search-box input {
        width: 120px;
        padding-left: 35px;
    }

    .search-box input:focus {
        width: 150px;
    }

    .footer-content {
        flex-direction: column;
        gap: 40px;
    }

    .footer-left,
    .footer-right {
        width: 100%;
        text-align: center;
    }

    .footer-left h2 {
        justify-content: center;
    }

    .footer-left p {
        margin: 0 auto;
    }

    .footer-right {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }
}

@media (max-width: 400px) {
    .search-box {
        display: none;
    }
}

.navbar-logo {
    width: 128px;
}

/* Responsive */
@media (max-width: 768px) {
    .breadcrumb-bar {
        padding: 10px 0;
    }

    .library-breadcrumb {
        font-size: 13px;
        gap: 6px;
    }

    .library-breadcrumb .breadcrumb-icon {
        font-size: 15px;
    }
}
