/**
 * Header Notifications Styles
 * Design inspired by Uber
 */

/* Notification Trigger Button */
.header-notifications {
    position: relative;
    display: inline-block;
}

.header-notifications__trigger {
    position: relative;
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #9b9999;
    font-size: 18px;
    transition: all 0.3s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.header-notifications__trigger:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-notifications__trigger i,
.header-notifications__trigger i.fas,
.header-notifications__trigger i.fa-bell,
.header-notifications__trigger.has-notifications i,
.header-notifications__trigger.has-notifications i.fas,
.header-notifications__trigger.has-notifications i.fa-bell {
    color: #9b9999 !important;
}

.header-notifications__trigger:hover i,
.header-notifications__trigger:hover i.fas,
.header-notifications__trigger:hover i.fa-bell,
.header-notifications__trigger.has-notifications:hover i,
.header-notifications__trigger.has-notifications:hover i.fas,
.header-notifications__trigger.has-notifications:hover i.fa-bell {
    color: #9b9999 !important;
}

.header-notifications__trigger:focus {
    outline: 2px solid #9b9999 !important;
    outline-offset: 2px !important;
}

.header-notifications__trigger:focus i,
.header-notifications__trigger:focus i.fas,
.header-notifications__trigger:focus i.fa-bell {
    color: #9b9999 !important;
}

.header-notifications__trigger:active i,
.header-notifications__trigger:active i.fas,
.header-notifications__trigger:active i.fa-bell {
    color: #9b9999 !important;
}

.header-notifications__badge {
    position: absolute !important;
    top: 4px !important;
    right: 4px !important;
    background-color: #e53e3e !important;
    color: #fff !important;
    border-radius: 10px !important;
    min-width: 18px !important;
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 0 4px !important;
    line-height: 1 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.header-notifications__badge[style*="display: none"],
.header-notifications__badge:empty {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Modal */
.header-notifications__modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    pointer-events: none;
}

.header-notifications__modal.is-open {
    display: block;
    pointer-events: auto;
}

.header-notifications__modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.header-notifications__modal-content {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.header-notifications__modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.header-notifications__modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.header-notifications__modal-close {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    font-size: 18px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.header-notifications__modal-close:hover {
    background-color: #f5f5f5;
    color: #000;
}

/* Modal Body */
.header-notifications__modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.header-notifications__loading,
.header-notifications__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
    text-align: center;
}

.header-notifications__loading i,
.header-notifications__empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.header-notifications__loading span,
.header-notifications__empty p {
    font-size: 14px;
    margin: 0;
}

/* Notifications List */
.header-notifications__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-notifications__item {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    position: relative;
}

.header-notifications__item:hover {
    background-color: #f5f5f5 !important;
    cursor: pointer !important;
}

.header-notifications__item.is-accepted {
    opacity: 0.7;
    cursor: pointer !important;
}

/* Apenas não lidas: destaque visual (bolinha/indicador) */
.header-notifications__item.is-unread {
    background-color: #faf5ff;
}

.header-notifications__item.is-unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #e53e3e;
}

.header-notifications__item-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.header-notifications__item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.header-notifications__item-icon--image {
    background: #f0f0f0;
    padding: 0;
}

.header-notifications__item-icon--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-notifications__item-info {
    flex: 1;
    min-width: 0;
}

.header-notifications__item-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #000;
    line-height: 1.4;
}

.header-notifications__item-summary {
    margin: 0 0 6px 0 !important;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    line-height: 1.35;
}

.header-notifications__item-info p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.header-notifications__item-message .header-notifications__actor-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.header-notifications__item-message .header-notifications__actor-link:hover {
    color: #4338ca;
}

.header-notifications__item-time {
    font-size: 12px;
    color: #999;
}

/* Item Actions */
.header-notifications__item-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.action-btn--accept {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.action-btn--accept:hover:not(:disabled) {
    background-color: #059669 !important;
    color: #ffffff !important;
}

.action-btn--reject {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

.action-btn--reject:hover:not(:disabled) {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

.action-btn--view {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
}

.action-btn--view:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.action-btn--view.action-btn--small {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

.action-btn--primary {
    background-color: #000;
    color: #fff;
}

.action-btn--primary:hover:not(:disabled) {
    background-color: #333;
}

.action-btn--secondary {
    background-color: #f5f5f5;
    color: #000;
}

.action-btn--secondary:hover {
    background-color: #e5e5e5;
}

.action-btn--small {
    padding: 6px 12px;
    font-size: 12px;
}

.action-btn:disabled,
.action-btn.is-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn.is-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Status row (badge + dismiss) */
.header-notifications__item-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.header-notifications__item-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    color: #888;
    font-size: 14px;
    line-height: 1;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.header-notifications__item-dismiss:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #333;
}

.header-notifications__item-dismiss:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Badge */
.header-notifications__item-status {
    margin-top: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge--success {
    background-color: #e6f7e6;
    color: #2d7a2d;
}

.status-badge--danger {
    background-color: #fdeaea;
    color: #b3261e;
}

.status-badge--muted {
    background-color: #f0f0f0;
    color: #555;
}

/* "View All" Button */
.header-notifications__view-all-wrap {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.header-notifications__view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-notifications__view-all-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

.header-notifications__view-all-btn i {
    font-size: 14px;
}

/* "All Notifications" Modal */
.header-notifications__all-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: none;
    pointer-events: none;
}

.header-notifications__all-modal.is-open {
    display: block;
    pointer-events: auto;
}

.header-notifications__all-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}

.header-notifications__all-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 560px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 64px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.header-notifications__all-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.header-notifications__all-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #000;
}

.header-notifications__all-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.header-notifications__list--all .header-notifications__item {
    padding: 14px 24px;
}

/* Guest conversion icon style */
.header-notifications__item-icon--conversion {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .header-notifications__modal-content {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }

    .header-notifications__all-modal-content {
        width: auto;
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 32px);
        border-radius: 12px;
    }

    .header-notifications__all-modal-header {
        padding: 16px 18px;
    }

    .header-notifications__list--all .header-notifications__item {
        padding: 12px 18px;
    }
}

