/**
 * Modern Google-style Notification System
 * Beautiful cards with Material Design principles
 */

:root {
    --notif-primary: #e8a87c;
    --notif-primary-hover: #d99968;
    --notif-primary-light: #fdf2e6;
    --notif-surface: #ffffff;
    --notif-surface-alt: #faf6f0;
    --notif-border: #eadfd5;
    --notif-text-primary: #3f2f25;
    --notif-text-secondary: #7a6b5d;
    --notif-muted: #b09e8d;
}

/* ============================================
   NOTIFICATION DRAWER - CLEAN STYLE
   ============================================ */

.notification-drawer {
    width: 420px !important;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.08);
}

/* Modern Header - Clean like chat */
.notification-drawer .offcanvas-header {
    background: var(--notif-surface) !important;
    color: var(--notif-text-primary);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--notif-border);
}

.notification-drawer .offcanvas-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--notif-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-drawer .offcanvas-title i {
    font-size: 1rem;
    color: var(--notif-primary);
}

.notification-drawer .offcanvas-header .btn-link {
    color: var(--notif-primary) !important;
    opacity: 1;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.notification-drawer .offcanvas-header .btn-link:hover {
    background-color: var(--notif-primary-light);
    text-decoration: none !important;
}

.notification-drawer .btn-close {
    opacity: 0.5;
}

.notification-drawer .btn-close:hover {
    opacity: 1;
}

/* When pinned, hide standard close button (X will become pin button) */
.notification-drawer.pinned .btn-close[data-bs-dismiss="offcanvas"] {
    display: none !important;
}

.notification-drawer .offcanvas-body {
    background-color: var(--notif-surface-alt);
    padding: 0.75rem !important;
}

.dark-mode .notification-drawer .offcanvas-header {
    background-color: #1e293b;
    border-bottom-color: #334155;
}

.dark-mode .notification-drawer .offcanvas-title {
    color: #f1f5f9;
}

.dark-mode .notification-drawer .offcanvas-body {
    background-color: #0f172a;
}

/* ============================================
   NOTIFICATION CONTROLS - COMPACT
   ============================================ */

.notification-controls {
    display: flex;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--notif-surface);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.dark-mode .notification-controls {
    background: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.notification-toggle-btn {
    flex: 1;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--notif-border);
    background: var(--notif-surface);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--notif-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.notification-toggle-btn i {
    font-size: 0.75rem;
}

.notification-toggle-btn:hover {
    border-color: var(--notif-primary);
    color: var(--notif-primary);
    background: var(--notif-primary-light);
}

.notification-toggle-btn.active {
    border-color: var(--notif-primary);
    background: var(--notif-primary);
    color: white;
    box-shadow: 0 1px 2px rgba(232, 168, 124, 0.2);
}

.dark-mode .notification-toggle-btn {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

.dark-mode .notification-toggle-btn:hover {
    border-color: #6366f1;
    color: #818cf8;
    background: #1e293b;
}

.dark-mode .notification-toggle-btn.active {
    border-color: #6366f1;
    background: #6366f1;
    color: white;
}

/* ============================================
   NOTIFICATION CARDS - GOOGLE STYLE
   ============================================ */

#notification-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-card {
    background: var(--notif-surface);
    border-radius: 10px;
    padding: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-left: 3px solid #6366f1;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.notification-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.notification-card.unread {
    background: var(--notif-primary-light);
    border-left-width: 3px;
    box-shadow: 0 1px 4px rgba(232, 168, 124, 0.2);
}

.dark-mode .notification-card {
    background: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode .notification-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dark-mode .notification-card.unread {
    background: #1e2538;
}

/* Color Coding by Type */
.notification-card.type-direct {
    border-left-color: #7ab8f0; /* Soft blue for DMs */
}

.notification-card.type-channel {
    border-left-color: #c79ef9; /* Lavender for Channels */
}

.notification-card.type-group {
    border-left-color: #7ecfaf; /* Mint for Groups */
}

.notification-card.type-mention {
    border-left-color: #f8b15a; /* Warm orange for Mentions */
}

.notification-card.type-other {
    border-left-color: #b0b8c3; /* Gray for Others */
}

/* ============================================
   NOTIFICATION CARD HEADER
   ============================================ */

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.notification-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.type-direct .notification-icon-wrapper {
    background: #7ab8f0;
    color: white;
}

.type-channel .notification-icon-wrapper {
    background: #c79ef9;
    color: white;
}

.type-group .notification-icon-wrapper {
    background: #7ecfaf;
    color: white;
}

.type-mention .notification-icon-wrapper {
    background: #f8b15a;
    color: white;
}

.type-other .notification-icon-wrapper {
    background: #b0b8c3;
    color: white;
}

.notification-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.notification-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--notif-text-primary);
    margin: 0;
    line-height: 1.4;
}

.dark-mode .notification-title {
    color: #f1f5f9;
}

.notification-subtitle {
    font-size: 0.6875rem;
    color: var(--notif-text-secondary);
    margin: 0.125rem 0 0 0;
    font-weight: 500;
}

.dark-mode .notification-subtitle {
    color: #94a3b8;
}

.notification-time {
    font-size: 0.6875rem;
    color: var(--notif-muted);
    white-space: nowrap;
    margin-left: 0.5rem;
}

.dark-mode .notification-time {
    color: #64748b;
}

/* ============================================
   NOTIFICATION CARD BODY
   ============================================ */

.notification-body {
    margin-top: 0.5rem;
}

.notification-message-preview {
    font-size: 0.8125rem;
    color: var(--notif-text-secondary);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark-mode .notification-message-preview {
    color: #cbd5e1;
}

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

.dark-mode .notification-sender {
    color: #f1f5f9;
}

/* ============================================
   NOTIFICATION UNREAD INDICATOR
   ============================================ */

.unread-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    animation: pulse-unread 2s infinite;
}

@keyframes pulse-unread {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.1);
    }
}

/* ============================================
   GROUPED NOTIFICATIONS
   ============================================ */

.notification-group {
    background: var(--notif-surface);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.dark-mode .notification-group {
    background: #1e293b;
}

.notification-group-header {
    padding: 0.875rem;
    background: var(--notif-surface-alt);
    border-left: 3px solid var(--notif-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.notification-group-header:hover {
    background: #f5ede4;
}

.dark-mode .notification-group-header {
    background: #1e2538;
}

.dark-mode .notification-group-header:hover {
    background: #252d42;
}

.notification-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-group-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.notification-group-heading {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--notif-text-primary);
    margin: 0;
}

.dark-mode .notification-group-heading {
    color: #f1f5f9;
}

.notification-group-subtitle {
    font-size: 0.6875rem;
    color: var(--notif-text-secondary);
}

.dark-mode .notification-group-subtitle {
    color: #94a3b8;
}

.notification-group-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-count-badge {
    background: #6366f1;
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.notification-group-toggle {
    color: var(--notif-primary);
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.notification-group.expanded .notification-group-toggle {
    transform: rotate(180deg);
}

.notification-group.has-unread .notification-count-badge {
    background: var(--notif-primary);
    color: white;
}

.notification-group.all-read {
    background: var(--notif-surface);
    border: 1px solid var(--notif-border);
    box-shadow: none;
}

.notification-group.all-read .notification-group-header {
    background: var(--notif-surface);
    border-left-color: var(--notif-border);
}

.notification-group.all-read .notification-count-badge {
    background: var(--notif-border);
    color: var(--notif-text-secondary);
}

.notification-group.all-read .notification-group-heading,
.notification-group.all-read .notification-group-subtitle {
    color: var(--notif-text-secondary);
}

.notification-group.all-read .notification-icon-wrapper {
    opacity: 0.6;
}

.notification-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.notification-group.expanded .notification-group-items {
    max-height: 1000px;
}

.notification-group-items .notification-card {
    border-radius: 0;
    border-left: none;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
    margin: 0;
}

.dark-mode .notification-group-items .notification-card {
    border-bottom-color: #4a5568;
}

.notification-group-items .notification-card:last-child {
    border-bottom: none;
}

.notification-group-items .notification-card:hover {
    transform: none;
    background: #f9fafb;
}

.dark-mode .notification-group-items .notification-card:hover {
    background: #374151;
}

.notification-group.all-read .notification-group-items .notification-card:hover {
    background: var(--notif-surface-alt);
}

/* ============================================
   EMPTY STATES
   ============================================ */

.notification-empty {
    text-align: center;
    padding: 3rem 2rem;
}

.notification-empty-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.dark-mode .notification-empty-icon {
    color: #4a5568;
}

.notification-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.dark-mode .notification-empty-title {
    color: #cbd5e1;
}

.notification-empty-text {
    font-size: 0.875rem;
    color: #94a3b8;
}

.dark-mode .notification-empty-text {
    color: #64748b;
}

/* ============================================
   LOADING STATE
   ============================================ */

.notification-loading {
    text-align: center;
    padding: 2rem;
}

.notification-loading i {
    font-size: 2rem;
    color: #6366f1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 576px) {
    .notification-drawer {
        width: 100% !important;
    }
    
    .notification-card {
        border-radius: 8px;
    }
    
    .notification-controls {
        flex-direction: column;
    }
    
    .notification-toggle-btn {
        width: 100%;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.notification-card {
    animation: slideInRight 0.3s ease;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.notification-card:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.notification-group-header:focus {
    outline: 2px solid #6366f1;
    outline-offset: -2px;
}

