/**
 * KSeok Lab - Main Styles
 * 메인 스타일시트 - 모든 공통 스타일을 포함
 */

/* 스크롤 기능 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-main);
    z-index: var(--z-toast);
    transition: width 0.1s ease;
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--font-size-lg);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base) var(--transition-cubic);
    z-index: var(--z-fixed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

/* 소셜 공유 버튼 */
.social-share {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    z-index: var(--z-fixed);
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
    box-shadow: var(--shadow);
}

.share-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.share-btn.facebook { background: #1877f2; color: white; }
.share-btn.twitter { background: #1da1f2; color: white; }
.share-btn.kakao { background: #fee500; color: #3c1e1e; }
.share-btn.link { background: #6b7280; color: white; }

/* 히어로 섹션 */
.hero {
    background: var(--organic-bg);
    color: var(--text-primary);
    padding: var(--spacing-2xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 50vh;
    display: flex;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--organic-bg);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.hero p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    margin-bottom: var(--spacing-xl);
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-2xl);
}

.cta-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 700;
    font-size: var(--font-size-lg);
    transition: all var(--transition-base) var(--transition-cubic);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    overflow: hidden;
}

.cta-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 107, 53, 0.6);
}

.cta-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    backdrop-filter: var(--backdrop-blur);
    box-shadow: var(--shadow-light);
}

.cta-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 16px;
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 20px var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-medium);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 섹션 공통 스타일 */
.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    text-align: center;
    line-height: 1.2;
}

[data-theme="dark"] .section-title {
    color: var(--text-primary);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.section-subtitle {
    color: var(--text-secondary);
    text-align: center;
}

/* 다크모드 소셜 공유 버튼 */
[data-theme="dark"] .share-btn.facebook { 
    background: #1877f2; 
    color: white; 
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.3);
}

[data-theme="dark"] .share-btn.twitter { 
    background: #1da1f2; 
    color: white; 
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.3);
}

[data-theme="dark"] .share-btn.kakao { 
    background: #fee500; 
    color: #3c1e1e; 
    box-shadow: 0 4px 15px rgba(254, 229, 0, 0.3);
}

[data-theme="dark"] .share-btn.link { 
    background: #64748b; 
    color: white; 
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.3);
}

[data-theme="dark"] .share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(159, 64, 255, 0.4) !important;
}

/* 다크모드 스크롤 투 탑 버튼 */
[data-theme="dark"] .scroll-to-top {
    background: var(--gradient-main);
    box-shadow: 0 4px 15px rgba(159, 64, 255, 0.4);
}

[data-theme="dark"] .scroll-to-top:hover {
    box-shadow: 0 8px 25px rgba(159, 64, 255, 0.6);
}

/* 버튼 공통 스타일 */
.btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: var(--shadow);
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

/* 카드 공통 스타일 */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-light);
    transition: all var(--transition-base) var(--transition-cubic);
}

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

/* 즐겨찾기 기능 */
.favorite-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    z-index: 5;
}

.favorite-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.favorite-btn.active {
    color: var(--accent);
    background: rgba(255, 107, 53, 0.1);
}

/* 다크모드 대응 */
[data-theme="dark"] .hero {
    background: 
        radial-gradient(ellipse 800px 600px at 20% 20%, rgba(255, 107, 53, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse 700px 500px at 80% 30%, rgba(159, 64, 255, 0.4) 0%, transparent 60%),
        radial-gradient(ellipse 600px 700px at 10% 80%, rgba(255, 105, 180, 0.3) 0%, transparent 60%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 30%, #0f1419 60%, #1a1a2e 100%);
    color: white;
}

[data-theme="dark"] .hero h1 {
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .hero p {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .cta-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .cta-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .stat {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .stat:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .stat-number {
    color: white;
}

[data-theme="dark"] .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .favorite-btn {
    background: rgba(30, 41, 59, 0.9);
    color: var(--text-primary);
}

/* =================== 반응형 디자인 =================== */

/* 태블릿 (768px ~ 1023px) */
@media (max-width: 768px) {
    .hero {
        min-height: 50vh;
        padding: var(--spacing-xl) 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        white-space: normal;
        line-height: 1.2;
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
    }

    .stat {
        padding: var(--spacing-lg);
    }

    .stat-number {
        font-size: 2rem;
    }

    .social-share {
        display: none; /* 태블릿에서는 숨김 */
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-xl);
    }
}

/* 모바일 (~ 480px) */
@media (max-width: 480px) {
    .hero {
        min-height: 40vh;
        padding: var(--spacing-lg) 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: var(--font-size-base);
        line-height: 1.5;
    }

    .hero-stats {
        gap: var(--spacing-sm);
    }

    .stat {
        padding: var(--spacing-md);
    }

    .stat-number {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-sm);
    }
}