/* ============================================================================
   NOTIFICATIONS PANEL
   ============================================================================ */

.hamburger-back-btn-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(135deg, #4caac9, #3d98b3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hamburger-back-btn-wrapper .hamburger-back-btn {
    flex: 1;
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.hamburger-back-btn-wrapper .hamburger-back-btn:hover {
    background: transparent;
}

/* Settings Icon in Header */
.notification-settings-btn-header {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.notification-settings-btn-header:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.notification-settings-btn-header i {
    font-size: 0.95rem;
}

/* Adjust panel content to account for new header */
#notifications-panel .panel-content {
    height: calc(100vh - 80px); /* Adjusted for reduced header height */
    padding-top: 0.7rem; /* Remove default top padding */
}

/* Filter Sections */
.notification-filter-sections {
    padding: 1rem .5rem 1rem; /* Changed from 0 1rem 1rem */
    border-bottom: 2px solid #e5e7eb;
}

.filter-section {
    margin-bottom: 0.75rem; /* Changed from 1rem */
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.filter-section-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 0.875rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.filter-btn.active {
    background: linear-gradient(135deg, #4caac9, #3d98b3);
    color: white;
    border-color: #4caac9;
}

.filter-loading {
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

/* Notification Source Badge */
.notification-source {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: rgba(76, 170, 201, 0.1);
    border: 1px solid rgba(76, 170, 201, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4caac9;
    margin-bottom: 0.5rem;
}

.notification-source i {
    font-size: 0.7rem;
}

/* Expandable Notification */
.notification-item {
    cursor: pointer;
}

.notification-item.expanded .notification-content {
    max-height: none;
}

.notification-details {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.85rem;
    color: #6b7280;
    line-height: 1.6;
}

.notification-item.expanded .notification-details {
    display: block;
}

.notification-expand-icon {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    color: #9ca3af;
    transition: transform 0.2s;
}

.notification-item.expanded .notification-expand-icon {
    transform: rotate(180deg);
}

/* Notifications List */
.notifications-list {
    padding: 1rem 0;
}

/* Date Section Headers */
.notification-date-section {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
}

.notification-date-section:first-child {
    border-top: none;
}

/* Individual Notification */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem;
    margin: 0 0.5rem 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.notification-item:hover {
    background: #f9fafb;
    border-color: rgba(76, 170, 201, 0.3);
    transform: translateX(2px);
}

.notification-item.unread {
    background: rgba(76, 170, 201, 0.05);
    border-left: 3px solid #4caac9;
}

.notification-item.unread .notification-content .notification-message {
    font-weight: 600;
}

/* Notification Icon */
.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

/* Notification Header (source + timestamp) */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

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

.notification-header .notification-timestamp {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
}

.notification-icon.official {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.notification-icon.expense {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.notification-icon.settlement {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.notification-icon.admin {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.notification-icon.join_request {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.notification-icon.budget_alert {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.notification-icon.recurring {
    background: rgba(20, 184, 166, 0.15);
    color: #14b8a6;
}

.notification-icon.summary {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.notification-icon.member_joined {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

/* Notification Content */
.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    font-size: 0.9rem;
    color: #1f2937;
    line-height: 1.5;
    margin-bottom: 0.25rem;
}



/* Unread Badge */
.notification-unread-badge {
    width: 8px;
    height: 8px;
    background: #4caac9;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

/* Empty State */
.notifications-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.notifications-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.notifications-empty p {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.empty-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Loading State */
.notifications-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.notifications-loading .loading-spinner-small {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #4caac9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 0.75rem;
}

/* Delete Button */
.notification-delete-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s;
    z-index: 10;
}

.notification-delete-btn:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

.notification-delete-btn i {
    font-size: 0.7rem;
}

/* Make notification-item position relative for absolute positioning */
.notification-item {
    position: relative;
    padding-bottom: 2.5rem; /* Add extra padding for delete button */
}

/* Delete Toast Message */
.notification-delete-toast {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(34, 197, 94, 0.95);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
}

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

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

/* Hidden class for filtering */
.notification-item.hidden {
    display: none;
}


/* Announcement Details Styling */
.notification-details h1,
.notification-details h2,
.notification-details h3,
.notification-details h4,
.notification-details h5,
.notification-details h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1f2937;
}

.notification-details h1 { font-size: 1.5rem; }
.notification-details h2 { font-size: 1.3rem; }
.notification-details h3 { font-size: 1.1rem; }
.notification-details h4 { font-size: 1rem; }
.notification-details h5 { font-size: 0.9rem; }
.notification-details h6 { font-size: 0.85rem; }

.notification-details p {
    margin-bottom: 0.75rem;
}

.notification-details ul,
.notification-details ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.notification-details li {
    margin-bottom: 0.25rem;
}

.notification-details strong {
    font-weight: 600;
    color: #1f2937;
}

.notification-details em {
    font-style: italic;
}

.notification-details a {
    color: #4caac9;
    text-decoration: underline;
}

.notification-details a:hover {
    color: #3d98b3;
}

.notification-details blockquote {
    border-left: 3px solid #4caac9;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6b7280;
    font-style: italic;
}

.notification-details code {
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.notification-details pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0.75rem 0;
}

.notification-details pre code {
    background: none;
    padding: 0;
}

.notification-details img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.75rem 0;
}

.notification-details hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 1rem 0;
}

.notification-details table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.notification-details th,
.notification-details td {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.notification-details th {
    background: #f9fafb;
    font-weight: 600;
}

.notification-action-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.notification-action-toast.notification-action-success {
    background: #10b981;
}

.notification-action-toast.notification-action-error {
    background: #ef4444;
}

.notification-icon.monthly_summary {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .notification-filter-sections {
        padding: 0 0.5rem 1rem;
    }

    .filter-section-buttons {
        gap: 0.375rem;
    }

    .filter-btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }

    .notification-item {
        gap: 0.75rem;
        padding: 0.875rem;
        margin: 0 0.25rem 0.5rem;
    }

    .notification-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .notification-message {
        font-size: 0.85rem;
    }

    .notification-delete-btn {
        width: 22px;
        height: 22px;
        bottom: 6px;
        right: 6px;
    }

    .notification-delete-btn i {
        font-size: 0.65rem;
    }

}