/* ===========================================
   NOTIFICATION BELL + DROPDOWN
   Matches the dark gradient + gold accent design language
   =========================================== */

.notif-bell-wrapper {
    position: relative;
    display: inline-flex;
}

.notif-bell {
    color: rgba(255, 255, 255, 0.85);
    position: relative;
}

.notif-bell:hover,
.notif-bell.active {
    color: white;
}

.notif-bell svg {
    width: 1.5rem;
    height: 1.5rem;
}

.notif-badge {
    position: absolute;
    top: 0.1rem;
    right: 0.1rem;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    background: linear-gradient(135deg, #ffd700, #ff9600);
    color: #1c1b1f;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.55), 0 0 0 2px var(--color-primary, #1c1b1f);
    pointer-events: none;
    font-family: "Inter", "Lexend Deca", sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    width: 22rem;
    max-width: 90vw;
    background: linear-gradient(145deg, rgba(39, 38, 44, 0.98), rgba(28, 27, 31, 0.99));
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: "Lexend Deca", sans-serif;
    backdrop-filter: blur(8px);
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.notif-dropdown-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    letter-spacing: 0.01em;
}

.notif-mark-all {
    background: transparent;
    border: 1px solid rgba(255, 215, 0, 0.25);
    color: #ffd700;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-family: inherit;
    transition: all 200ms ease;
}

.notif-mark-all:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
}

.notif-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 24rem;
    overflow-y: auto;
}

.notif-list::-webkit-scrollbar {
    width: 6px;
}
.notif-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.notif-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 180ms ease;
    position: relative;
}

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

.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notif-item.unread {
    background: rgba(255, 215, 0, 0.05);
}

.notif-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #ffd700, #ff9600);
}

.notif-item.unread:hover {
    background: rgba(255, 215, 0, 0.1);
}

.notif-icon {
    flex: 0 0 auto;
    font-size: 1.1rem;
    line-height: 1.4;
}

.notif-body {
    flex: 1;
    min-width: 0;
}

.notif-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.notif-title {
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.35;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-time {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

.notif-snippet {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notif-dropdown-footer {
    padding: 0.6rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.notif-view-all {
    color: #ffd700;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 200ms ease;
}

.notif-view-all:hover {
    color: #ffe04d;
    text-decoration: underline;
}

@media screen and (max-width: 640px) {
    .notif-dropdown {
        width: 19rem;
        right: -3rem;
    }
}

/* ===========================================
   /notifications PAGE
   Matches leaderboard / profile container pattern
   =========================================== */

main.page-notifications,
.page-notifications {
    min-height: calc(100vh - 4rem);
    padding: 2rem;
    display: flex !important;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    background-color: var(--color-background);
    color: var(--color-on-background);
    font-family: "Lexend Deca", sans-serif;
    grid-column: 1 / -1;
    width: 100%;
    box-sizing: border-box;
}

.notifications-container {
    background: linear-gradient(145deg, rgba(39, 38, 44, 0.95), rgba(28, 27, 31, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.notifications-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notifications-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: white;
    letter-spacing: 0.01em;
}

.notifications-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    margin: 0;
}

.page-notifications-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.notif-page-btn {
    background: transparent;
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 200ms ease;
}

.notif-page-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.55);
    transform: translateY(-1px);
}

.notif-page-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.notif-page-item {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 200ms ease;
    cursor: pointer;
    position: relative;
}

.notif-page-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.notif-page-item.unread {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.02) 100%);
    border-color: rgba(255, 215, 0, 0.25);
}

.notif-page-item.unread:hover {
    background: linear-gradient(180deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 215, 0, 0.04) 100%);
    border-color: rgba(255, 215, 0, 0.4);
}

.notif-page-icon {
    font-size: 1.4rem;
    line-height: 1.4;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-page-item.unread .notif-page-icon {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 150, 0, 0.12));
    border-color: rgba(255, 215, 0, 0.35);
}

.notif-page-body {
    flex: 1;
    min-width: 0;
}

.notif-page-title-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
    margin-bottom: 0.3rem;
}

.notif-page-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

.notif-page-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    font-family: "JetBrains Mono", monospace;
}

.notif-page-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

.notif-page-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
    align-self: flex-start;
}

.notif-page-delete {
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 180ms ease;
}

.notif-page-delete:hover {
    color: #ff6b6b;
    background: rgba(255, 100, 100, 0.1);
    border-color: rgba(255, 100, 100, 0.3);
}

.notif-page-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
}

.notif-page-empty p {
    margin: 0 0 1rem;
}

@media screen and (max-width: 640px) {
    .page-notifications {
        padding: 1rem;
    }
    .notifications-container {
        padding: 1.25rem;
        border-radius: 12px;
    }
    .notifications-header h1 {
        font-size: 1.5rem;
    }
    .notif-page-item {
        padding: 0.85rem;
    }
}

/* ===========================================
   ADMIN NOTIFICATIONS TAB
   =========================================== */

.admin-notif-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.admin-notif-card {
    background: linear-gradient(145deg, rgba(39, 38, 44, 0.6), rgba(28, 27, 31, 0.4));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
}

.admin-notif-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: white;
    font-weight: 600;
}

.admin-notif-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
}

.admin-notif-form label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    display: block;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.admin-notif-form input,
.admin-notif-form textarea,
.admin-notif-form select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 180ms ease, background 180ms ease;
}

.admin-notif-form select {
    /* Hint the browser to render the native option list in dark mode,
       so it matches the rest of the form instead of defaulting to white. */
    color-scheme: dark;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1L6 6L11 1' stroke='%23ffd700' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

.admin-notif-form select option {
    background: #1c1b1f;
    color: white;
}

.admin-notif-form input:focus,
.admin-notif-form textarea:focus,
.admin-notif-form select:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.admin-notif-form input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-notif-form textarea {
    min-height: 5.5rem;
    resize: vertical;
}

.admin-notif-form .actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.admin-notif-send-btn,
.admin-rule-save-btn {
    background: linear-gradient(135deg, #ffd700, #ff9600);
    color: #1c1b1f;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.admin-notif-send-btn:hover:not(:disabled),
.admin-rule-save-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 215, 0, 0.3);
}

.admin-notif-send-btn:disabled,
.admin-rule-save-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.admin-rule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.admin-rule-table th,
.admin-rule-table td {
    text-align: left;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

.admin-rule-table th {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.02);
}

.admin-rule-table td code {
    background: rgba(255, 215, 0, 0.08);
    color: #ffd700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-family: "JetBrains Mono", monospace;
}

.admin-rule-status-on {
    color: #4ade80;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-rule-status-off {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-rule-actions {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.admin-rule-action-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
    transition: all 180ms ease;
}

.admin-rule-action-btn:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.35);
    color: #ffd700;
}

.admin-rule-action-btn.danger:hover {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
}

.admin-notif-msg {
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.admin-notif-msg.ok {
    background: rgba(74, 222, 128, 0.1);
    color: #86efac;
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.admin-notif-msg.err {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.25);
}

/* On mobile the bell wrapper sits inside the header, near the right edge. The
   absolute-positioned dropdown anchored to its right edge would spill off the
   left side on narrow phones, so pin it to the viewport instead. */
@media screen and (max-width: 768px) {
    .nav__mobile-bell .notif-dropdown {
        position: fixed;
        top: calc(3.5rem + 0.4rem);
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
    }
}
