/* Shared notification dropdown (student dashboard + website header) */

.ddt-dash-notif {
    position: relative;
    overflow: visible;
}

.ddt-dash-notif .btn-round {
    position: relative;
    overflow: visible;
    transition: transform 180ms ease-out, box-shadow 180ms ease-out, background-color 180ms ease-out;
}

.ddt-dash-notif .btn-round:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.ddt-dash-notif .btn-round:active {
    transform: translateY(0);
}

.ddt-dash-notif__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f87171, #ef4444);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.55);
    z-index: 5;
    pointer-events: none;
}

.ddt-dash-notif__badge--pulse {
    animation: ddt-dash-notif-pulse 2s ease-in-out infinite;
}

[data-bs-theme='dark'] .ddt-dash-notif__badge {
    border-color: #18181b;
}

@keyframes ddt-dash-notif-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes ddt-dash-notif-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ddt-dash-notif__menu {
    width: min(380px, calc(100vw - 24px));
    min-width: 0;
    max-width: calc(100vw - 24px);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 0.5rem !important;
    padding: 0;
    z-index: 1080;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.ddt-dash-notif__panel {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(24, 24, 27, 0.94);
    transform-origin: top right;
}

.ddt-dash-notif__menu.show .ddt-dash-notif__panel {
    animation: ddt-dash-notif-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ddt-dash-notif__panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #22d3ee);
    z-index: 2;
}

.ddt-dash-notif__menu .card-header {
    padding: 1rem 1rem 0.75rem;
    gap: 0.55rem;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

.ddt-dash-notif__head-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.ddt-dash-notif__head-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.16);
    color: #a5b4fc;
    flex-shrink: 0;
}

.ddt-dash-notif__menu .card-header h6 {
    font-size: 0.98rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.ddt-dash-notif__menu .card-header .badge {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.38rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #f87171, #ef4444) !important;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.28);
}

.ddt-dash-notif__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ddt-dash-notif__action {
    border: 0;
    background: rgba(99, 102, 241, 0.14);
    padding: 0.28rem 0.7rem;
    min-height: 32px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.2;
    color: #c7d2fe;
    cursor: pointer;
    transition: background-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out, opacity 160ms ease-out;
}

.ddt-dash-notif__action:hover,
.ddt-dash-notif__action:focus-visible {
    background: rgba(99, 102, 241, 0.26);
    color: #eef2ff;
    text-decoration: none;
    outline: none;
    transform: translateY(-1px);
}

.ddt-dash-notif__action--muted {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
    font-weight: 600;
}

.ddt-dash-notif__action--muted:hover,
.ddt-dash-notif__action--muted:focus-visible {
    background: rgba(248, 113, 113, 0.16);
    color: #fecaca;
}

.ddt-dash-notif__action:disabled {
    opacity: 0.55;
    cursor: default;
    text-decoration: none;
    transform: none;
}

.ddt-dash-notif__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}

.ddt-dash-notif__body {
    overflow-x: hidden;
    max-height: min(52vh, 360px);
    overflow-y: auto;
}

.ddt-dash-notif__item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 0 !important;
    white-space: normal;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
    transition: background-color 180ms ease-out, opacity 200ms ease-in, transform 200ms ease-in;
}

.ddt-dash-notif__item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 999px;
    background: #818cf8;
    opacity: 0;
    transform: scaleY(0.45);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.ddt-dash-notif__item:hover,
.ddt-dash-notif__item:focus-within {
    background: rgba(99, 102, 241, 0.1);
}

.ddt-dash-notif__item--unread {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.16), rgba(99, 102, 241, 0.04) 72%);
}

.ddt-dash-notif__item--unread::before {
    opacity: 1;
    transform: scaleY(1);
}

.ddt-dash-notif__item--leaving {
    opacity: 0;
    transform: translateX(14px);
    pointer-events: none;
}

.ddt-dash-notif__link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem 0.35rem 0.8rem 1rem;
    color: inherit;
    text-decoration: none;
}

.ddt-dash-notif__link:hover,
.ddt-dash-notif__link:focus {
    color: inherit;
    text-decoration: none;
}

.ddt-dash-notif__link:focus-visible {
    outline: 2px solid rgba(99, 102, 241, 0.55);
    outline-offset: -2px;
    border-radius: 12px;
}

.ddt-dash-notif__copy h6 {
    margin-bottom: 0.2rem;
}

.ddt-dash-notif__time {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    letter-spacing: 0.01em;
}

.ddt-dash-notif__side {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.45rem 0.4rem 0.45rem 0;
    gap: 0.15rem;
    flex-shrink: 0;
}

.ddt-dash-notif__dot {
    width: 8px;
    height: 8px;
    margin-top: 0.45rem;
    border-radius: 50%;
    background: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.16);
    transition: opacity 180ms ease-out, transform 180ms ease-out;
}

.ddt-dash-notif__dismiss {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--bs-secondary-color, #94a3b8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.62;
    transition: background-color 160ms ease-out, color 160ms ease-out, opacity 160ms ease-out, transform 160ms ease-out;
}

.ddt-dash-notif__item:hover .ddt-dash-notif__dismiss,
.ddt-dash-notif__item:focus-within .ddt-dash-notif__dismiss,
.ddt-dash-notif__dismiss:focus-visible {
    opacity: 1;
}

.ddt-dash-notif__dismiss:hover,
.ddt-dash-notif__dismiss:focus-visible {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    outline: none;
    transform: scale(1.05);
}

.ddt-dash-notif__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 2rem 1.25rem;
    text-align: center;
}

.ddt-dash-notif__empty:not(.d-none) {
    animation: ddt-dash-notif-in 220ms ease-out;
}

.ddt-dash-notif__empty-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    font-size: 1.2rem;
}

.ddt-dash-notif__menu .card-footer {
    border-top-color: rgba(255, 255, 255, 0.06) !important;
    padding: 0.7rem 1rem !important;
}

.ddt-dash-notif__footer {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none !important;
}

.ddt-dash-notif__footer i {
    transition: transform 180ms ease-out;
}

.ddt-dash-notif__footer:hover i,
.ddt-dash-notif__footer:focus-visible i {
    transform: translateX(3px);
}

.ddt-dash-notif-item__icon {
    width: 2.35rem;
    height: 2.35rem;
    flex-shrink: 0;
    transition: transform 180ms ease-out;
}

.ddt-dash-notif__item:hover .ddt-dash-notif-item__icon {
    transform: scale(1.06);
}

.ddt-dash-notif-item__icon--teal {
    background: rgba(13, 148, 136, 0.16) !important;
    color: #2dd4bf !important;
}

.ddt-dash-notif-item__icon--primary {
    background: rgba(99, 102, 241, 0.16) !important;
    color: #a5b4fc !important;
}

.ddt-dash-notif-item__icon--success {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #4ade80 !important;
}

.ddt-dash-notif-item__icon--info {
    background: rgba(14, 165, 233, 0.16) !important;
    color: #38bdf8 !important;
}

@media (max-width: 767.98px) {
    .ddt-dash-notif__menu {
        position: fixed !important;
        top: calc(var(--fi-header-height, 72px) + 8px) !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        margin-top: 0 !important;
    }

    .ddt-dash-notif__panel {
        transform-origin: top center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ddt-dash-notif__badge--pulse,
    .ddt-dash-notif__menu.show .ddt-dash-notif__panel,
    .ddt-dash-notif__empty:not(.d-none) {
        animation: none;
    }

    .ddt-dash-notif .btn-round,
    .ddt-dash-notif__action,
    .ddt-dash-notif__item,
    .ddt-dash-notif__item::before,
    .ddt-dash-notif__dismiss,
    .ddt-dash-notif-item__icon,
    .ddt-dash-notif__footer i,
    .ddt-dash-notif__dot {
        transition: none;
    }

    .ddt-dash-notif .btn-round:hover,
    .ddt-dash-notif__action:hover,
    .ddt-dash-notif__item:hover .ddt-dash-notif-item__icon,
    .ddt-dash-notif__footer:hover i {
        transform: none;
    }
}

/* Light theme */
html[data-bs-theme="light"] .ddt-dash-notif__menu {
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

html[data-bs-theme="light"] .ddt-dash-notif__panel {
    background: rgba(255, 255, 255, 0.96);
}

html[data-bs-theme="light"] .ddt-dash-notif__panel::before {
    background: linear-gradient(90deg, #0a7a18, #22c55e);
}

html[data-bs-theme="light"] .ddt-dash-notif__menu .card-header,
html[data-bs-theme="light"] .ddt-dash-notif__menu .card-footer {
    border-color: #e2e8f0 !important;
}

html[data-bs-theme="light"] .ddt-dash-notif__menu h6,
html[data-bs-theme="light"] .ddt-dash-notif__item,
html[data-bs-theme="light"] .ddt-dash-notif__link {
    color: #0f172a;
}

html[data-bs-theme="light"] .ddt-dash-notif__head-icon {
    background: rgba(10, 122, 24, 0.1);
    color: #0a7a18;
}

html[data-bs-theme="light"] .ddt-dash-notif__item .text-muted,
html[data-bs-theme="light"] .ddt-dash-notif__time {
    color: #475569 !important;
}

html[data-bs-theme="light"] .ddt-dash-notif__action {
    background: rgba(10, 122, 24, 0.1);
    color: #0a7a18;
}

html[data-bs-theme="light"] .ddt-dash-notif__action:hover,
html[data-bs-theme="light"] .ddt-dash-notif__action:focus-visible {
    background: rgba(10, 122, 24, 0.16);
    color: #065f14;
}

html[data-bs-theme="light"] .ddt-dash-notif__action--muted {
    background: rgba(71, 85, 105, 0.08);
    color: #475569;
}

html[data-bs-theme="light"] .ddt-dash-notif__action--muted:hover,
html[data-bs-theme="light"] .ddt-dash-notif__action--muted:focus-visible {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

html[data-bs-theme="light"] .ddt-dash-notif__dismiss {
    color: #475569;
}

html[data-bs-theme="light"] .ddt-dash-notif__item:hover,
html[data-bs-theme="light"] .ddt-dash-notif__item:focus-within {
    background: rgba(10, 122, 24, 0.06);
}

html[data-bs-theme="light"] .ddt-dash-notif__item--unread {
    background: linear-gradient(90deg, rgba(10, 122, 24, 0.1), rgba(10, 122, 24, 0.02) 72%);
}

html[data-bs-theme="light"] .ddt-dash-notif__item::before,
html[data-bs-theme="light"] .ddt-dash-notif__dot {
    background: #0a7a18;
}

html[data-bs-theme="light"] .ddt-dash-notif__dot {
    box-shadow: 0 0 0 4px rgba(10, 122, 24, 0.12);
}

html[data-bs-theme="light"] .ddt-dash-notif-item__icon--teal {
    background: rgba(13, 148, 136, 0.12) !important;
    color: #0f766e !important;
}

html[data-bs-theme="light"] .ddt-dash-notif-item__icon--primary {
    background: rgba(10, 122, 24, 0.12) !important;
    color: #0a7a18 !important;
}

html[data-bs-theme="light"] .ddt-dash-notif-item__icon--success {
    background: rgba(22, 163, 74, 0.12) !important;
    color: #15803d !important;
}

html[data-bs-theme="light"] .ddt-dash-notif-item__icon--info {
    background: rgba(2, 132, 199, 0.12) !important;
    color: #0369a1 !important;
}

html[data-bs-theme="light"] .ddt-dash-notif__empty-icon {
    background: rgba(10, 122, 24, 0.08);
    color: #0a7a18;
}

.header-right-icons,
.header-right-icons .dropdown,
.navbar .ddt-dash-notif {
    overflow: visible;
}
