@import url("tokens.css");

/* Navbar styles - the same teal gradient band as the marketing site's
   header, so signing in doesn't feel like landing on a different product.
   Everything on the band is white. */

.navbar {
    /* Solid fallback under the gradient: browsers that tint the status bar
       / Dynamic Island area from a fixed header read background-color, not
       the gradient image */
    background-color: #3A9E84;
    background-image: var(--header-gradient);
    color: #fff;
    /* Same box as the marketing header (site.css .site-header/.site-nav):
       44px mark + 16px/18px padding = 78px, content on a centred 1240px
       track with the same responsive gutter */
    padding: 16px max(clamp(20px, 5vw, 72px), calc((100% - 1240px) / 2)) 18px;
    border-radius: 0 0 clamp(24px, 3vw, 36px) clamp(24px, 3vw, 36px);
    box-shadow: 0 8px 24px rgba(20, 50, 60, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
}

.navbar-logo {
    flex: 1; /* Takes up remaining space */
}

.navbar-profile {
    margin-left: auto; /* Pushes the element to the right */
}

.navbar .logo-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.navbar .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.88);
    display: grid;
    place-items: center;
    flex: none;
}

.navbar .brand-mark img {
    width: 28px;
    height: 28px;
    display: block;
}

.navbar .brand-name {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
    white-space: nowrap;
}

.navbar-links {
    margin-left: auto;
}

.navbar-links a {
    margin-right: 40px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
}

.navbar-button {
    padding: 10px 18px;
    background-color: #fff;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent-fill);
    border: none;
    border-radius: var(--radius-control);
    cursor: pointer;
    width: 120px;
}

/* Notifications bell (top-right, left of the account menu) */
.navbar-notifications {
    position: relative;
    margin-right: 10px;
}

.notification-bell-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    position: relative;
    transition: background-color 0.15s ease;
}

.notification-bell-toggle:hover,
.navbar-notifications.open .notification-bell-toggle {
    background-color: rgba(255, 255, 255, 0.16);
}

.notification-bell-toggle svg {
    display: block;
    height: 24px;
    width: 24px;
}

.notification-bell-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--color-danger);
    border: 2px solid #37957F;
    display: none;
}

.navbar-notifications.has-unread .notification-bell-dot {
    display: block;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: 420px;
    overflow-y: auto;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(30, 69, 82, 0.14);
    padding: 6px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.notification-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 16px;
    width: 11px;
    height: 11px;
    background-color: var(--color-surface);
    border-left: 1px solid var(--color-border-subtle);
    border-top: 1px solid var(--color-border-subtle);
    transform: rotate(45deg);
}

.navbar-notifications.open .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.notification-mark-all-read {
    background: none;
    border: none;
    color: var(--color-accent-fill);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 2px;
}

.notification-mark-all-read:disabled {
    opacity: 0.5;
    cursor: default;
}

.notification-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-primary-dark);
}

.notification-item:hover {
    background-color: var(--color-surface-muted);
}

.notification-item.unread {
    background-color: var(--color-success-bg);
}

.notification-item-title {
    font-weight: 600;
    font-size: 0.86rem;
}

.notification-item-body {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.notification-item-time {
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.notification-empty {
    padding: 18px 12px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* User menu (top-right account dropdown) */
.user-menu {
    position: relative;
    margin-left: auto;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.user-menu-toggle:hover,
.user-menu.open .user-menu-toggle {
    background-color: rgba(255, 255, 255, 0.16);
}

/* profile.png is a black outline icon; turn it white for the gradient band */
.user-menu-toggle .profile {
    height: 34px;
    width: 34px;
    display: block;
    filter: brightness(0) invert(1);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 190px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(30, 69, 82, 0.14);
    padding: 6px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

/* Little caret pointing up at the toggle */
.user-menu-dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 16px;
    width: 11px;
    height: 11px;
    background-color: var(--color-surface);
    border-left: 1px solid var(--color-border-subtle);
    border-top: 1px solid var(--color-border-subtle);
    transform: rotate(45deg);
}

.user-menu.open .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: block;
    position: relative;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--color-primary-dark);
    text-decoration: none;
    white-space: nowrap;
    border-radius: 10px;
    transition: background-color 0.12s ease;
}

.user-menu-item:hover {
    background-color: var(--color-surface-muted);
}

.user-menu-item-danger {
    color: var(--color-danger);
}

.user-menu-item-danger:hover {
    background-color: #FDECEC;
}