/* 공통 모달 스타일 - K-Smart AI 스타일 */
:root {
    --modal-bg: rgba(0, 0, 0, 0.6);
    --modal-card: #ffffff;
    --modal-primary: #8b5cf6;
    --modal-secondary: #a78bfa;
    --modal-text: #1f2937;
    --modal-desc: #6b7280;
    --modal-success: #10b981;
    --modal-error: #ef4444;
}

.ks-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.ks-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ks-modal-card {
    background: var(--modal-card);
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.ks-modal-overlay.active .ks-modal-card {
    transform: translateY(0);
}

.ks-modal-icon {
    width: 60px;
    height: 60px;
    background: var(--modal-secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.2rem;
}

.ks-modal-icon.success {
    background-color: var(--modal-success);
}

.ks-modal-icon.error {
    background-color: var(--modal-error);
}

.ks-modal-icon.info {
    background-color: var(--modal-primary);
}

.ks-modal-icon.confirm {
    background-color: #f59e0b;
}

.ks-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--modal-text);
    margin-bottom: 0.8rem;
}

.ks-modal-message {
    font-size: 1rem;
    color: var(--modal-desc);
    line-height: 1.6;
    margin-bottom: 2rem;
    white-space: pre-wrap;
}

.ks-modal-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.ks-modal-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.ks-modal-btn.primary {
    background: var(--modal-primary);
    color: white;
}

.ks-modal-btn.primary:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.ks-modal-btn.secondary {
    background: #f3f4f6;
    color: var(--modal-text);
}

.ks-modal-btn.secondary:hover {
    background: #e5e7eb;
}

/* ---------------------------------------------------- */
/* 정보/액션 모달 스타일 (Info/Action Modal) */
/* ---------------------------------------------------- */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    backdrop-filter: blur(4px);
    animation: ksFadeIn 0.3s ease;
}

.info-modal.active {
    display: flex;
}

.info-modal-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: ksSlideUp 0.3s ease;
    color: #1f2937;
    text-align: left;
    /* 기본 정렬 */
}

/* 다크 테마 모달 (필요시) */
body.dark-theme .info-modal-content,
.info-modal-content.dark {
    background: #1f2937;
    color: #f3f4f6;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes ksFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ksSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.info-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.info-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #4f46e5;
}

.info-modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.info-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
    transform: rotate(90deg);
}

.info-modal-body {
    font-size: 1rem;
    line-height: 1.6;
}

/* 폼 필드 스타일 */
.form-field {
    margin-bottom: 1.25rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #ffffff;
    color: #1f2937;
}

.form-field input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* 다크 모드 입력 필드 */
.info-modal-content.dark .form-field label {
    color: #e5e7eb;
}

.info-modal-content.dark .form-field input {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}

.info-modal-content.dark .form-field input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.1);
}

.form-message {
    font-size: 0.85rem;
    margin-top: 0.4rem;
    min-height: 1.2rem;
}

.form-message.error {
    color: #ef4444;
}

.form-message.success {
    color: #10b981;
}

/* 공통 버튼들 */
.ks-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.ks-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.ks-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.ks-btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.ks-btn-secondary:hover {
    background: #e5e7eb;
}