/* Critical CSS - 첫 화면에 필요한 최소한의 스타일만 */

:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-tertiary: #f9fafb;
    --text-primary: #333333;
    --text-secondary: #6b7280;
    --text-tertiary: #4b5563;
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --global-nav-bg: #1e293b;
    --global-nav-text: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", 
                 "Segoe UI", "Malgun Gothic", Roboto, "Noto Sans KR", 
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    min-height: 100vh;
}
/* GPU 가속화 */
.calculator-card, .guide-wrapper, .global-nav {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 글로벌 네비게이션 */
.global-nav {
    background: var(--global-nav-bg);
    color: var(--global-nav-text);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.global-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 1.5rem;
    height: 52px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--global-nav-text);
    text-decoration: none;
    margin-right: 2rem;
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--global-nav-text);
    font-size: 1.5rem;
    padding: 0.75rem 0.75rem 0.75rem 0.5rem;
    margin-right: 0.5rem;
    margin-left: 0;
    cursor: pointer;
    user-select: none;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* 네비게이션 메뉴 - Critical에 추가! */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--global-nav-text);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 1rem 1.25rem;
    display: block;
    transition: all var(--transition-base);
    border-left: 1px solid rgba(255,255,255,0.1);
}

.nav-menu li:first-child a {
    border-left: none;
}

.nav-menu a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-menu .active {
    background: rgba(255,255,255,0.15);
    font-weight: 600;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1001;
    display: none;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown-content a {
    color: var(--text-primary);
    padding: 0.625rem 0.875rem;
    border: none;
    border-bottom: 1px solid var(--border-primary);
    font-size: 0.8125rem;
}

.nav-dropdown-content a:hover {
    background: var(--bg-tertiary);
}

.nav-dropdown-content a:last-child {
    border-bottom: none;
}

/* 브레드크럼 */
.breadcrumb {
    background: var(--bg-primary);
    padding: 0.4375rem 0;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    margin: 0 0.4375rem;
    color: var(--text-secondary);
}

/* 메인 타이틀 섹션 */
.main-title-section {
    background: var(--bg-primary);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.main-title-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.main-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    line-height: 1.3;
}

.title-icon {
    font-size: 2rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.main-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    line-height: 1.5;
}

/* 메인 레이아웃 */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1.75rem;
    padding: 1.75rem 1.5rem;
    min-height: 800px;
    contain: layout;
}

.calculator-wrapper {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 90px);
}

.calculator-card {
    background: var(--bg-primary);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
}

/* 계산기 헤더 */
.calculator-header {
    background: var(--bg-primary);
    padding: 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--border-primary);
}

.calculator-header.compact {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.625rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
}

.author-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    font-weight: 700;
    font-size: 11px;
}

.author-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.update-badge {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.3125rem 0.625rem;
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    font-weight: 500;
    white-space: nowrap;
    cursor: default;
    transition: all var(--transition-base);
}

.calculator-body {
    background: var(--bg-primary);
    padding: 0.875rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* 가이드 영역 */
.guide-wrapper {
    flex: 1;
    background: var(--bg-primary);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    min-height: 400px;
    min-width: 0;
}

/* FAQ 섹션 */
.faq-section {
    min-height: 500px;
    background: var(--bg-tertiary);
    padding: 3rem 0;
    margin-top: 3rem;
    contain: layout;
}

/* 스켈레톤 UI */
.guide-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 반응형 */
@media (max-width: 768px) {
    .main-title {
        font-size: 1.5rem;
        flex-direction: row;
        gap: 0.4375rem;
    }
    
    .title-icon {
        font-size: 1.375rem;
    }
    
    .main-subtitle {
        font-size: 0.875rem;
    }
    
    .main-wrapper {
        flex-direction: column;
        padding: 0;
        gap: 0;
        min-height: auto;
    }
    
    .calculator-wrapper {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 1.5rem;
    }
    
    .calculator-card {
        height: auto;
        border-radius: 0;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }
    
    .calculator-body {
        padding: 0.875rem;
        overflow-y: visible;
    }
    
    .guide-wrapper {
        border-radius: 0;
        padding: 1.25rem;
        margin-top: 0;
        border-top: 6px solid var(--bg-secondary);
    }
    
    .mobile-menu-btn {
        display: block !important;
    }
    
    .nav-menu {
        display: none !important;
    }
    
    .breadcrumb-container {
        padding: 0 1rem;
    }
}

/* 히어로 섹션 제거 */
.hero-section {
    display: none;
}