/* Notification Bell Styles */
.notification-bell {
    position: relative;
}

.notification-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: url("/static/images/bell.1a1d8dcc5a10.png") center/contain no-repeat;
    background-size: 24px 24px;
    background-color: transparent;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}

.notification-toggle:hover {
    transform: scale(1.05);
}

.notification-toggle i {
    display: none; /* Hide the icon since we're using background image */
}

.notification-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
    z-index: 2;
    line-height: 1;
    min-width: 22px;
}

/* Badge with 0 count - hide it */
.notification-badge[data-count="0"] {
    display: none !important;
}

/* Badge with count > 0 - ensure red background and white text */
.notification-badge[data-count]:not([data-count="0"]) {
    background: #dc3545 !important;
    color: white !important;
    border-color: white !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hover state - maintain contrast */
.notification-toggle:hover .notification-badge {
    background: #c82333;
    border-color: #ffffff;
    color: white;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Large numbers - adjust size */
.notification-badge[data-count]:not([data-count="0"]):not([data-count="99+"]) {
    font-size: 12px;
}

.notification-badge[data-count="99+"] {
    font-size: 10px;
    padding: 0 2px;
}

.notification-badge.hidden {
    display: none !important;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
        box-shadow: 0 3px 8px rgba(220, 53, 69, 0.5);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0e0e0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

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

.notification-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.notification-header h6 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.unread-count {
    font-size: 12px;
    color: #666;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.notification-item.important {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
}

.notification-item.unread.important {
    background-color: #f5c6cb;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.notification-icon.approval-required {
    background: #ffc107;
}

.notification-icon.approval-completed {
    background: #28a745;
}

.notification-icon.approval-rejected {
    background: #dc3545;
}

.notification-icon.reminder {
    background: #17a2b8;
}

.notification-icon.system {
    background: #6c757d;
}

.notification-icon.checkin {
    background: #007bff;
}

.notification-icon.absence {
    background: #fd7e14;
}

.notification-text {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.notification-message {
    font-size: 13px;
    color: #666;
    margin: 0 0 5px 0;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Icon link thay thế URL trong notification message */
.notification-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: 0 4px;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 10px;
    transition: all 0.3s ease;
    vertical-align: middle;
    flex-shrink: 0;
}

.notification-link-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.notification-link-icon i {
    font-size: 10px;
}

.notification-time {
    font-size: 11px;
    color: #999;
}

.notification-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.view-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.view-all-btn:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.empty-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.empty-notifications i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

.empty-notifications p {
    margin: 0;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .notification-badge {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .notification-dropdown {
        width: 300px;
        right: -50px;
    }
    
    .notification-item {
        padding: 12px 15px;
    }
    
    .notification-header,
    .notification-footer {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .notification-dropdown {
        width: 280px;
        right: -80px;
    }
}
