/* UI Components CSS - Dialog & Toast */

/* Toast 样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #e5e7eb;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    line-height: 1.2;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    white-space: pre-wrap;
}

.toast-close {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Dialog 样式 */
.dialog-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dialog-overlay.show {
    opacity: 1;
}

.dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialog.show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.dialog-header {
    padding: 24px 24px 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.dialog-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.dialog-content {
    padding: 0 24px 24px 24px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Dialog 输入框样式 */
.dialog-input-container {
    padding: 0 24px 16px 24px;
}

.dialog-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
    background: #ffffff;
}

.dialog-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dialog-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.dialog-input::placeholder {
    color: #9ca3af;
}

/* 密码输入框样式 */
.dialog-input[type="password"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* 数字输入框样式 */
.dialog-input[type="number"] {
    text-align: right;
}

/* 邮箱输入框样式 */
.dialog-input[type="email"] {
    text-transform: lowercase;
}

.dialog-actions {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
    margin-top: 20px;
}

.dialog-button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.dialog-button.primary {
    background: #3b82f6;
    color: white;
}

.dialog-button.primary:hover {
    background: #2563eb;
}

.dialog-button.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.dialog-button.secondary:hover {
    background: #e5e7eb;
}

.dialog-button.danger {
    background: #ef4444;
    color: white;
}

.dialog-button.danger:hover {
    background: #dc2626;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .toast-container {
        left: 20px;
        right: 20px;
        top: 20px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .dialog {
        margin: 20px;
        max-width: none;
    }

    .dialog-actions {
        flex-direction: column-reverse;
    }

    .dialog-button {
        width: 100%;
    }
}

/* 动画关键帧 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
} 