
@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #f97316;
    --secondary-light: #fb923c;
    --accent: #059669;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
}

/* 배경 패턴 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(249, 115, 22, 0.05) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(0.5deg);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 헤더 섹션 */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    border: 1px solid var(--gray-200);
}

.hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
    line-height: 1.2;
    animation: fadeInUp 1s ease-out;
}

.hero-emoji {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 메인 폼 컨테이너 */
.form-wrapper {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 40px;
    animation: slideInUp 1s ease-out 0.4s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 단계별 섹션 */
.step-section {
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.step-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-100);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
}

.step-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--gray-900);
    flex: 1;
}

/* 선택 카드들 */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.selection-card {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.selection-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
}

.selection-card.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.05));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.selection-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.card-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* 폼 입력 필드 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.input-group {
    position: relative;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    color: var(--gray-900);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-field::placeholder {
    color: var(--gray-400);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-field.textarea {
    min-height: 100px;
    resize: vertical;
}

/* Select 박스 특별 스타일링 */
select.input-field {
    background-color: var(--white);
    color: var(--gray-900);
    cursor: pointer;
}

select.input-field option {
    background-color: var(--white);
    color: var(--gray-900);
    padding: 8px;
}

select.input-field option:hover {
    background-color: var(--gray-50);
}

select.input-field option:checked {
    background-color: var(--primary);
    color: var(--white);
}

/* 체크박스 그룹 */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.checkbox-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-item:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-label {
    color: var(--gray-700);
    font-weight: 500;
    flex: 1;
    cursor: pointer;
    font-size: 0.875rem;
}

/* 숨김 클래스 */
.hidden {
    display: none !important;
}

/* 생성 버튼 */
.generate-button {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border: none;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    display: block;
    margin: 48px auto 0;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.generate-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.generate-button:hover::before {
    left: 100%;
}

.generate-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 미리보기 섹션 */
.preview-section {
    margin-top: 48px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: slideInUp 0.6s ease-out;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.preview-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-button {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
    color: var(--white);
    border: none;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-md);
    font-family: inherit;
}

.download-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.preview-content {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.preview-text {
    color: var(--gray-800);
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 스크롤바 스타일링 */
.preview-content::-webkit-scrollbar {
    width: 6px;
}

.preview-content::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .hero-section {
        padding: 40px 20px;
    }

    .form-wrapper {
        padding: 24px;
        margin-top: 20px;
    }

    .selection-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .preview-header {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-emoji {
        font-size: 3rem;
    }
}

/* 로딩 애니메이션 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 추가 스타일 개선 */
.step-section:last-of-type {
    margin-bottom: 0;
}

.selection-card.selected .card-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.checkbox-item input[type="checkbox"]:checked+.checkbox-label {
    color: var(--primary);
    font-weight: 600;
}
