/* Dropdown de Notificações - Estilo AdminLTE */
.notifications-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 10px;
}

.notifications-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 450px;
    background: var(--body-bg);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    overflow: hidden;
}

.notifications-dropdown.open .notifications-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header do dropdown */
.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notifications-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notifications-header h4 i {
    font-size: 18px;
}

.mark-all-read-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.mark-all-read-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Conteúdo das notificações */
.notifications-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
}

.notifications-content::-webkit-scrollbar {
    width: 6px;
}

.notifications-content::-webkit-scrollbar-track {
    background: var(--body-bg);
}

.notifications-content::-webkit-scrollbar-thumb {
    background: var(--border-color, #ddd);
    border-radius: 3px;
}

.notifications-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Item de notificação */
.notification-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    transition: background 0.2s ease;
    position: relative;
    cursor: pointer;
}

.notification-item:hover {
    background: var(--selected-bg, rgba(0, 123, 255, 0.05));
}

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

.notification-item.unread {
    background: rgba(0, 123, 255, 0.05);
    border-left: 4px solid #007bff;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 14px;
    line-height: 1.4;
    color: var(--body-fg, #333);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 12px;
    color: var(--body-quiet-color, #666);
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.notification-unread-indicator {
    width: 8px;
    height: 8px;
    background: #007bff;
    border-radius: 50%;
    position: absolute;
    top: 15px;
    right: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Botão marcar como lida */
.mark-read-btn {
    background: #28a745;
    border: none;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    opacity: 0;
    transition: all 0.2s ease;
}

.notification-item:hover .mark-read-btn {
    opacity: 1;
}

.mark-read-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

/* Estados especiais */
.notifications-loading,
.notifications-error,
.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--body-quiet-color, #666);
}

.notifications-loading i,
.notifications-error i,
.notification-empty i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

.notifications-loading i {
    color: #007bff;
}

.notifications-error i {
    color: #dc3545;
}

.notification-empty i {
    color: #6c757d;
}

.notifications-loading p,
.notifications-error p,
.notification-empty p {
    margin: 0;
    font-size: 14px;
}

/* Footer do dropdown */
.notifications-footer {
    padding: 10px;
    background: var(--body-bg);
    border-top: 1px solid var(--border-color, #f0f0f0);
}

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

.view-all-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #0056b3;
    text-decoration: none;
}

/* Overlay */
.notifications-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1040;
}

.notifications-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsividade */
@media (max-width: 768px) {
    .notifications-dropdown-menu {
        width: 300px;
        right: -50px;
    }
    
    .notification-item {
        padding: 12px 15px;
    }
    
    .notifications-header {
        padding: 12px 15px;
    }
    
    .notifications-header h4 {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .notifications-dropdown-menu {
        width: 280px;
        right: -100px;
    }
}

/* Tema escuro */
@media (prefers-color-scheme: dark) {
    .notifications-dropdown-menu {
        background: var(--body-bg, #2d3748);
        border-color: var(--border-color, #4a5568);
    }
    
    .notification-item {
        border-color: var(--border-color, #4a5568);
    }
    
    .notification-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .notification-item.unread {
        background: rgba(0, 123, 255, 0.1);
    }
    
    .notifications-footer {
        background: var(--body-bg, #2d3748);
        border-color: var(--border-color, #4a5568);
    }
}

/* Integração com o badge existente */
.notifications-toggle {
    position: relative;
}

.custom-notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    80% {
        transform: translateY(-1px);
    }
}