/* SISTEMA DE NOTIFICAÇÕES */

/* Ícone de Mensageria */
.messaging-icon {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #6c757d;
    margin-right: 8px;
}

.messaging-icon:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    transform: scale(1.05);
}

.messaging-icon.has-messages {
    color: #dc3545;
}

/* Badge de Mensageria */
.messaging-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: badgePulse 2s infinite;
}

/* Sino de Notificação */
.notification-bell {
    position: relative;
    display: inline-block;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #6c757d;
}

.notification-bell:hover {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    transform: scale(1.05);
}

.notification-bell.has-notifications {
    color: #28a745;
}

.notification-bell.shake {
    animation: bellShake 0.5s ease-in-out;
}

@keyframes bellShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Badge de Contador (Notificações Internas - Verde) */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: badgePulse 2s infinite;
}


@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Dropdown de Notificações */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 350px;
    max-height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

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

/* Header do Dropdown */
.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.notification-header h6 {
    margin: 0;
    font-weight: 600;
    color: #343a40;
    font-size: 14px;
}

.mark-all-read {
    background: none;
    border: none;
    color: #007bff;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mark-all-read:hover {
    background: rgba(0, 123, 255, 0.1);
}

/* Lista de Notificações */
.notification-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
}

.notification-list::-webkit-scrollbar {
    width: 4px;
}

.notification-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.notification-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

/* Item de Notificação */
.notification-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f1f1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

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

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

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #007bff;
    border-radius: 50%;
}

/* Ícone da Notificação */
.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.notification-icon.basic { background: #007bff; }
.notification-icon.popup { background: #fd7e14; }
.notification-icon.alerta { background: #dc3545; }
.notification-icon.sistema { background: #6c757d; }

/* Conteúdo da Notificação */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    font-size: 13px;
    color: #343a40;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.notification-message {
    font-size: 12px;
    color: #6c757d;
    margin: 0 0 4px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 11px;
    color: #adb5bd;
    font-weight: 400;
}

/* Footer do Dropdown */
.notification-footer {
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.view-all-notifications {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-all-notifications:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Estados de Loading */
.notification-loading {
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

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

.notification-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

/* Skeleton Loading */
.notification-skeleton {
    padding: 12px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.skeleton-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
}

.skeleton-content {
    flex: 1;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Botão de configurações */
.btn-settings {
    background: none;
    border: none;
    color: var(--bs-secondary);
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-settings:hover {
    background-color: var(--bs-light);
    color: var(--bs-primary);
}

.btn-settings i {
    font-size: 16px;
}

/* Modal de configurações */
.notification-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.notification-settings-modal.show {
    display: flex;
}

.settings-modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bs-border-color);
}

.settings-modal-header h5 {
    margin: 0;
    color: var(--bs-dark);
}

.settings-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--bs-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.settings-close-btn:hover {
    background-color: var(--bs-light);
    color: var(--bs-danger);
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h6 {
    color: var(--bs-dark);
    margin-bottom: 12px;
    font-weight: 600;
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.settings-option:last-child {
    border-bottom: none;
}

.settings-option-info {
    flex: 1;
}

.settings-option-info label {
    font-weight: 500;
    color: var(--bs-dark);
    margin-bottom: 4px;
    display: block;
    cursor: pointer;
}

.settings-option-info small {
    color: var(--bs-secondary);
    display: block;
}

.settings-toggle {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: var(--bs-border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.settings-toggle.active {
    background-color: var(--bs-primary);
}

.settings-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-toggle.active .settings-toggle-slider {
    transform: translateX(24px);
}

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--bs-border-color);
}

.settings-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-btn-cancel {
    background-color: var(--bs-light);
    color: var(--bs-secondary);
}

.settings-btn-cancel:hover {
    background-color: var(--bs-secondary);
    color: white;
}

.settings-btn-save {
    background-color: var(--bs-primary);
    color: white;
}

.settings-btn-save:hover {
    background-color: var(--bs-primary);
    opacity: 0.9;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 320px;
        right: -20px;
    }
    
    .notification-item {
        padding: 10px 16px;
    }
    
    .notification-header,
    .notification-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .notification-dropdown {
        width: calc(100vw - 40px);
        right: -10px;
        max-width: 300px;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 100vw;
        max-width: 100vw;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        border-radius: 0;
        max-height: 70vh;
    }

    .notification-item {
        padding: 12px;
    }

    .notification-content h6 {
        font-size: 0.9rem;
    }

    .notification-content p {
        font-size: 0.8rem;
    }

    .settings-modal-content {
        width: 95%;
        margin: 20px;
        padding: 20px;
    }

    .notification-footer {
        flex-direction: column;
        gap: 8px;
    }

    .btn-settings {
        width: 100%;
        justify-content: center;
    }
}

/* Sistema de Toasts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast-notification {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--bs-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-notification.success {
    border-left-color: var(--bs-success);
}

.toast-notification.error {
    border-left-color: var(--bs-danger);
}

.toast-notification.warning {
    border-left-color: var(--bs-warning);
}

.toast-notification.info {
    border-left-color: var(--bs-info);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-notification.success .toast-icon {
    color: var(--bs-success);
}

.toast-notification.error .toast-icon {
    color: var(--bs-danger);
}

.toast-notification.warning .toast-icon {
    color: var(--bs-warning);
}

.toast-notification.info .toast-icon {
    color: var(--bs-info);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--bs-dark);
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.toast-message {
    color: var(--bs-secondary);
    font-size: 0.8rem;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    color: var(--bs-secondary);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background-color: var(--bs-light);
    color: var(--bs-dark);
}

.toast-close i {
    font-size: 16px;
}

/* Responsividade para toasts */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast-notification {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* Animações de Entrada */
.notification-item-enter {
    animation: slideInNotification 0.3s ease-out;
}

@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Toast de Feedback */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1060;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.notification-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Acessibilidade */
.notification-bell:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.notification-item:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

/* Modo Escuro (Opcional) */
@media (prefers-color-scheme: dark) {
    .notification-dropdown {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .notification-header,
    .notification-footer {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    .notification-item:hover {
        background: #4a5568;
    }
    
    .notification-title {
        color: #e2e8f0;
    }
    
    .notification-message {
        color: #a0aec0;
    }
}
