/* alert.css - 美化弹窗样式 */

/* ===== 弹窗遮罩层 ===== */
.gkai-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 20px;
}

.gkai-alert-overlay.gkai-alert-show {
    opacity: 1;
    visibility: visible;
}

.gkai-alert-overlay.gkai-alert-closing {
    opacity: 0;
    visibility: hidden;
}

/* ===== 弹窗容器 ===== */
.gkai-alert-container {
    background: var(--bg-secondary, #ffffff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
    padding: 32px 28px 24px;
    text-align: center;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color, #e1e5eb);
}

.gkai-alert-show .gkai-alert-container {
    transform: scale(1) translateY(0);
}

.gkai-alert-closing .gkai-alert-container {
    transform: scale(0.9) translateY(-20px);
}

/* ===== 图标样式 ===== */
.gkai-alert-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.gkai-alert-icon i {
    line-height: 1;
}

/* 不同类型的图标颜色 */
.gkai-alert-info .gkai-alert-icon {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(99, 102, 241, 0.15));
    color: #4f46e5;
}

.gkai-alert-success .gkai-alert-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.15));
    color: #10b981;
}

.gkai-alert-warning .gkai-alert-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.15));
    color: #f59e0b;
}

.gkai-alert-error .gkai-alert-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(248, 113, 113, 0.15));
    color: #ef4444;
}

.gkai-alert-confirm .gkai-alert-icon {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(34, 211, 238, 0.15));
    color: #06b6d4;
}

/* ===== 标题样式 ===== */
.gkai-alert-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #1a1d21);
    margin-bottom: 12px;
    line-height: 1.3;
}

/* ===== 消息内容 ===== */
.gkai-alert-message {
    font-size: 15px;
    color: var(--text-secondary, #5f6368);
    line-height: 1.6;
    margin-bottom: 24px;
    word-break: break-word;
}

/* ===== 按钮区域 ===== */
.gkai-alert-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.gkai-alert-btn {
    flex: 1;
    max-width: 140px;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.gkai-alert-btn:focus {
    outline: none;
}

/* 确认按钮 */
.gkai-alert-btn-confirm {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.gkai-alert-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.gkai-alert-btn-confirm:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* 不同类型的确认按钮颜色 */
.gkai-alert-success .gkai-alert-btn-confirm {
    background: linear-gradient(135deg, #10b981, #34d399);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.gkai-alert-success .gkai-alert-btn-confirm:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.gkai-alert-warning .gkai-alert-btn-confirm {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.gkai-alert-warning .gkai-alert-btn-confirm:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.gkai-alert-error .gkai-alert-btn-confirm {
    background: linear-gradient(135deg, #ef4444, #f87171);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.gkai-alert-error .gkai-alert-btn-confirm:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.gkai-alert-confirm .gkai-alert-btn-confirm {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

.gkai-alert-confirm .gkai-alert-btn-confirm:hover {
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
}

/* 取消按钮 */
.gkai-alert-btn-cancel {
    background: var(--bg-hover, #f0f3f8);
    color: var(--text-secondary, #5f6368);
    border: 1px solid var(--border-color, #e1e5eb);
}

.gkai-alert-btn-cancel:hover {
    background: var(--bg-tertiary, #e8ecf1);
    color: var(--text-primary, #1a1d21);
    transform: translateY(-1px);
}

.gkai-alert-btn-cancel:active {
    transform: translateY(0);
}

/* ===== 暗色主题适配 ===== */
[data-theme="dark"] .gkai-alert-container {
    background: var(--bg-secondary, #1a1d27);
    border-color: var(--border-color, #2d3342);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .gkai-alert-title {
    color: var(--text-primary, #f1f3f5);
}

[data-theme="dark"] .gkai-alert-message {
    color: var(--text-secondary, #a1a7b3);
}

[data-theme="dark"] .gkai-alert-btn-cancel {
    background: var(--bg-hover, #2d3342);
    color: var(--text-secondary, #a1a7b3);
    border-color: var(--border-color, #2d3342);
}

[data-theme="dark"] .gkai-alert-btn-cancel:hover {
    background: var(--bg-tertiary, #252a36);
    color: var(--text-primary, #f1f3f5);
}

/* ===== 响应式适配 ===== */
@media (max-width: 480px) {
    .gkai-alert-overlay {
        padding: 16px;
    }

    .gkai-alert-container {
        padding: 28px 20px 20px;
        border-radius: 14px;
    }

    .gkai-alert-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
        margin-bottom: 16px;
    }

    .gkai-alert-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .gkai-alert-message {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .gkai-alert-buttons {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .gkai-alert-btn {
        max-width: none;
        padding: 14px 20px;
    }
}

/* ===== 动画效果 ===== */
@keyframes gkai-alert-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.gkai-alert-container.shake {
    animation: gkai-alert-shake 0.5s ease;
}
