/* ===============================================
   VREYA - NOTIFICATIONS SYSTEM CSS
   Stili per campanella notifiche e dropdown
   =============================================== */

/* ===============================================
   CAMPANELLA NOTIFICHE
   =============================================== */
.notifications-bell-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
}

.notifications-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications-bell:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.notifications-bell:active {
    transform: scale(0.95);
}

.notifications-bell:focus-visible {
    outline: 2px solid var(--color-primary, #3B82F6);
    outline-offset: 2px;
    border-radius: 8px;
}

.bell-icon {
    color: var(--color-text-primary, #1F2937);
    transition: transform 0.2s ease;
}

.notifications-bell:hover .bell-icon {
    animation: ring 0.5s ease-in-out;
}

@keyframes ring {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-10deg); }
    20%, 40% { transform: rotate(10deg); }
}

/* Badge notifiche */
.notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #EF4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: badge-appear 0.3s ease;
}

@keyframes badge-appear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Badge con pulse animation per nuova notifica */
.notifications-badge.pulse {
    animation: pulse-badge 1s ease-in-out 3;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5); }
}

/* ===============================================
   DROPDOWN NOTIFICHE
   =============================================== */
.notifications-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.notifications-dropdown.show {
    opacity: 1;
    transform: translateY(0);
}

/* Header dropdown */
.notifications-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.notifications-dropdown-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.mark-all-read-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #6B7280;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mark-all-read-btn:hover {
    background-color: #E5E7EB;
    color: #111827;
}

/* Lista notifiche */
.notifications-list {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.notifications-list::-webkit-scrollbar {
    width: 6px;
}

.notifications-list::-webkit-scrollbar-track {
    background: #F1F5F9;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Singola notifica */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

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

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

/* Notifica non letta */
.notification-item.unread {
    background-color: #EFF6FF;
}

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

/* Icona notifica */
.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Colori per tipo notifica */
.notification-icon-new_booking {
    background-color: #10B981;
}

.notification-icon-booking_cancelled {
    background-color: #EF4444;
}

.notification-icon-booking_modified {
    background-color: #F59E0B;
}

.notification-icon-new_review {
    background-color: #FBBF24;
}

.notification-icon-new_message {
    background-color: #3B82F6;
}

.notification-icon-payment_received {
    background-color: #10B981;
}

.notification-icon-reminder {
    background-color: #8B5CF6;
}

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

/* Contenuto notifica */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
}

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

.notification-time {
    font-size: 12px;
    color: #9CA3AF;
}

/* Dot non letta */
.notification-unread-dot {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #3B82F6;
    border-radius: 50%;
}

/* Stato vuoto */
.notifications-empty {
    padding: 60px 20px;
    text-align: center;
    color: #9CA3AF;
}

.notifications-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    stroke: #D1D5DB;
}

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

/* Footer dropdown */
.notifications-dropdown-footer {
    padding: 12px 20px;
    border-top: 1px solid #E5E7EB;
    text-align: center;
    background: #F9FAFB;
}

.view-all-link {
    color: var(--color-primary, #3B82F6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.view-all-link:hover {
    color: var(--color-primary-dark, #2563EB);
    text-decoration: underline;
}

.view-all-link svg {
    transition: transform 0.2s ease;
}

.view-all-link:hover svg {
    transform: translateX(2px);
}

/* ===============================================
   TOAST NOTIFICATIONS
   =============================================== */
.notification-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-size: 14px;
    max-width: 320px;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.notification-toast-success {
    border-left: 4px solid #10B981;
    color: #065F46;
}

.notification-toast-error {
    border-left: 4px solid #EF4444;
    color: #991B1B;
}

.notification-toast-info {
    border-left: 4px solid #3B82F6;
    color: #1E40AF;
}

/* ===============================================
   RESPONSIVE - MOBILE
   =============================================== */
@media (max-width: 768px) {
    /* Dropdown full-width su mobile */
    .notifications-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
    }

    .notifications-dropdown.show {
        transform: translateY(0);
    }

    .notifications-list {
        max-height: calc(90vh - 140px);
    }

    /* Badge leggermente più grande su mobile */
    .notifications-badge {
        min-width: 20px;
        height: 20px;
        font-size: 12px;
    }

    /* Toast più piccolo su mobile */
    .notification-toast {
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

/* ===============================================
   DARK MODE (opzionale)
   =============================================== */
@media (prefers-color-scheme: dark) {
    .notifications-dropdown {
        background: #1F2937;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .notifications-dropdown-header {
        background: #111827;
        border-bottom-color: #374151;
    }

    .notifications-dropdown-header h3 {
        color: #F9FAFB;
    }

    .mark-all-read-btn {
        color: #9CA3AF;
    }

    .mark-all-read-btn:hover {
        background-color: #374151;
        color: #F9FAFB;
    }

    .notification-item {
        border-bottom-color: #374151;
    }

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

    .notification-item.unread {
        background-color: #1E3A5F;
    }

    .notification-item.unread:hover {
        background-color: #2C5282;
    }

    .notification-title {
        color: #F9FAFB;
    }

    .notification-message {
        color: #D1D5DB;
    }

    .notification-time {
        color: #9CA3AF;
    }

    .notifications-dropdown-footer {
        background: #111827;
        border-top-color: #374151;
    }

    .notifications-empty {
        color: #6B7280;
    }

    .notification-toast {
        background: #1F2937;
        color: #F9FAFB;
    }
}

/* ===============================================
   ACCESSIBILITY
   =============================================== */
@media (prefers-reduced-motion: reduce) {
    .notifications-bell,
    .notifications-dropdown,
    .notification-toast,
    .bell-icon {
        animation: none !important;
        transition: none !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .notifications-badge {
        border: 2px solid white;
    }

    .notification-item {
        border: 1px solid currentColor;
    }
}
