/* ============================================================
   Dialog System
   ============================================================ */

.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 99000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: dialogOverlayIn 0.15s ease-out;
}

.dialog-overlay-closing {
    animation: dialogOverlayOut 0.15s ease-in forwards;
}

@keyframes dialogOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes dialogOverlayOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.dialog-box {
    background: rgba(28, 28, 35, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(102, 126, 234, 0.15);
    min-width: 320px;
    max-width: 480px;
    width: 100%;
    animation: dialogBoxIn 0.18s cubic-bezier(0.2, 0, 0, 1);
    color: #e8e8ee;
    font-family: inherit;
}

@keyframes dialogBoxIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dialog-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.dialog-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.dialog-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dialog-message {
    font-size: 14px;
    line-height: 1.55;
    color: #b8b8c8;
}

.dialog-extra {
    margin-top: 4px;
}

.dialog-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #e8e8ee;
    font-size: 14px;
    padding: 8px 10px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}

.dialog-input:focus {
    border-color: rgba(102, 126, 234, 0.7);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.dialog-footer {
    padding: 12px 20px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.dialog-btn {
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    outline: none;
}

.dialog-btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    color: #b8b8c8;
}

.dialog-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #e8e8ee;
}

.dialog-btn-primary {
    background: rgba(102, 126, 234, 0.85);
    border-color: rgba(102, 126, 234, 0.5);
    color: #ffffff;
}

.dialog-btn-primary:hover {
    background: rgba(102, 126, 234, 1);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.dialog-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.4);
}

/* ============================================================
   Clipboard History Panel
   ============================================================ */

.clipboard-panel {
    position: fixed;
    right: 12px;
    bottom: 62px;
    width: 320px;
    max-height: 480px;
    background: rgba(22, 22, 30, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(102, 126, 234, 0.1);
    z-index: 98000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #e8e8ee;
    font-family: inherit;
}

.clipboard-panel-offscreen {
    display: none;
}

.clipboard-panel-visible {
    display: flex;
    animation: clipboardPanelIn 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.clipboard-panel-hidden {
    display: flex;
    animation: clipboardPanelOut 0.15s ease-in forwards;
}

@keyframes clipboardPanelIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes clipboardPanelOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
}

.clipboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.clipboard-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.01em;
}

.clipboard-panel-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.clipboard-panel-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 5px;
    color: #9898aa;
    font-size: 11px;
    padding: 3px 8px;
    cursor: pointer;
    transition: background 0.13s, color 0.13s;
    font-family: inherit;
}

.clipboard-panel-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #e8e8ee;
}

.clipboard-panel-close {
    padding: 3px 7px;
    font-size: 12px;
}

.clipboard-panel-list {
    overflow-y: auto;
    flex: 1;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.clipboard-panel-list::-webkit-scrollbar {
    width: 4px;
}

.clipboard-panel-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

.clipboard-panel-empty {
    padding: 24px 14px;
    text-align: center;
    color: #5a5a6e;
    font-size: 13px;
}

.clipboard-panel-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.12s;
    position: relative;
}

.clipboard-panel-item:last-child {
    border-bottom: none;
}

.clipboard-panel-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.clipboard-panel-item-pinned {
    background: rgba(102, 126, 234, 0.06);
    border-left: 2px solid rgba(102, 126, 234, 0.55);
}

.clipboard-panel-item-pinned:hover {
    background: rgba(102, 126, 234, 0.14);
}

.clipboard-panel-preview {
    font-size: 12px;
    color: #d0d0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    padding-right: 52px;
}

.clipboard-panel-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-right: 52px;
}

.clipboard-panel-op {
    font-size: 10px;
    color: #6868a0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
}

.clipboard-panel-time {
    font-size: 10px;
    color: #5a5a6e;
}

.clipboard-panel-item-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.12s;
}

.clipboard-panel-item:hover .clipboard-panel-item-actions {
    opacity: 1;
}

.clipboard-item-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 4px;
    color: #9898aa;
    font-size: 11px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    padding: 0;
    font-family: inherit;
}

.clipboard-item-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e8e8ee;
}

.clipboard-pin-btn.active {
    color: rgba(102, 126, 234, 0.9);
    border-color: rgba(102, 126, 234, 0.3);
}

.clipboard-del-btn:hover {
    background: rgba(255, 69, 58, 0.2);
    border-color: rgba(255, 69, 58, 0.3);
    color: rgba(255, 100, 90, 0.9);
}
