/**
 * 共用叮噹通知元件樣式
 * Web3 科技化風格，與 web3-theme.css 一致
 */

/* 叮噹容器 */
.notification-bell-container {
    position: relative;
    display: inline-block;
}

/* 叮噹按鈕 */
.notification-bell-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all var(--web3-transition-normal, 0.3s ease);
    font-size: 1.25rem;
    color: var(--web3-text-primary, #ffffff);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell-btn:hover {
    background: var(--web3-glass-bg-light, rgba(255, 255, 255, 0.06));
    transform: scale(1.1);
}

.bell-icon {
    display: block;
    line-height: 1;
}

/* Badge（未讀數） */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #e53e3e;
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translate(25%, -25%);
}

/* Dropdown 選單 */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--web3-glass-bg, rgba(26, 31, 58, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--web3-glass-border, rgba(0, 212, 255, 0.3));
    border-radius: var(--web3-radius-lg, 16px);
    box-shadow: var(--web3-shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.5)), 
                var(--web3-shadow-neon, 0 0 0 1px rgba(78, 234, 255, 0.10), 0 0 28px rgba(78, 234, 255, 0.08));
    min-width: 320px;
    max-width: 400px;
    max-height: 500px;
    overflow: hidden;
    z-index: 1001;
    display: none;
}

/* Dropdown Header */
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--web3-glass-border-light, rgba(255, 255, 255, 0.12));
}

.notification-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--web3-text-primary, #ffffff);
}

.mark-all-read-btn {
    background: var(--web3-glass-bg-medium, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--web3-glass-border-light, rgba(255, 255, 255, 0.12));
    color: var(--web3-text-secondary, #e0e0e0);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--web3-transition-fast, 0.15s ease);
}

.mark-all-read-btn:hover {
    background: var(--web3-glass-bg-light, rgba(255, 255, 255, 0.12));
    border-color: var(--web3-neon-blue, #00d4ff);
    color: var(--web3-neon-blue, #00d4ff);
}

/* 通知列表 */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.notification-list::-webkit-scrollbar {
    width: 6px;
}

.notification-list::-webkit-scrollbar-track {
    background: var(--web3-glass-bg-light, rgba(255, 255, 255, 0.06));
}

.notification-list::-webkit-scrollbar-thumb {
    background: var(--web3-glass-border-medium, rgba(78, 234, 255, 0.22));
    border-radius: 3px;
}

.notification-list::-webkit-scrollbar-thumb:hover {
    background: var(--web3-neon-blue, #00d4ff);
}

/* 通知項目 */
.notification-item {
    position: relative;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--web3-glass-border-light, rgba(255, 255, 255, 0.08));
    cursor: pointer;
    transition: all var(--web3-transition-fast, 0.15s ease);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: var(--web3-glass-bg-light, rgba(255, 255, 255, 0.08));
}

.notification-item-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.notification-item-content {
    position: relative;
    z-index: 0;
}

.notification-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--web3-text-primary, #ffffff);
    margin-bottom: 0.25rem;
}

.notification-item-body {
    font-size: 0.75rem;
    color: var(--web3-text-secondary, #e0e0e0);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.notification-item-time {
    font-size: 0.625rem;
    color: var(--web3-text-muted, #a0a0a0);
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--web3-text-muted, #a0a0a0);
    font-size: 0.875rem;
}

/* Toast 通知容器 */
.notification-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

/* Toast 通知 */
.notification-toast {
    background: var(--web3-glass-bg, rgba(26, 31, 58, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--web3-glass-border, rgba(0, 212, 255, 0.3));
    border-radius: var(--web3-radius-md, 12px);
    box-shadow: var(--web3-shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.5)), 
                var(--web3-shadow-neon-blue, 0 0 20px rgba(0, 212, 255, 0.3));
    padding: 1rem;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: auto;
    transform: translateX(400px);
    opacity: 0;
    transition: all var(--web3-transition-normal, 0.3s ease);
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-toast-content {
    flex: 1;
}

.notification-toast-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--web3-text-primary, #ffffff);
    margin-bottom: 0.25rem;
}

.notification-toast-body {
    font-size: 0.75rem;
    color: var(--web3-text-secondary, #e0e0e0);
    line-height: 1.4;
}

.notification-toast-close {
    background: none;
    border: none;
    color: var(--web3-text-muted, #a0a0a0);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--web3-transition-fast, 0.15s ease);
    flex-shrink: 0;
}

.notification-toast-close:hover {
    color: var(--web3-text-primary, #ffffff);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .notification-dropdown {
        min-width: 280px;
        max-width: calc(100vw - 2rem);
        right: -1rem;
    }
    
    .notification-toast {
        min-width: 250px;
        max-width: calc(100vw - 2rem);
        right: 1rem;
    }
}
