/* 반디집 스타일 - 깔끔하고 직관적인 UI */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 반디집 스타일 컬러 팔레트 */
    --primary: #0078d7;
    --primary-hover: #005a9e;
    --primary-light: #e6f2ff;
    --secondary: #2d8659;
    --secondary-hover: #236d48;
    --accent: #ff8c00;

    /* 배경 및 표면 */
    --bg-main: #f5f5f5;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f0;

    /* 텍스트 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;

    /* 경계선 */
    --border-light: #e0e0e0;
    --border-medium: #d0d0d0;
    --border-dark: #c0c0c0;

    /* 상태 */
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;

    /* 그림자 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-main);
    font-size: 14px;
}

/* 헤더 */
header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: "📋";
    font-size: 24px;
}

.nav-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary);
}

/* 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.narrow-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* 히어로 섹션 */
.hero {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 32px;
}

.hero h1 {
    font-size: 32px;
    margin-bottom: 16px;
    font-weight: 600;
}

.hero p {
    font-size: 16px;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* 섹션 */
section {
    margin-bottom: 32px;
}

section h2 {
    font-size: 22px;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

/* 카드 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-light);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--primary);
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

/* 버튼 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.btn:hover {
    background-color: var(--primary-hover);
}

.btn:active {
    transform: translateY(1px);
}

.btn-secondary {
    background-color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
}

.btn-success {
    background-color: var(--success);
}

.btn-success:hover {
    background-color: #218838;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn:disabled {
    background-color: var(--border-medium);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 도구 컨테이너 */
.tool-container {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 32px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.upload-area {
    border: 2px dashed var(--border-medium);
    border-radius: 8px;
    padding: 48px 32px;
    text-align: center;
    background-color: var(--bg-main);
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.upload-area.dragover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    border-style: solid;
}

.upload-area h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-muted);
    font-size: 13px;
}

input[type="file"] {
    display: none;
}

/* 결과 영역 */
.result-area {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: none;
    border: 1px solid var(--border-light);
}

.result-area.active {
    display: block;
}

.result-preview {
    text-align: center;
    margin-bottom: 24px;
    padding: 24px;
    background: var(--bg-main);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.result-preview img,
.result-preview canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    background:
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* FAQ */
.faq-item {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.faq-item h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.faq-item h3::before {
    content: "Q.";
    font-weight: 700;
    color: var(--accent);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 24px;
}

/* 알림 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: var(--success);
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: var(--error);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: var(--info);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: var(--warning);
}

/* 광고 플레이스홀더 */
.ad-placeholder {
    background-color: var(--bg-main);
    border: 1px dashed var(--border-medium);
    border-radius: 4px;
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    margin: 24px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* 푸터 */
footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 24px;
    text-align: center;
    margin-top: 48px;
}

footer p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 8px;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* 로딩 스피너 */
.spinner {
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 24px auto;
    display: none;
}

.spinner.active {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 가이드 콘텐츠 */
.guide-content {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.guide-content h3 {
    color: var(--primary);
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.guide-content ul,
.guide-content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.guide-content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.guide-step {
    background: var(--bg-main);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: 4px;
}

.guide-step strong {
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

/* 배지 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background-color: #d4edda;
    color: var(--success);
}

.badge-warning {
    background-color: #fff3cd;
    color: var(--warning);
}

/* 진행 표시 */
.progress {
    height: 8px;
    background-color: var(--bg-main);
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

/* 템플릿 그리드 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.template-item {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--border-light);
    transition: transform 0.2s;
}

.template-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-preview {
    width: 100%;
    height: 150px;
    background: var(--bg-main);
    border: 2px solid var(--border-light);
    border-radius: 4px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

/* 반응형 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 14px;
    }

    nav {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }

    .nav-links {
        justify-content: center;
    }

    .card-grid,
    .template-grid {
        grid-template-columns: 1fr;
    }

    .tool-container {
        padding: 20px;
    }

    .upload-area {
        padding: 32px 20px;
    }
}

@media (max-width: 480px) {
    .container,
    .narrow-container {
        padding: 16px;
    }

    .hero {
        padding: 32px 16px;
    }

    .tool-container {
        padding: 16px;
    }

    section h2 {
        font-size: 18px;
    }
}

/* 유틸리티 클래스 */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
