/**
 * AlBND - Enhanced Notifications Styles
 * RCJY Dark Theme
 */

/* =========================================================================
   VARIABLES
   ========================================================================= */

:root {
    --notif-primary: var(--primary);
    --notif-success: var(--success);
    --notif-warning: var(--warning);
    --notif-danger: var(--danger);
    --notif-purple: #814FFF;
    --notif-navy: #052976;
    --notif-dark: var(--bg-primary);
    --notif-card-bg: var(--bg-card);
    --notif-border: rgba(76, 196, 255, 0.15);
    --notif-text: var(--text-primary);
    --notif-text-muted: var(--text-secondary);
}

/* =========================================================================
   NOTIFICATION BELL (Header)
   ========================================================================= */

.notification-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--notif-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: rgba(76, 196, 255, 0.1);
    color: var(--notif-primary);
}

.notification-badge,
.notif-count {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    background: var(--notif-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    transform: translate(25%, -25%);
    animation: badgePulse 2s infinite;
}

[dir="rtl"] .notification-badge,
[dir="rtl"] .notif-count {
    right: auto;
    left: 0;
    transform: translate(-25%, -25%);
}

@keyframes badgePulse {
    0%, 100% { transform: translate(25%, -25%) scale(1); }
    50% { transform: translate(25%, -25%) scale(1.1); }
}

[dir="rtl"] @keyframes badgePulse {
    0%, 100% { transform: translate(-25%, -25%) scale(1); }
    50% { transform: translate(-25%, -25%) scale(1.1); }
}

/* =========================================================================
   NOTIFICATION PANEL
   ========================================================================= */

.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    background: var(--notif-dark);
    border-left: 1px solid var(--notif-border);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

[dir="rtl"] .notification-panel {
    right: auto;
    left: -400px;
    border-left: none;
    border-right: 1px solid var(--notif-border);
    transition: left 0.3s ease;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.5);
}

.notification-panel.open {
    right: 0;
}

[dir="rtl"] .notification-panel.open {
    left: 0;
}

.notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.notification-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =========================================================================
   PANEL HEADER
   ========================================================================= */

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--notif-border);
    background: var(--notif-card-bg);
}

.notification-panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--notif-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-panel-header h3 i {
    color: var(--notif-primary);
}

.notification-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--notif-text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(76, 196, 255, 0.1);
    color: var(--notif-primary);
}

/* =========================================================================
   PANEL TABS
   ========================================================================= */

.notification-panel-tabs {
    display: flex;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    background: var(--notif-card-bg);
    border-bottom: 1px solid var(--notif-border);
}

.notif-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--notif-border);
    border-radius: 6px;
    color: var(--notif-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notif-tab:hover {
    background: rgba(76, 196, 255, 0.1);
    color: var(--notif-text);
}

.notif-tab.active {
    background: var(--notif-navy);
    border-color: var(--notif-navy);
    color: white;
}

/* =========================================================================
   PANEL BODY
   ========================================================================= */

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.notification-panel-body::-webkit-scrollbar {
    width: 6px;
}

.notification-panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.notification-panel-body::-webkit-scrollbar-thumb {
    background: var(--notif-border);
    border-radius: 3px;
}

/* =========================================================================
   NOTIFICATION ITEMS
   ========================================================================= */

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.notification-item:hover {
    background: rgba(76, 196, 255, 0.08);
    border-color: var(--notif-border);
}

.notification-item.unread {
    background: rgba(76, 196, 255, 0.05);
    border-left: 3px solid var(--notif-primary);
}

[dir="rtl"] .notification-item.unread {
    border-left: none;
    border-right: 3px solid var(--notif-primary);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(76, 196, 255, 0.15);
    color: var(--notif-primary);
}

.notification-icon.meeting {
    background: rgba(129, 79, 255, 0.15);
    color: var(--notif-purple);
}

.notification-icon.approval {
    background: rgba(32, 204, 118, 0.15);
    color: var(--notif-success);
}

.notification-icon.task {
    background: rgba(255, 176, 32, 0.15);
    color: var(--notif-warning);
}

.notification-icon.alert,
.notification-icon.error {
    background: rgba(255, 71, 87, 0.15);
    color: var(--notif-danger);
}

.notification-icon.system {
    background: rgba(139, 148, 158, 0.15);
    color: var(--notif-text-muted);
}

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

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--notif-text);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-message {
    font-size: 0.8rem;
    color: var(--notif-text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--notif-text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.notification-dot {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 8px;
    height: 8px;
    background: var(--notif-primary);
    border-radius: 50%;
}

[dir="rtl"] .notification-dot {
    right: auto;
    left: 0.75rem;
}

/* =========================================================================
   EMPTY & ERROR STATES
   ========================================================================= */

.notification-empty,
.notification-error,
.notification-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.notification-empty i,
.notification-error i,
.notification-loading i {
    font-size: 3rem;
    color: var(--notif-border);
    margin-bottom: 1rem;
}

.notification-empty p,
.notification-error p {
    color: var(--notif-text-muted);
    margin: 0;
}

.notification-error .btn {
    margin-top: 1rem;
}

.notification-loading i {
    color: var(--notif-primary);
}

/* =========================================================================
   PANEL FOOTER
   ========================================================================= */

.notification-panel-footer {
    padding: 1rem;
    border-top: 1px solid var(--notif-border);
    text-align: center;
    background: var(--notif-card-bg);
}

.view-all-link {
    color: var(--notif-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: #3db8f5;
}

/* =========================================================================
   TOAST
   ========================================================================= */

.notification-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--notif-card-bg);
    border: 1px solid var(--notif-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--notif-text);
    font-size: 0.9rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10001;
}

[dir="rtl"] .notification-toast {
    right: auto;
    left: 2rem;
}

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

.notification-toast.success {
    border-left: 4px solid var(--notif-success);
}

.notification-toast.success i {
    color: var(--notif-success);
}

.notification-toast.error {
    border-left: 4px solid var(--notif-danger);
}

.notification-toast.error i {
    color: var(--notif-danger);
}

.notification-toast.info {
    border-left: 4px solid var(--notif-primary);
}

.notification-toast.info i {
    color: var(--notif-primary);
}

[dir="rtl"] .notification-toast.success,
[dir="rtl"] .notification-toast.error,
[dir="rtl"] .notification-toast.info {
    border-left: none;
    border-right-width: 4px;
    border-right-style: solid;
}

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

@media (max-width: 480px) {
    .notification-panel {
        width: 100%;
        right: -100%;
    }
    
    [dir="rtl"] .notification-panel {
        left: -100%;
    }
    
    .notification-panel.open {
        right: 0;
    }
    
    [dir="rtl"] .notification-panel.open {
        left: 0;
    }
    
    .notification-toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

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

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

[dir="rtl"] @keyframes slideInRight {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* =========================================================================
   DARK MODE SPECIFIC (already dark)
   ========================================================================= */

/* If there's a light mode toggle in the future */
[data-theme="light"] .notification-panel {
    --notif-dark: #ffffff;
    --notif-card-bg: #f8f9fa;
    --notif-border: rgba(0, 0, 0, 0.1);
    --notif-text: #212529;
    --notif-text-muted: #6c757d;
}
