/* Main Dropdown Container - Hidden by default */
#notificationDropdown {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 320px;
    max-width: 90vw;
    background: var(--glass-dark, rgba(10, 10, 20, 0.95));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    z-index: 10001;
    backdrop-filter: blur(10px);
    
    /* Hiding Logic */
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden; /* Prevents clicks when hidden */
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

#notificationDropdown.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dropdown-header {
    padding: 15px 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--yellow, #FFD700);
}

/* Add a handle for pulling down */
#notificationDropdown .dropdown-handle {
    width: 40px;
    height: 5px;
    background: rgba(255,255,255,0.3);
    border-radius: 2.5px;
    margin: 8px auto;
    cursor: grab;
}

.mark-all-read-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--muted, #ccc);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

#notificationDropdown .mark-all-read-btn:hover {
    background: var(--yellow);
    color: black;
    border-color: var(--yellow);
}

#notificationDropdown .mark-all-read-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Make the list scrollable */
#notificationDropdown #notificationList {
    overflow-y: auto;
    flex-grow: 1; /* Take remaining space */
    padding: 0;
    margin: 0;
    list-style: none;
}

/* NEW Notification Item Styles */
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notification-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.notification-item.unread {
    background-color: rgba(255, 215, 0, 0.08);
    border-left: 3px solid var(--yellow, #FFD700);
    padding-left: 12px;
}

.notif-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.notif-content {
    flex-grow: 1;
    overflow: hidden;
}

.notif-body {
    margin: 0;
    font-size: 0.9em;
    color: var(--text, #fff);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-time {
    font-size: 0.75em;
    color: var(--muted, #ccc);
    margin-top: 4px;
}

/* Backdrop */
#notificationBackdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 10000; opacity: 0; transition: opacity 0.4s; pointer-events: none;
}

/* Superlike Badge */
.superlike-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #D633FF, #FFD700);
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(214, 51, 255, 0.5);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.superlike-badge i { font-size: 12px; }
#notificationBackdrop.open { opacity: 1; pointer-events: auto; }

/* In-App Toast Notification */
#inAppNotification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, -150%);
    width: 90%;
    max-width: 400px;
    background: var(--glass-dark, rgba(10, 10, 20, 0.95));
    color: #FFFFFF;
    padding: 12px 45px 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 2147483647;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none; 
    opacity: 0;
}
#inAppNotification.visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}
#inAppNotification.info { border: 1px solid var(--yellow, #FFD700); }
#inAppNotification.success { background: rgba(76, 175, 80, 0.9); border: 1px solid #4CAF50; }
#inAppNotification.error { background: rgba(244, 67, 54, 0.9); border: 1px solid #FF4444; }

.in-app-notif-close { 
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%); 
    background: none; border: none; color: rgba(255, 255, 255, 0.6); 
    font-size: 26px; line-height: 1; cursor: pointer; padding: 8px; z-index: 1; 
}
.in-app-notif-close:hover { color: #FFFFFF; }

/* Notification Badge */
.nav-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: var(--error, #ff4444);
    color: white;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg, #000010);
    line-height: 1;
    padding: 0 4px;
}