/* ==========================================================================
   Site Header
   -------------------------------------------------------------------------- */

/* Dropdown (notifications, user menu) ------------------------------------- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    background-color: #fff;
    min-width: 340px;
    max-width: 380px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.15), 0 2px 6px rgba(15, 23, 42, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    z-index: 1000;
    overflow: visible; /* allow the ::before pointer to show */
    text-align: left !important;  /* force left alignment, countering global .align-right */
    background-color: #fff !important;
    position: absolute !important;
    animation: notifPanelFadeIn 0.18s ease-out;
}

/* Bridge hover gap so the panel does not disappear while the cursor travels
   from the greeting to the dropdown. */
.dropdown-content::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

/* Up-pointing triangle that ties the panel to the header trigger. */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 22px;
    width: 12px;
    height: 12px;
    background: #fff; /* match panel background instead of hardcoded grey */
    transform: rotate(45deg);
    border-top-left-radius: 2px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    border-left: 1px solid rgba(15, 23, 42, 0.06);
    z-index: 1;
}

/* Show on hover AND keyboard-focus (accessibility) */
.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
}

@keyframes notifPanelFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Notification panel (header dropdown)
   -------------------------------------------------------------------------- */
.notif-panel {
    padding: 0;
    position: absolute;
    text-align: left !important;
}

/* Compact single-line header bar */
.notif-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #3a4e46;
    color: #fff;
    position: relative;
    z-index: 2;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    min-height: 38px;
}

.notif-panel__heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    flex: 1 1 auto;
}

.notif-panel__title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

.notif-panel__divider {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    line-height: 1;
}

.notif-panel__subtitle {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-panel__actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.notif-panel__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease;
}

.notif-panel__action i { font-size: 12px; line-height: 1; }

.notif-panel__action:hover:not(:disabled),
a.notif-panel__action:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    text-decoration: none;
}

.notif-panel__action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Scrollable list */
.notif-panel__list {
    max-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.notif-panel__list::-webkit-scrollbar        { width: 5px; }
.notif-panel__list::-webkit-scrollbar-thumb  { background: #cbd5e1; border-radius: 3px; }
.notif-panel__list::-webkit-scrollbar-track  { background: transparent; }

/* Individual item */
.notif-item {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.notif-item:last-child { border-bottom: 0; }

.notif-item:hover { background: #f8fafc; }

.notif-item__link {
    flex: 1 1 auto;
    display: flex !important;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    text-align: left !important;
}

.notif-item__link:hover { text-decoration: none; color: inherit; }

/* Avatar — either user's PP (img) or a branded fallback circle. */
.notif-item__avatar {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    object-fit: cover;
}

.notif-item__avatar--user {
    background: #e2e8f0;
    color: #fff;
}

img.notif-item__avatar--user {
    object-fit: cover;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.notif-item__avatar--fallback {
    background: #f3f4f6;
    color: #9ca3af;
    border: 1px solid #d1d5db;
}

.notif-item__avatar-svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.notif-item__avatar--brand {
    background: #3a4e46;
    color: #fff;
}

.notif-item__avatar--brand i {
    font-size: 15px;
    line-height: 1;
}

.notif-item__body {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 18px; /* leaves room for dot + delete */
    display: block;
}

.notif-item__title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #1a2d3d;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.notif-item:not(.is-unread) .notif-item__title { color: #334155; font-weight: 600; }

.notif-item__message {
    margin: 1px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #64748b;
    display: -webkit-box;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-item:not(.is-unread) .notif-item__message { color: #94a3b8; }

.notif-item__time {
    display: block;
    margin: 0;
    font-size: 10.5px;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.1;
}

/* Unread dot */
.notif-item__dot {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1abc9c;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.15);
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* Delete button — appears on hover, replacing the dot position */
.notif-item__delete {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%) scale(0.85);
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, color 0.15s ease;
    font-size: 13px;
}

.notif-item:hover .notif-item__delete,
.notif-item:focus-within .notif-item__delete {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.notif-item:hover .notif-item__dot,
.notif-item:focus-within .notif-item__dot {
    opacity: 0;
}

.notif-item__delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Empty state */
.notif-empty {
    padding: 36px 20px 38px;
    text-align: center;
    color: #64748b;
}

.notif-empty__icon {
    font-size: 38px;
    color: #cbd5e1;
    margin-bottom: 8px;
    display: inline-block;
}

.notif-empty__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.notif-empty__hint {
    margin: 2px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

/* Footer — centered "see all" link */
.notif-panel__footer {
    display: block;
    text-align: center;
    padding: 9px 14px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    font-size: 12.5px;
    font-weight: 700;
    color: #5d5d5d;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.notif-panel__footer:hover {
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.notif-panel__footer i {
    transition: transform 0.2s ease;
    font-size: 11px;
    margin-left: 4px;
    vertical-align: middle;
}

.notif-panel__footer:hover i { transform: translateX(3px); }

/* Responsive — drop panel to near-fullwidth on small screens */
@media (max-width: 520px) {
    .dropdown-content.notif-panel {
        position: fixed;
        top: 64px;
        left: 8px;
        right: 8px;
        min-width: 0;
        max-width: none;
    }
}

/* Promo bar --------------------------------------------------------------- */
.pv-promo-bar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 9px 48px 9px 20px;
    background: linear-gradient(90deg, #e38a31 0%, #d97a1e 100%);
    color: #fff;
    font-family: "Jost", sans-serif;
    font-size: 14px;
    line-height: 1.3;
    position: relative;
    z-index: 1100;
    animation: pvPromoSlide 0.35s ease-out;
    overflow: hidden;
}

.pv-promo-bar::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 10% 50%, rgba(255, 255, 255, 0.18) 0 2px, transparent 3px),
        radial-gradient(circle at 92% 60%, rgba(255, 255, 255, 0.15) 0 2px, transparent 3px);
    background-size: 140px 140px;
    opacity: 0.6;
    pointer-events: none;
}

.pv-promo-bar.is-visible {
    display: flex;
}

.pv-promo-bar__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 15px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.pv-promo-bar__text {
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.pv-promo-bar__text b {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.pv-promo-bar__cta {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #fff;
    background: rgba(0, 0, 0, 0.18);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.pv-promo-bar__cta:hover {
    background: rgba(0, 0, 0, 0.32);
    transform: translateX(2px);
    color: #fff;
}

.pv-promo-bar__cta i {
    font-size: 13px;
    transition: transform 0.2s ease;
}

.pv-promo-bar__cta:hover i {
    transform: translateX(2px);
}

.pv-promo-bar__close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 2;
}

.pv-promo-bar__close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) rotate(90deg);
}

@keyframes pvPromoSlide {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* Badges (shared) --------------------------------------------------------- */
/* Small inline pill badge used for unread/notification counts in menu items */
.count-badge {
    display: none;
    background: #e74c3c;
    color: #fff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    margin-left: 5px;
}

.count-badge.count-badge--warning {
    background: #f39c12;
}

.count-badge.is-visible {
    display: inline-block;
}

/* Circular pulse badge shown on profile greeting */
.notification-badge {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    color: #fff;
    border-radius: 50%;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 600;
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
    animation: pulse 2s infinite;
    z-index: 10;
    cursor: help;
    transition: all 0.3s ease;
}

.notification-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.6);
    animation-play-state: paused;
}

.notification-badge[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 37, 41, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    margin-bottom: 8px;
    animation: tooltipFadeIn 0.3s ease-in-out;
}

.notification-badge[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(33, 37, 41, 0.95);
    margin-bottom: 3px;
    z-index: 1000;
    animation: tooltipFadeIn 0.3s ease-in-out;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.greeting-wrapper {
    position: relative;
    display: inline-block;
}

@keyframes pulse {
    0%   { transform: scale(1);    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3); }
    50%  { transform: scale(1.05); box-shadow: 0 3px 8px rgba(255, 71, 87, 0.5); }
    100% { transform: scale(1);    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3); }
}

/* User menu bits ---------------------------------------------------------- */
.profile-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.profile-icon--svg {
    height: 18px;
    width: auto;
}

.user-menu-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Auth modal helpers ------------------------------------------------------ */
.password-field {
    position: relative;
}

.password-field .toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.password-errors,
.password-match-error {
    text-align: left;
    margin-top: 10px;
    font-size: 14px;
}

.password-errors { display: none; }

.password-match-error {
    margin-top: -10px;
    margin-bottom: 10px;
}

.generate-password-row {
    margin-bottom: 15px;
}

.generate-password-link {
    font-size: 14px;
    text-decoration: none;
    color: #007bff;
}

.recaptcha-wrapper {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.login-error,
.login-captcha-error {
    color: red;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    display: none;
}

.login-error.is-visible,
.login-captcha-error.is-visible {
    display: block;
}

/* Site brand -------------------------------------------------------------- */
.site__brand.header {
    display: contents;
}

/* Header layout helpers --------------------------------------------------- */
.header-col-left {
    padding-top: 10px;
    min-width: 91px;
}

.header-col-right {
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 767px) {
    .pv-promo-bar {
        padding: 8px 40px 8px 14px;
        font-size: 13px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .pv-promo-bar__icon {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }

    .pv-promo-bar__cta {
        padding: 5px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .pv-promo-bar {
        justify-content: flex-start;
        text-align: left;
    }

    .pv-promo-bar__text {
        flex: 1;
        min-width: 0;
    }

    .pv-promo-bar__cta-label-long { display: none; }
}

@media (min-width: 481px) {
    .pv-promo-bar__cta-label-short { display: none; }
}

@media (max-width: 490px) {
    #logo-small { display: block !important; }
    #logo { display: none !important; }

    div.site__brand.header { display: inline-block !important; }

    .profile-name { font-size: 13px; }

    .profile-icon {
        width: 30px !important;
        height: 30px !important;
    }

    .right-header__search { display: contents !important; }

    #header { max-height: 60px !important; }

    #header .col-5 {
        -ms-flex: 0 0 30%;
        flex: 0 0 30%;
        max-width: 30%;
    }

    #header .col-7 {
        -ms-flex: 0 0 70%;
        flex: 0 0 70%;
        max-width: 70%;
    }
}

@media (min-width: 992px) and (max-width: 1452px) {
    .right-header__button {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .right-header {
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .right-header__search { flex-shrink: 1 !important; }

    .right-header__login {
        flex-shrink: 0 !important;
        margin-right: 10px !important;
    }

    .right-header__button { flex-shrink: 0 !important; }
}

@media (min-width: 1200px) {
    #header > div > div > div.col-xl-6.col-7 {
        width: none !important;
    }
}
