/* Wolcheon Studio - Pastels & Cream Theme (Kids Coloring Website) */

:root {
    /* 🌞 Warm & Cozy Theme Variables (Pastels & Cream) */
    --bg-main: #fffdf9;       
    --text-primary: #3d352e;  
    --text-muted: #7d7065;     
    --primary: #ff7f50;       
    --primary-light: #fff0eb; 
    --primary-gradient: linear-gradient(135deg, #ff9e7d, #ff6f61);
    --secondary: #64dfdf;     
    --secondary-bg: #e2f9f9;
    --accent-yellow: #ffdf00; 
    --accent-pink: #ffb8b8;   
    --card-bg: #ffffff;
    --card-border: #f0e6d6;
    --header-bg: rgba(255, 253, 249, 0.9);
    --card-shadow: 0 10px 25px rgba(188, 170, 150, 0.15);
    --border-radius: 24px;
    --font-kids: 'Quicksand', 'Nunito', 'NanumSquareRound', sans-serif;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-kids);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* ☁️ 배경에 둥둥 떠다니는 파스텔 구름 애니메이션 */
.cloud {
    position: absolute;
    font-size: 3rem;
    pointer-events: none;
    z-index: 0;
    opacity: 0.75;
    animation: float 12s ease-in-out infinite alternate;
}

.cloud-1 { top: 15%; left: 5%; animation-duration: 10s; }
.cloud-2 { top: 40%; right: 5%; animation-duration: 14s; font-size: 4rem; }
.cloud-3 { top: 75%; left: 8%; animation-duration: 16s; }
.cloud-4 { top: 60%; left: 85%; animation-duration: 12s; }

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-20px) rotate(5deg); }
}

/* 헤더 영역 */
.main-header {
    background-color: var(--header-bg);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px dashed var(--card-border);
    padding: 15px 0;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}

.logo-img-tag {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-text .highlight {
    color: var(--primary);
}

.main-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    font-family: var(--font-kids);
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.2s ease;
}

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

.nav-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 111, 97, 0.3);
}

/* 메인 컨텐츠 영역 */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.page-section {
    display: none;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

.page-section.active {
    display: block;
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

/* 홈 히어로 섹션 */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--card-bg);
    border: 3px dashed var(--accent-yellow);
    border-radius: var(--border-radius);
    margin-bottom: 40px;
    box-shadow: var(--card-shadow);
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-title .pop-text {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.hero-title .pop-text::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: var(--accent-yellow);
    z-index: -1;
    border-radius: 4px;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 30px auto;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 버튼 스타일링 */
button {
    font-family: var(--font-kids);
    outline: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 18px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(255, 111, 97, 0.35);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(255, 111, 97, 0.45);
}

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

.btn-secondary {
    background-color: var(--secondary-bg);
    color: #0b8484;
    border: 2px solid var(--secondary);
    padding: 12px 28px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--secondary);
    color: white;
    transform: translateY(-2px);
}

/* 특장점 그리드 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.feature-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.feature-card:hover {
    transform: translateY(-8px);
}

.feat-icon {
    font-size: 2.8rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
}

/* 공통 섹션 헤더 */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 600;
}

/* 서적 소개 영역 */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

@media (max-width: 600px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
}

.book-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--border-radius);
    display: flex;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

@media (max-width: 480px) {
    .book-card {
        flex-direction: column;
    }
}

.book-cover-wrapper {
    width: 180px;
    min-height: 240px;
    background-color: #f7eedf;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .book-cover-wrapper {
        width: 100%;
        height: 200px;
    }
}

/* 책 표지 이미지 부재 시 폴백 그래픽 */
.book-fallback-cover {
    width: 140px;
    height: 200px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    color: white;
    padding: 15px;
    text-align: center;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.dino-theme {
    background: linear-gradient(135deg, #10b981, #059669); /* 민트 그린 */
}

.bake-theme {
    background: linear-gradient(135deg, #f472b6, #db2777); /* 솜사탕 핑크 */
}

.cover-emoji {
    font-size: 3.5rem;
}

.book-fallback-cover h4 {
    font-size: 0.95rem;
    font-weight: 800;
}

.book-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-info h3 {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.book-info .tag {
    background-color: #fff9e6;
    color: #e28700;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    width: fit-content;
    margin-bottom: 12px;
}

.book-info .desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.45;
}

.btn-card-primary {
    display: inline-block;
    background: linear-gradient(135deg, #ffc048, #ff9f43);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255, 159, 67, 0.3);
    transition: transform 0.2s ease;
}

.btn-card-primary:hover {
    transform: translateY(-2px);
}

/* AI 매직 스튜디오 레이아웃 */
.studio-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
}

@media (max-width: 800px) {
    .studio-container {
        grid-template-columns: 1fr;
    }
}

.upload-panel, .preview-panel {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

/* 드롭 존 */
.drop-zone {
    border: 3px dashed var(--primary-light);
    background-color: var(--bg-main);
    border-radius: var(--border-radius);
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.drop-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.drop-zone p {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.drop-tip {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* 스튜디오 컨트롤러 */
.studio-controls {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px dashed #f0e6d6;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.btn-reset {
    width: 100%;
    background-color: #f7f3ed;
    color: var(--text-muted);
    border: none;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* 미리보기 패널 */
.preview-wrapper {
    border: 2px dashed var(--card-border);
    border-radius: var(--border-radius);
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-main);
}

.preview-fallback {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.preview-fallback span {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.preview-fallback p {
    font-weight: 600;
    font-size: 1rem;
}

.canvas-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#output-canvas {
    max-width: 100%;
    max-height: 480px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background-color: white; /* 캔버스는 항상 흰색 배경 유지 */
}

.btn-download {
    background: linear-gradient(135deg, #4cd137, #44bd32);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(68, 189, 50, 0.3);
}

.btn-download:hover {
    transform: scale(1.03);
}

/* 블로그 섹션 */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

@media (max-width: 500px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

.blog-card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    gap: 20px;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.blog-card:hover {
    transform: scale(1.01) translateY(-3px);
}

.blog-img {
    font-size: 3.5rem;
    display: flex;
    align-items: center;
}

.blog-content h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.35;
}

.blog-preview {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.read-more {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
}

/* 💳 결제 및 팝업 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(61, 53, 46, 0.5); /* 웜브라운 스크림 */
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    max-width: 480px;
    width: 90%;
    padding: 35px;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalPop {
    0% { transform: translateY(30px) scale(0.9); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
}

.payment-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.payment-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
}

.payment-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
}

.price-tag {
    text-align: center;
    background-color: #fff9eb;
    border: 2px dashed #fbd38d;
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 25px;
}

.price-strike {
    text-decoration: line-through;
    color: #a0aec0;
    font-size: 1.05rem;
    margin-right: 8px;
    font-weight: 600;
}

.price-real {
    font-size: 1.7rem;
    font-weight: 800;
    color: #e65f00;
}

.price-tag .badge {
    display: block;
    background-color: #ff3838;
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 8px;
    width: fit-content;
    margin: 5px auto 0 auto;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-pay-option {
    font-family: var(--font-kids);
    border: none;
    padding: 12px;
    font-size: 1.05rem;
    font-weight: 800;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-pay-option.tosspay {
    background-color: #0050ff;
    color: white;
}

.btn-pay-option.kakaopay {
    background-color: #fee500;
    color: #3c1e1e;
}

.btn-pay-option.card {
    background-color: #f1f3f5;
    color: var(--text-primary);
}

.btn-pay-option:hover {
    transform: translateY(-2px);
    filter: brightness(0.95);
}

.secure-tip {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: #a0aec0;
    font-weight: 600;
}

/* 블로그 기사 모달 커스텀 */
.blog-modal-content {
    max-width: 750px;
    max-height: 80vh;
    overflow-y: auto;
}

.blog-post h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.blog-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    border-bottom: 2px dashed #f0e6d6;
    padding-bottom: 10px;
}

.blog-body p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #4a4540;
    text-align: justify;
}

.blog-body h4 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 25px 0 10px 0;
    color: var(--primary);
}

/* 풋터 영역 */
.main-footer {
    background-color: #f7f3ed;
    border-top: 2px dashed #e4dcd0;
    padding: 30px 20px;
    margin-top: 60px;
    position: relative;
    z-index: 10;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 600px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

.copyright {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

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

.separator {
    color: #d1c7bc;
    margin: 0 8px;
}
