/**
 * TexMeta - Notification Dropdown CSS
 * Facebook + LinkedIn Combined Modern Design
 */

/* ===== Notification Bell Trigger ===== */
.notification-dropdown-trigger {
    position: relative !important;
    cursor: pointer;
    overflow: visible !important;
}

.notification-bell {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 2px;
    /* Mobile touch optimization */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.notification-bell:hover {
    opacity: 0.8;
}

.notification-bell:active {
    opacity: 0.6;
    transform: scale(0.95);
}

.notification-bell .bell-icon {
    width: 24px;
    height: 24px;
    color: currentColor;
    transition: all 0.2s ease;
}

.notification-dropdown-trigger.active .bell-icon {
    color: var(--primary, #6366f1);
}

.notification-bell .nav-label {
    font-size: 12px;
    color: inherit;
}

/* Notification Badge */
.notification-count-badge {
    position: absolute !important;
    top: 4px !important;
    right: 8px !important;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    font-size: 10px !important;
    font-weight: 700;
    border-radius: 10px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: badgePulse 2s infinite;
    z-index: 10;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== Dropdown Panel ===== */
.notification-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: -100px;
    width: 400px;
    max-height: 85vh;
    background: white;
    border-radius: 12px;
    box-shadow: 
        0 12px 28px rgba(0, 0, 0, 0.15),
        0 8px 10px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease-out;
}

.notification-dropdown-panel.show {
    display: flex;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Arrow pointer */
.notification-dropdown-panel::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 120px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
    z-index: -1;
}

/* ===== Dropdown Header ===== */
.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

.notif-dropdown-header h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900, #111827);
    margin: 0;
    letter-spacing: -0.5px;
}

.notif-header-actions {
    display: flex;
    gap: 4px;
}

.notif-header-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100, #f3f4f6);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600, #4b5563);
    transition: all 0.2s ease;
}

.notif-header-btn:hover {
    background: var(--gray-200, #e5e7eb);
    color: var(--gray-900, #111827);
    transform: scale(1.05);
}

/* ===== Tabs ===== */
.notif-dropdown-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gray-50, #f9fafb);
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.notif-tab {
    padding: 8px 16px;
    border: none;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.notif-tab:hover {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-900, #111827);
}

.notif-tab.active {
    background: var(--primary, #6366f1);
    color: white;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

/* ===== Notification List ===== */
.notif-dropdown-list {
    flex: 1;
    overflow-y: auto;
    max-height: 450px;
    overscroll-behavior: contain;
}

.notif-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.notif-dropdown-list::-webkit-scrollbar-track {
    background: transparent;
}

.notif-dropdown-list::-webkit-scrollbar-thumb {
    background: var(--gray-300, #d1d5db);
    border-radius: 3px;
}

.notif-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400, #9ca3af);
}

/* ===== Notification Item ===== */
.notif-dropdown-item {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.notif-dropdown-item:hover {
    background: var(--gray-50, #f9fafb);
}

.notif-dropdown-item.unread {
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
    border-left-color: var(--primary, #6366f1);
}

.notif-dropdown-item.unread:hover {
    background: linear-gradient(90deg, #e0ecff 0%, #f0f4f8 100%);
}

/* Avatar with type badge */
.notif-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.notif-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notif-type-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notif-type-icon svg {
    width: 12px;
    height: 12px;
    fill: white;
}

.notif-type-icon.connection { background: linear-gradient(135deg, #10b981, #059669); }
.notif-type-icon.job { background: linear-gradient(135deg, #f59e0b, #d97706); }
.notif-type-icon.message { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.notif-type-icon.post { background: linear-gradient(135deg, #ec4899, #db2777); }
.notif-type-icon.like { background: linear-gradient(135deg, #ef4444, #dc2626); }
.notif-type-icon.comment { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.notif-type-icon.system { background: linear-gradient(135deg, #6b7280, #4b5563); }

/* Notification Content */
.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 14px;
    color: var(--gray-700, #374151);
    line-height: 1.45;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-text strong {
    font-weight: 700;
    color: var(--gray-900, #111827);
}

.notif-time {
    font-size: 12px;
    color: var(--gray-500, #6b7280);
    display: flex;
    align-items: center;
    gap: 6px;
}

.notif-time.unread-time {
    color: var(--primary, #6366f1);
    font-weight: 600;
}

/* Unread dot indicator */
.notif-unread-dot {
    width: 10px;
    height: 10px;
    background: var(--primary, #6366f1);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.1); }
}

/* Action buttons for connection requests */
.notif-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.notif-action-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.notif-action-btn.accept {
    background: var(--primary, #6366f1);
    color: white;
}

.notif-action-btn.accept:hover {
    background: var(--primary-dark, #4f46e5);
    transform: scale(1.02);
}

.notif-action-btn.decline {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-700, #374151);
    border: 1px solid var(--gray-200, #e5e7eb);
}

.notif-action-btn.decline:hover {
    background: var(--gray-200, #e5e7eb);
}

/* Options menu button */
.notif-options-btn {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400, #9ca3af);
    opacity: 0;
    transition: all 0.2s ease;
}

.notif-dropdown-item:hover .notif-options-btn {
    opacity: 1;
}

.notif-options-btn:hover {
    background: var(--gray-200, #e5e7eb);
    color: var(--gray-700, #374151);
}

/* ===== Dropdown Footer ===== */
.notif-dropdown-footer {
    padding: 14px 20px;
    text-align: center;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    background: var(--gray-50, #f9fafb);
}

.see-all-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary, #6366f1);
    text-decoration: none;
    transition: all 0.2s ease;
}

.see-all-link:hover {
    color: var(--primary-dark, #4f46e5);
    text-decoration: underline;
}

/* ===== Loading Skeleton ===== */
.notif-loading {
    padding: 8px 0;
}

.notif-skeleton {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    animation: skeletonPulse 1.5s infinite;
}

.notif-skeleton::before {
    content: '';
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gray-200, #e5e7eb);
    flex-shrink: 0;
}

.notif-skeleton::after {
    content: '';
    flex: 1;
    height: 40px;
    border-radius: 8px;
    background: var(--gray-200, #e5e7eb);
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Empty State ===== */
.notif-empty {
    padding: 40px 20px;
    text-align: center;
}

.notif-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.notif-empty h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-700, #374151);
    margin: 0 0 4px 0;
}

.notif-empty p {
    font-size: 13px;
    color: var(--gray-500, #6b7280);
    margin: 0;
}

/* ===== Group Notifications ===== */
.notif-group-header {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50, #f9fafb);
    border-top: 1px solid var(--gray-100, #f3f4f6);
    position: sticky;
    top: 0;
    z-index: 5;
}

.notif-group-header:first-child {
    border-top: none;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .notification-dropdown-panel {
        position: fixed;
        top: 60px;
        right: 0;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 60px);
        border-radius: 0;
    }
    
    .notification-dropdown-panel::before {
        display: none;
    }
    
    .notif-avatar {
        width: 44px;
        height: 44px;
    }
    
    .notif-type-icon {
        width: 18px;
        height: 18px;
    }
    
    .notif-type-icon svg {
        width: 10px;
        height: 10px;
    }
}

/* ===== Toast Notifications ===== */
.notification-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 380px;
    z-index: 99999;
    animation: toastSlide 0.3s ease-out;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-toast:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

@keyframes toastSlide {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-toast .toast-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.notification-toast .toast-content {
    flex: 1;
    min-width: 0;
}

.notification-toast .toast-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900, #111827);
    margin-bottom: 2px;
}

.notification-toast .toast-message {
    font-size: 13px;
    color: var(--gray-600, #4b5563);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-toast .toast-time {
    font-size: 11px;
    color: var(--gray-400, #9ca3af);
    margin-top: 4px;
}

.notification-toast .toast-close {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--gray-100, #f3f4f6);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500, #6b7280);
    flex-shrink: 0;
}

.notification-toast .toast-close:hover {
    background: var(--gray-200, #e5e7eb);
    color: var(--gray-700, #374151);
}

/* Multiple toasts stack */
.notification-toast:nth-child(2) {
    bottom: 100px;
}

.notification-toast:nth-child(3) {
    bottom: 176px;
}
