/* notification.css — 通知系統（基本 + 詳細模式） */

/* ── Notification ── */

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s ease;
    max-width: 90vw;
    text-align: center;
    white-space: pre-line;
}

.notification-show {
    transform: translateX(-50%) translateY(0);
}

.notification-success {
    background: #065f46;
    color: #a7f3d0;
    border: 1px solid #059669;
}

.notification-error {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid #dc2626;
}

.notification-warning {
    background: #78350f;
    color: #fde68a;
    border: 1px solid #d97706;
}

/* ── Notification: 詳細模式擴充 ── */

.notification-detailed {
    text-align: left;
    padding: 16px 40px 16px 20px;
    min-width: 320px;
    max-width: min(480px, 90vw);
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity 0.2s ease, background 0.2s ease;
    padding: 0;
    line-height: 1;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.notification-close:active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.notification-close:focus-visible {
    opacity: 1;
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

.notification-message {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0;
}

.notification-detailed .notification-message {
    margin-bottom: 12px;
}

.notification-action {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: inherit;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 12px;
    line-height: 1;
}

.notification-action:hover {
    background: rgba(255, 255, 255, 0.25);
}

.notification-action:active {
    background: rgba(255, 255, 255, 0.35);
}

.notification-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.notification-details {
    border: none;
    margin: 0;
    padding: 0;
}

.notification-details > summary {
    font-size: 0.75rem;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
    user-select: none;
    transition: opacity 0.2s ease;
}

.notification-details > summary::before {
    content: '\25B6 ';
    font-size: 0.6rem;
    display: inline-block;
    transition: transform 0.2s ease;
    margin-right: 4px;
    vertical-align: middle;
}

.notification-details[open] > summary::before {
    transform: rotate(90deg);
}

.notification-details > summary:hover {
    opacity: 1;
}

.notification-details > summary::-webkit-details-marker {
    display: none;
}

.notification-details-content {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-family: 'Cascadia Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.72rem;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}

.notification-details-row {
    display: flex;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-details-label {
    opacity: 0.6;
    flex-shrink: 0;
}

.notification-details-value {
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-family: inherit;
    color: inherit;
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    line-height: 1;
}

.notification-copy:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.notification-copy:active {
    background: rgba(255, 255, 255, 0.3);
}

.notification-copy:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.notification-copy.copied {
    background: #059669;
    border-color: #059669;
    opacity: 1;
}

@media (max-width: 480px) {
    .notification-detailed {
        min-width: unset;
        max-width: 95vw;
        padding: 12px 36px 12px 16px;
    }

    .notification-details-content {
        max-height: 160px;
    }

    .notification-details-row {
        flex-direction: column;
        gap: 2px;
    }

    .notification-details-value {
        padding-left: 8px;
    }
}
