/* Notification System Styles */

.notification-wrapper {
    position: relative;
}

.notification-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.notification-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.notification-dropdown {
    position: fixed;
    /* Changed from absolute to fixed to break out of sidebar */
    top: 50px;
    /* Default fallback */
    left: 20px;
    /* Default fallback */
    /* Adjust to align better given sidebar space */
    margin-top: 4px;
    width: 300px;
    background: var(--bg-surface) !important;
    /* Force opacity */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-elevated);
    z-index: 99999;
    /* Very high z-index to overlay everything */
    display: none;
    overflow: hidden;
    animation: slideDownFade 0.2s ease;
    transform-origin: top center;
}

[data-theme="dark"] .notification-dropdown {
    background: #0f172a !important;
    /* Force darker opaque background for dark mode */
}

.notification-dropdown.open {
    display: block;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.notification-header span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.clear-notifications-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.clear-notifications-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.notification-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 0;
}

.empty-notifications {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    transition: background 0.2s;
    position: relative;
    cursor: default;
}

.notification-item:hover {
    background: var(--bg-primary);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.04);
}

.notification-item.unread:hover {
    background: rgba(99, 102, 241, 0.08);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-color);
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.notif-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.notif-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.notif-icon.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.notif-icon.info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notif-message {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.notif-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Toast Modern Style (Bottom Right) */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Let clicks pass through container */
}

/* Toast Element */
.toast-modern {
    background: var(--bg-surface);
    /* Uses theme variable */
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

/* Add specialized border accent on left */
.toast-modern.success {
    border-left: 4px solid var(--success);
}

.toast-modern.error {
    border-left: 4px solid var(--error);
}

.toast-modern.warning {
    border-left: 4px solid var(--warning);
}

.toast-modern.info {
    border-left: 4px solid var(--accent-color);
}

[data-theme="dark"] .toast-modern {
    background: rgba(30, 41, 59, 0.95);
    /* Slightly transparent dark bg */
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
}

/* Switch Toggle Styles */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 20px;
}

.switch-toggle input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border-color);
  transition: .3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-tertiary);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(14px);
  background-color: white;
}