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

.notification-bell__trigger {
    position: relative;
}

.notification-bell__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f97316;
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ==================== Dropdown Panel ==================== */
.notification-bell__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 480px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Dropdown transitions */
.notification-bell__dropdown--enter {
    transition: all 0.2s ease-out;
}
.notification-bell__dropdown--enter-start {
    opacity: 0;
    transform: translateY(-10px);
}
.notification-bell__dropdown--enter-end {
    opacity: 1;
    transform: translateY(0);
}
.notification-bell__dropdown--leave {
    transition: all 0.15s ease-in;
}
.notification-bell__dropdown--leave-start {
    opacity: 1;
    transform: translateY(0);
}
.notification-bell__dropdown--leave-end {
    opacity: 0;
    transform: translateY(-10px);
}

.notification-bell__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.notification-bell__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.notification-bell__mark-all {
    background: none;
    border: none;
    color: #3c90c4;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
}

.notification-bell__mark-all:hover {
    background: #e0f2fe;
    text-decoration: underline;
}

.notification-bell__list {
    flex: 1;
    overflow-y: auto;
    max-height: 360px;
}

.notification-bell__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.notification-bell__empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.notification-bell__footer {
    padding: 12px 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    background: #f8fafc;
}

.notification-bell__view-all {
    color: #3c90c4;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.notification-bell__view-all:hover {
    text-decoration: underline;
}

/* ==================== Notification Item ==================== */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    position: relative;
}

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

.notification-item--unread {
    background: #eff6ff;
}

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

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

.notification-item__icon--pricing_ready {
    background: #e0f2fe;
    color: #0284c7;
}

.notification-item__icon--target_ready {
    background: #dcfce7;
    color: #16a34a;
}

.notification-item__icon--rule_conflict {
    background: #fef3c7;
    color: #d97706;
}

.notification-item__icon--mid_month {
    background: #fee2e2;
    color: #dc2626;
}

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

.notification-item__badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.notification-item__badge--high {
    background: #fee2e2;
    color: #dc2626;
}

.notification-item__badge--medium {
    background: #fef3c7;
    color: #d97706;
}

.notification-item__badge--info {
    background: #e0f2fe;
    color: #0284c7;
}

.notification-item__villa {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 2px;
    font-weight: 500;
}

.notification-item__message {
    margin: 0;
    font-size: 13px;
    color: #334155;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item__time {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.notification-item__unread-dot {
    width: 8px;
    height: 8px;
    background: #3c90c4;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

/* ==================== Toast Notifications ==================== */
.notification-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-toast {
    width: 360px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid #3c90c4;
}

.notification-toast--high {
    border-left-color: #dc2626;
}

.notification-toast--medium {
    border-left-color: #d97706;
}

.notification-toast--info {
    border-left-color: #0284c7;
}

.notification-toast--hiding {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification-toast__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #475569;
}

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

.notification-toast__content strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 4px;
}

.notification-toast__content p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-toast__close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    align-self: flex-start;
    border-radius: 4px;
    transition: all 0.15s;
}

.notification-toast__close:hover {
    color: #475569;
    background: #f1f5f9;
}

/* ==================== Responsive ==================== */
@media (max-width: 480px) {
    .notification-bell__dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
    }

    .notification-toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .notification-toast {
        width: auto;
    }
}

/* Hide elements until Alpine is ready */
[x-cloak] {
    display: none !important;
}
