/**
 * Team Portal - Real-time Notifications System Styles
 * 
 * @package    TeamPortal
 * @subpackage Notifications
 * @since      Phase 7.1
 * @version    2.0.0
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --tp-notif-primary: #2563eb;
    --tp-notif-success: #10b981;
    --tp-notif-warning: #f59e0b;
    --tp-notif-error: #ef4444;
    --tp-notif-info: #3b82f6;
    
    --tp-notif-bg: #ffffff;
    --tp-notif-text: #1f2937;
    --tp-notif-border: #e5e7eb;
    --tp-notif-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    
    --tp-notif-duration: 300ms;
    --tp-notif-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    --tp-notif-bg: #1e293b;
    --tp-notif-text: #f1f5f9;
    --tp-notif-border: #334155;
    --tp-notif-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Notification Trigger Button
   ============================================ */
.tp-notification-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--tp-notif-text);
    cursor: pointer;
    transition: all var(--tp-notif-duration) var(--tp-notif-easing);
}

.tp-notification-trigger:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-mode .tp-notification-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tp-notification-trigger i {
    font-size: 18px;
}

/* Badge */
.tp-notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    background: var(--tp-notif-error);
    border-radius: 9px;
    border: 2px solid var(--tp-notif-bg);
    animation: tp-notif-badge-pulse 2s ease-in-out infinite;
}

@keyframes tp-notif-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   Notification Center (Panel)
   ============================================ */
.tp-notification-center {
    position: fixed;
    top: 60px;
    right: -400px;
    width: 380px;
    max-height: calc(100vh - 80px);
    background: var(--tp-notif-bg);
    border-radius: 12px;
    box-shadow: var(--tp-notif-shadow);
    border: 1px solid var(--tp-notif-border);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: all var(--tp-notif-duration) var(--tp-notif-easing);
}

.tp-notification-center.tp-nc-active {
    right: 20px;
    opacity: 1;
}

/* Header */
.tp-nc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tp-notif-border);
}

.tp-nc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tp-notif-text);
}

.tp-nc-title i {
    color: var(--tp-notif-primary);
}

.tp-nc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: var(--tp-notif-primary);
    border-radius: 11px;
}

.tp-nc-actions {
    display: flex;
    gap: 4px;
}

.tp-nc-action-btn,
.tp-nc-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--tp-notif-text);
    cursor: pointer;
    transition: all 200ms ease;
}

.tp-nc-action-btn:hover,
.tp-nc-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark-mode .tp-nc-action-btn:hover,
.dark-mode .tp-nc-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Tabs */
.tp-nc-tabs {
    display: flex;
    gap: 0;
    padding: 12px 20px;
    border-bottom: 1px solid var(--tp-notif-border);
}

/* Settings Modal */
.tp-nc-settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}

.tp-nc-settings-modal.is-open {
    display: flex;
}

.tp-nc-settings-card {
    width: min(860px, 95vw);
    max-height: 85vh;
    background: var(--tp-notif-bg);
    border: 1px solid var(--tp-notif-border);
    border-radius: 16px;
    box-shadow: var(--tp-notif-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tp-nc-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tp-notif-border);
}

.tp-nc-settings-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--tp-notif-text);
}

.tp-nc-settings-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--tp-notif-text);
    cursor: pointer;
}

.tp-nc-settings-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

.tp-nc-settings-body {
    padding: 16px 20px;
    overflow: auto;
}

.tp-nc-settings-hint {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 13px;
}

.tp-nc-settings-grid {
    display: grid;
    gap: 12px;
}

.tp-nc-settings-row {
    border: 1px solid var(--tp-notif-border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(248, 250, 252, 0.6);
}

.tp-nc-settings-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--tp-notif-text);
}

.tp-nc-settings-fields {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tp-nc-settings-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
}

.tp-nc-settings-field input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--tp-notif-border);
    border-radius: 8px;
    background: var(--tp-notif-bg);
    color: var(--tp-notif-text);
}

.tp-nc-settings-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--tp-notif-border);
    display: flex;
    justify-content: flex-end;
    background: rgba(248, 250, 252, 0.6);
}

.tp-nc-settings-save {
    background: var(--tp-notif-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 700;
}

.tp-nc-settings-save:hover {
    filter: brightness(0.96);
}

.tp-nc-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--tp-notif-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tp-nc-tab:hover {
    background: rgba(0, 0, 0, 0.03);
}

.tp-nc-tab.active {
    background: var(--tp-notif-primary);
    color: #ffffff;
}

.tp-nc-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
}

/* List */
.tp-nc-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.tp-nc-list::-webkit-scrollbar {
    width: 6px;
}

.tp-nc-list::-webkit-scrollbar-track {
    background: transparent;
}

.tp-nc-list::-webkit-scrollbar-thumb {
    background: var(--tp-notif-border);
    border-radius: 3px;
}

.tp-nc-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Item */
.tp-nc-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tp-notif-border);
    cursor: pointer;
    transition: all 200ms ease;
}

.tp-nc-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.dark-mode .tp-nc-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tp-nc-item.unread {
    background: rgba(37, 99, 235, 0.05);
}

.tp-nc-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--tp-notif-primary);
}

/* Icon */
.tp-nc-item-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 18px;
}

.tp-nc-icon-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tp-notif-success);
}

.tp-nc-icon-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--tp-notif-warning);
}

.tp-nc-icon-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--tp-notif-error);
}

.tp-nc-icon-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--tp-notif-info);
}

/* Content */
.tp-nc-item-content {
    flex: 1;
    min-width: 0;
}

.tp-nc-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-notif-text);
    margin-bottom: 4px;
}

.tp-nc-item-message {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
    line-height: 1.4;
    word-wrap: break-word;
}

.dark-mode .tp-nc-item-message {
    color: #9ca3af;
}

.tp-nc-item-time {
    font-size: 12px;
    color: #9ca3af;
}

/* Delete Button */
.tp-nc-item-delete {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #9ca3af;
    opacity: 0;
    cursor: pointer;
    transition: all 200ms ease;
}

.tp-nc-item:hover .tp-nc-item-delete {
    opacity: 1;
}

.tp-nc-item-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--tp-notif-error);
}

/* Empty State */
.tp-nc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.tp-nc-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.tp-nc-empty p {
    font-size: 14px;
    margin: 0;
}

/* ============================================
   Toast Notifications
   ============================================ */
.tp-toast-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Positions */
.tp-toast-top-right {
    top: 20px;
    right: 20px;
}

.tp-toast-top-left {
    top: 20px;
    left: 20px;
}

.tp-toast-bottom-right {
    bottom: 20px;
    right: 20px;
}

.tp-toast-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toast */
.tp-toast {
    position: relative;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--tp-notif-bg);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(400px);
    transition: all var(--tp-notif-duration) var(--tp-notif-easing);
    overflow: hidden;
}

.tp-toast-top-left .tp-toast,
.tp-toast-bottom-left .tp-toast {
    transform: translateX(-400px);
}

.tp-toast.tp-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.tp-toast.tp-toast-hiding {
    opacity: 0;
    transform: translateX(400px);
}

.tp-toast-top-left .tp-toast.tp-toast-hiding,
.tp-toast-bottom-left .tp-toast.tp-toast-hiding {
    transform: translateX(-400px);
}

/* Types */
.tp-toast-success {
    border-left-color: var(--tp-notif-success);
}

.tp-toast-warning {
    border-left-color: var(--tp-notif-warning);
}

.tp-toast-error {
    border-left-color: var(--tp-notif-error);
}

.tp-toast-info {
    border-left-color: var(--tp-notif-info);
}

/* Icon */
.tp-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.tp-toast-success .tp-toast-icon {
    color: var(--tp-notif-success);
}

.tp-toast-warning .tp-toast-icon {
    color: var(--tp-notif-warning);
}

.tp-toast-error .tp-toast-icon {
    color: var(--tp-notif-error);
}

.tp-toast-info .tp-toast-icon {
    color: var(--tp-notif-info);
}

/* Content */
.tp-toast-content {
    flex: 1;
    min-width: 0;
}

.tp-toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tp-notif-text);
    margin-bottom: 4px;
}

.tp-toast-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    word-wrap: break-word;
}

.dark-mode .tp-toast-message {
    color: #9ca3af;
}

/* Close Button */
.tp-toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: all 200ms ease;
}

.tp-toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--tp-notif-text);
}

/* Progress Bar */
.tp-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.3;
    transform-origin: left;
}

.tp-toast-success .tp-toast-progress {
    color: var(--tp-notif-success);
}

.tp-toast-warning .tp-toast-progress {
    color: var(--tp-notif-warning);
}

.tp-toast-error .tp-toast-progress {
    color: var(--tp-notif-error);
}

.tp-toast-info .tp-toast-progress {
    color: var(--tp-notif-info);
}

@keyframes tp-toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .tp-notification-center {
        right: -100%;
        width: 100%;
        max-width: none;
        height: 100vh;
        max-height: none;
        top: 0;
        border-radius: 0;
    }
    
    .tp-notification-center.tp-nc-active {
        right: 0;
    }
    
    .tp-toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .tp-toast {
        min-width: 0;
        width: 100%;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.tp-notification-trigger:focus,
.tp-nc-action-btn:focus,
.tp-nc-close:focus,
.tp-nc-tab:focus,
.tp-nc-item:focus,
.tp-toast-close:focus {
    outline: 2px solid var(--tp-notif-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .tp-notification-center,
    .tp-toast,
    .tp-nc-item,
    .tp-notification-trigger {
        transition: none;
        animation: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .tp-notification-trigger,
    .tp-notification-center,
    .tp-toast-container {
        display: none !important;
    }
}
