/**
 * TopCalc 계산기 플랫폼 스타일시트
 * 모바일 퍼스트 디자인 (375px ~ 1920px)
 * 프레임워크 없이 순수 CSS로 구현
 */

/* ========================================
   CSS 변수 (색상, 간격, 폰트)
   ======================================== */
:root {
    /* 메인 컬러 */
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #3385d6;

    /* 강조 컬러 */
    --accent: #059669;
    --accent-dark: #047857;

    /* 텍스트 컬러 */
    --text: #1F2937;
    --text-light: #555555;
    --text-muted: #767676;

    /* 배경 컬러 */
    --bg: #FFFFFF;
    --bg-gray: #F9FAFB;
    --bg-dark: #F3F4F6;

    /* 보더 컬러 */
    --border: #E5E7EB;
    --border-dark: #D1D5DB;

    /* 상태 컬러 */
    --success: #0D7A3F;
    --warning: #92600A;
    --error: #C42B2B;
    --info: #1A6FB5;

    /* 레이아웃 */
    --max-width: 720px;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;

    /* 간격 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* 폰트 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;

    /* 그림자 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* ========================================
   기본 리셋 및 전역 스타일
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg-gray);
}

/* ========================================
   레이아웃 - 컨테이너
   ======================================== */
.container {
    max-width: 100%;
    width: 100%;
    padding: 0 var(--spacing-md);
    margin: 0 auto;
}

/* 모바일 환경: 계산기 최대 가로 사이즈 제한 (가독성 최적화) */
@media (max-width: 767px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: var(--max-width);
    }
}

/* ========================================
   헤더
   ======================================== */
.site-header {
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.logo {
    margin-bottom: var(--spacing-md);
}

.logo a {
    text-decoration: none;
    color: var(--primary);
}

.logo h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin: 0;
}

/* ========================================
   카테고리 네비게이션 래퍼 (모바일 스크롤 UX)
   ======================================== */

/* 래퍼: 그라데이션 오버레이를 위한 relative 컨텍스트 */
.category-nav-wrapper {
    position: relative;
    /* 컨테이너 좌우 패딩을 무시하고 화면 끝까지 확장 (모바일) */
    margin-left: calc(-1 * var(--spacing-md));
    margin-right: calc(-1 * var(--spacing-md));
    background: linear-gradient(135deg, #F0F9FF 0%, #F3E8FF 100%);
    padding: 14px 0;
    position: relative;
}

.category-nav-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(59, 130, 246, 0.03) 10px,
            rgba(59, 130, 246, 0.03) 20px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 10px,
            rgba(139, 92, 246, 0.03) 10px,
            rgba(139, 92, 246, 0.03) 20px
        );
    pointer-events: none;
}

/* 좌우 페이드 그라데이션 오버레이 */
.category-nav-gradient {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none; /* 클릭 이벤트 통과 */
    z-index: 2;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 좌측 그라데이션: 흰색 → 투명 */
.category-nav-gradient-left {
    left: 0;
    background: linear-gradient(to right, rgba(240, 249, 255, 1), rgba(240, 249, 255, 0.7), transparent);
}

/* 우측 그라데이션: 흰색 → 투명 */
.category-nav-gradient-right {
    right: 0;
    background: linear-gradient(to left, rgba(243, 232, 255, 1), rgba(243, 232, 255, 0.85), transparent);
}

/* 그라데이션 표시 상태 */
.category-nav-gradient.visible {
    opacity: 1;
}

/* 스크롤 힌트 화살표 아이콘 (모바일 전용) */
.category-scroll-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    pointer-events: none;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    /* 좌우 펄스 애니메이션 (무한 반복) */
    animation: scrollHintPulse 1.5s ease-in-out infinite;
}

.category-scroll-hint svg {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* 힌트 숨김 상태 (스크롤 후) */
.category-scroll-hint.hidden {
    opacity: 0;
    transform: translateY(-50%) scale(0.5);
}

/* 스크롤 힌트 펄스 애니메이션 */
@keyframes scrollHintPulse {
    0%, 100% {
        transform: translateY(-50%) translateX(0) scale(1);
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }
    50% {
        transform: translateY(-50%) translateX(6px) scale(1.1);
        box-shadow: 0 6px 16px rgba(59, 130, 246, 0.6);
    }
}

/* 카테고리 네비게이션 (모바일: 자동 슬라이딩 marquee) */
.category-nav {
    /* 자동 슬라이딩을 위해 overflow 숨김으로 변경 */
    overflow: hidden;
    padding: 0 var(--spacing-md);
}

/* 카테고리 자동 슬라이딩: 우측 끝 → 좌측 끝 무한 반복 */
@keyframes categorySlide {
    0%   { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* 호버 시 멈춤 처리용 — JS에서 paused 클래스를 토글 */
.category-nav.slide-paused .category-list {
    animation-play-state: paused;
}

/* 데스크톱: 힌트 요소 숨김, 래퍼 마진 초기화 */
@media (min-width: 768px) {
    .category-nav-wrapper {
        margin-left: 0;
        margin-right: 0;
    }

    .category-scroll-hint {
        display: none;
    }

    .category-nav-gradient {
        display: none;
    }

    /* 데스크톱: 자동 슬라이딩 해제 — 일반 가로 나열 */
    .category-nav {
        overflow: visible;
        padding: 0;
    }

    /* 데스크톱에서는 category-list 애니메이션 무효화 */
    .category-nav .category-list {
        animation: none !important;
        transform: none !important;
        white-space: normal;
        flex-wrap: wrap;
    }
}

/* 카테고리 리스트: 슬라이딩 애니메이션 컨테이너 */
.category-list {
    display: flex;
    gap: var(--spacing-sm);
    list-style: none;
    white-space: nowrap;
    /* 슬라이딩 애니메이션 — JS가 초기화 후 적용 */
    /* animation: categorySlide 28s linear infinite; */
    /* 초기에는 JS가 동적으로 시작 위치와 duration을 설정 */
}

.category-item {
    flex-shrink: 0;
}

.category-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 20px;
    background: #FFFFFF;
    color: #1E40AF;
    text-decoration: none;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #E5E7EB;
    position: relative;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}

.category-link::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #60A5FA 0%, #8B5CF6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 26px;
    z-index: -1;
}

.category-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.category-link:hover::after {
    width: 120%;
    height: 300%;
}

.category-link:hover::before,
.category-link:focus::before {
    opacity: 1;
}

.category-link:hover,
.category-link:focus {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    border-color: transparent;
    color: #FFFFFF;
}

.category-link:active {
    transform: translateY(-2px) scale(1.05);
}

.category-link:hover *,
.category-link:focus * {
    position: relative;
    z-index: 1;
}

/* ========================================
   빵부스러기 네비게이션
   ======================================== */
.breadcrumb {
    padding: var(--spacing-md) 0;
    background-color: var(--bg-gray);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    list-style: none;
    font-size: var(--font-size-sm);
}

.breadcrumb-item {
    color: var(--text-light);
}

.breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin-left: var(--spacing-sm);
    color: var(--text-muted);
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--text);
}

/* ========================================
   메인 콘텐츠
   ======================================== */
.site-main {
    padding: var(--spacing-xl) 0;
    min-height: 60vh;
}

/* ========================================
   광고 슬롯 (승인 전 숨김)
   ======================================== */
.ad-slot {
    margin: var(--spacing-xl) auto;
    padding: var(--spacing-md);
    background-color: var(--bg-dark);
    border-radius: var(--radius);
    text-align: center;
    min-height: 100px;
}

/* ========================================
   카드 스타일
   ======================================== */
.calc-card,
.result-card,
.content-card,
.category-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   계산기 헤더
   ======================================== */
.calc-header {
    margin-bottom: var(--spacing-xl);
}

.calc-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--spacing-md);
}

.calc-intro {
    font-size: var(--font-size-lg);
    color: var(--text-light);
    line-height: 1.6;
}

/* ========================================
   계산기 섹션
   ======================================== */
.calc-section {
    margin-bottom: var(--spacing-xl);
}

/* 입력 폼 그룹 */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text);
    font-size: var(--font-size-base);
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px var(--spacing-md);
    border: 2px solid #767676; /* WCAG 2.2 SC 1.4.11: UI 컴포넌트 border 최소 3:1 — 변경 전 var(--border) */
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-input:hover,
.form-select:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.08);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15), 0 4px 12px rgba(0, 102, 204, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #767676; /* WCAG 2.2 AA: 대비 4.5:1 — 변경 전 var(--text-muted) opacity:0.7 */
}

.form-help {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
}

/* 버튼 */
.btn {
    display: inline-block;
    padding: 14px var(--spacing-xl);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: var(--bg);
    position: relative;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3385d6 0%, #0066cc 100%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: var(--radius-lg);
}

.btn-primary:hover::after,
.btn-primary:focus::after {
    opacity: 1;
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #E5E7EB 0%, #D1D5DB 100%);
    border-color: var(--border-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: var(--bg);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-group {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* ========================================
   결과 표시
   ======================================== */
.result-section {
    margin-bottom: var(--spacing-xl);
}

.result-card {
    background: #fff;
    color: #111;
    padding: var(--spacing-xl);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.result-highlight {
    text-align: center;
    padding: var(--spacing-xl);
    background-color: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

.result-label {
    font-size: var(--font-size-sm);
    color: #374151;
    margin-bottom: var(--spacing-sm);
}

.result-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: #111;
    margin-bottom: var(--spacing-xs);
}

.result-unit {
    font-size: var(--font-size-lg);
    color: #374151;
}

.result-details {
    background-color: var(--bg);
    color: var(--text);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: none;
}

.result-row-label {
    font-weight: 500;
    color: var(--text-light);
}

.result-row-value {
    font-weight: 600;
    color: var(--text);
}

/* ========================================
   면책 조항
   ======================================== */
.disclaimer-section {
    margin-bottom: var(--spacing-xl);
}

.disclaimer {
    background-color: #FEF3C7;
    border-left: 4px solid var(--warning);
    padding: var(--spacing-lg);
    border-radius: var(--radius);
}

.disclaimer h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
    color: var(--text);
}

.disclaimer p {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.disclaimer p:last-child {
    margin-bottom: 0;
}

/* ========================================
   내부 링크
   ======================================== */
.internal-links-section {
    margin-bottom: var(--spacing-xl);
}

.internal-links {
    padding: var(--spacing-lg);
    background-color: var(--bg-gray);
    border-radius: var(--radius);
}

.internal-links p {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

.internal-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.internal-links a:hover {
    text-decoration: underline;
}

/* ========================================
   콘텐츠 섹션 (SEO)
   ======================================== */
.content-section {
    margin-bottom: var(--spacing-xl);
}

.content-card h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

.content-card h3 {
    font-size: var(--font-size-xl);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text);
}

.content-card p {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
    color: var(--text-light);
}

.content-card ul,
.content-card ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xl);
}

.content-card li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.disclaimer-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
    margin-top: var(--spacing-lg);
}

/* ========================================
   FAQ 섹션
   ======================================== */
.faq-section {
    margin-bottom: var(--spacing-xl);
}

.faq-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

.faq-list {
    background-color: var(--bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: var(--spacing-lg);
    background-color: var(--bg);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text);
    transition: background-color 0.2s;
}

.faq-question:hover {
    background-color: var(--bg-gray);
}

.faq-q-text {
    flex: 1;
}

.faq-icon {
    font-size: var(--font-size-2xl);
    color: var(--primary);
    font-weight: 400;
    width: 24px;
    text-align: center;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer {
    background-color: #FAFAFA;
}
.faq-answer p {
    padding: 0 var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
    color: #333333;
    line-height: 1.6;
}

/* ========================================
   SNS 공유 버튼
   ======================================== */
.share-section {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.share-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
    color: var(--text);
}

.share-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family);
}

.share-btn.kakao {
    background-color: #FEE500;
    color: #000000;
}

/* Kakao SDK createCustomButton이 생성하는 <a> 태그 스타일 */
#kakao-share-wrap a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #000000;
    text-decoration: none;
    font-weight: 600;
}

.share-btn.facebook {
    background-color: #1877F2;
    color: var(--bg);
}

.share-btn.link {
    background-color: var(--bg-dark);
    color: var(--text);
    border: 1px solid var(--border);
}

/* 전달하기 버튼 */
.share-btn.forward {
    background-color: var(--bg-dark);
    color: var(--text);
    border: 1px solid var(--border);
}
.share-btn.forward:hover {
    background-color: #D1D5DB;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   관련 계산기
   ======================================== */
.related-section {
    margin-bottom: var(--spacing-xl);
}

.related-title {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 480px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.related-card {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    transition: all 0.2s;
}

.related-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.related-link {
    text-decoration: none;
    display: block;
}

.related-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

.related-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.5;
}

/* ========================================
   홈페이지 - 인트로 섹션
   ======================================== */
.intro-section {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl) 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg);
    border-radius: var(--radius-lg);
}

.intro-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.intro-desc {
    font-size: var(--font-size-lg);
    line-height: 1.6;
    opacity: 0.95;
}

/* ========================================
   홈페이지 - 섹션 타이틀
   ======================================== */
.section-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text);
}

.section-desc {
    font-size: var(--font-size-base);
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   홈페이지 - 인기/최근 계산기 그리드
   ======================================== */
.popular-section,
.recent-section {
    margin-bottom: var(--spacing-2xl);
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 480px) {
    .calc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .calc-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.calc-card-home,
.calc-card-list {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.2s;
    height: 100%;
}

.calc-card-home:hover,
.calc-card-list:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.calc-card-link {
    text-decoration: none;
    display: block;
}

.calc-card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

.calc-card-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.calc-card-category {
    display: inline-block;
    font-size: var(--font-size-xs);
    color: var(--primary);
    background-color: rgba(0, 102, 204, 0.1);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.calc-card-stats {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ========================================
   홈페이지 - 카테고리 그리드
   ======================================== */
.category-section {
    margin-bottom: var(--spacing-2xl);
}

.category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-card {
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff 0%, #F9FAFB 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #EFF6FF 0%, #F3E8FF 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.3);
}

.category-card-link {
    text-decoration: none;
    display: block;
    position: relative;
    z-index: 1;
}

.category-icon {
    font-size: 56px;
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.15) rotate(5deg);
}

.category-card-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, #1E40AF 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-card-count {
    font-size: var(--font-size-sm);
    color: #8B5CF6;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 1px 2px rgba(139, 92, 246, 0.2);
}

.category-card-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.5;
}

/* ========================================
   홈페이지 - 사이트 소개
   ======================================== */
.about-section {
    margin-bottom: var(--spacing-2xl);
}

.about-content {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.about-content h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--spacing-lg);
    color: var(--text);
}

.about-content p {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
    color: var(--text-light);
}

/* ========================================
   홈페이지 - 최근 계산기 리스트
   ======================================== */
.calc-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.calc-list-item {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    transition: all 0.2s;
}

.calc-list-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.calc-list-link {
    text-decoration: none;
    display: block;
}

.calc-list-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-sm);
}

.calc-list-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.calc-list-category {
    display: inline-block;
    font-size: var(--font-size-xs);
    color: var(--accent);
    background-color: rgba(5, 150, 105, 0.1);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* ========================================
   카테고리 페이지
   ======================================== */
.category-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.category-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--spacing-md);
}

.category-description {
    font-size: var(--font-size-lg);
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.category-meta {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.calculators-section {
    margin-bottom: var(--spacing-xl);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
}

.category-content {
    margin-bottom: var(--spacing-xl);
}

.other-categories {
    margin-bottom: var(--spacing-xl);
}

.category-list-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.category-link-item {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all 0.2s;
}

.category-link-item:hover {
    background-color: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

/* ========================================
   푸터
   ======================================== */
.site-footer {
    background-color: var(--text);
    color: var(--bg);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

.footer-nav {
    margin-bottom: var(--spacing-lg);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md) var(--spacing-lg);
    list-style: none;
}

.footer-links a {
    color: var(--bg);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.copyright {
    text-align: center;
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   계산기 입력 폼 (calculator templates)
   ======================================== */

/* 입력 그룹 */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

/* 숫자 입력 (num-input) */
.num-input,
.calc-input,
.input-field,
.select-input,
.calc-select,
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 16px;
    font-family: var(--font-family);
    color: var(--text);
    background: #FFFFFF;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    appearance: none;
    -webkit-appearance: none;
}

.num-input:hover,
.calc-input:hover,
.input-field:hover,
.select-input:hover,
.calc-select:hover,
.form-control:hover {
    border-color: #3B82F6; /* WCAG 2.2 SC 1.4.11: hover border 대비 3.3:1 — 변경 전 #93C5FD (2.2:1 미달) */
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.num-input:focus,
.calc-input:focus,
.input-field:focus,
.select-input:focus,
.calc-select:focus,
.form-control:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12), 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.num-input::placeholder,
.calc-input::placeholder,
.input-field::placeholder {
    color: #767676; /* WCAG 2.2 AA: 대비 4.5:1 — 변경 전 #C0C7D2 (1.5:1 미달) */
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

/* 라디오 그룹 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid #767676; /* WCAG 2.2 SC 1.4.11: UI 컴포넌트 border 최소 3:1 — 변경 전 #E5E7EB */
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: #fff;
    transition: all 0.2s;
}

.radio-label:hover {
    border-color: #3B82F6; /* WCAG 2.2 SC 1.4.11: hover border 대비 3.3:1 — 변경 전 #93C5FD (2.2:1 미달) */
    background: #EFF6FF;
}

.radio-label input[type="radio"] {
    accent-color: #3B82F6;
}

.radio-label input[type="radio"]:checked ~ span,
.radio-label:has(input:checked) {
    color: #2563EB;
}

.radio-label:has(input:checked) {
    border-color: #3B82F6;
    background: #EFF6FF;
    font-weight: 600;
}

/* 계산 버튼 영역 */
.calc-buttons {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* 계산하기 버튼 */
.btn-calculate {
    flex: 1;
    padding: 16px 24px;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn-calculate::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 12px;
}

.btn-calculate:hover::after { opacity: 1; }

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.btn-calculate:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* 다시하기 버튼 */
.btn-reset {
    padding: 16px 20px;
    background: #F3F4F6;
    color: #555555; /* WCAG 2.2 AA: 대비 8.6:1 — 변경 전 #6B7280 */
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-reset:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
    color: var(--text);
    transform: translateY(-1px);
}

/* ========================================
   계산 결과 테이블
   ======================================== */

/* 결과 상세 */
.result-detail {
    margin-top: 20px;
}

/* 결과 테이블 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.result-table th,
.result-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #e5e7eb;
    color: #111;
}

.result-table th {
    font-weight: 600;
    background: #f9fafb;
    width: 55%;
}

.result-table td {
    font-weight: 600;
    text-align: right;
}

.result-table tr:last-child th,
.result-table tr:last-child td {
    border-bottom: none;
}

.result-table tr:hover th,
.result-table tr:hover td {
    background: #1e3a8a;
    color: #fff;
}

.result-table tr.divider th {
    background: #f3f4f6;
    font-weight: 700;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #374151;
}

.result-table tr.total-row th,
.result-table tr.total-row td {
    background: #1e3a8a;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    border-top: 2px solid #1d4ed8;
}

.result-table tr.total-row:hover th,
.result-table tr.total-row:hover td {
    background: #1d4ed8;
    color: #fff;
}

.result-table tr.highlight-row th,
.result-table tr.highlight-row td {
    background: #eff6ff;
    font-weight: 700;
    color: #1e40af;
}

.result-table tr.highlight-row:hover th,
.result-table tr.highlight-row:hover td {
    background: #1e3a8a;
    color: #fff;
}

.result-table tr.sub-total th,
.result-table tr.sub-total td {
    background: #f3f4f6;
    font-weight: 700;
    color: #374151;
}

/* 결과 강조 */
.result-info {
    margin-top: 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 14px 16px;
}

.result-title {
    font-size: 13px;
    font-weight: 600;
    color: #111;
    margin-bottom: 4px;
}

/* 정보 박스 */
.info-box {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 16px;
    font-size: 14px;
    color: #1E40AF;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

.info-table th,
.info-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.info-table th {
    background: var(--bg-gray);
    font-weight: 600;
    color: var(--text);
}

.info-table td {
    color: var(--text-light);
}

.info-text {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
}

.table-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    font-style: italic;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 2px solid #111;
    border-radius: 8px;
    position: relative;
}

/* 모바일에서 스크롤 가능 힌트 표시 */
@media (max-width: 768px) {
    .table-responsive::after {
        content: '← 좌우 스크롤 →';
        display: block;
        text-align: center;
        font-size: 11px;
        font-weight: 700;
        color: #111;
        background: #f3f4f6;
        border-top: 1px solid #d1d5db;
        padding: 5px;
        letter-spacing: 0.05em;
    }
}

/* 연봉 테이블 */
.salary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 16px;
}

.salary-table th,
.salary-table td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: right;
}

.salary-table th {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #fff;
    font-weight: 600;
    text-align: center;
}

.salary-table tr:nth-child(even) td {
    background: var(--bg-gray);
}

.salary-table tr:hover td {
    background: #EFF6FF;
}

.salary-table .highlight {
    background: #FEF9C3 !important;
    font-weight: 700;
    color: #92400E;
}

.highlight-text {
    color: #2563EB;
    font-weight: 700;
}

/* 결과 카드 히든 -> 표시 애니메이션 */
.result-card {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   유틸리티 클래스
   ======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* ========================================
   반응형 - 태블릿 이상
   ======================================== */
@media (min-width: 768px) {
    .logo {
        margin-bottom: var(--spacing-lg);
    }

    .logo h1 {
        font-size: var(--font-size-3xl);
    }

    .calc-title {
        font-size: 36px;
    }

    .intro-title {
        font-size: 40px;
    }
}

/* ========================================
   계산기 결과 상세 행 (dark card 내부용)
   ======================================== */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.detail-row:last-child {
    border-bottom: none;
}
.detail-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}
.detail-value {
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
    text-align: right;
}

/* 체크박스 레이블 */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    padding: 4px 0;
}
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563EB;
    cursor: pointer;
}

/* 랜덤 숫자 결과 표시 */
.random-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 8px 0;
}
.random-number-badge {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: 700;
    min-width: 48px;
    text-align: center;
}

/* ========================================
   계산기 검색 버튼 & 모달
   ======================================== */
/* 헤더 래퍼 (로고 + 검색버튼 같은 행) */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

/* 검색 버튼 (원형 물방울 스타일) */
.search-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 245, 255, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--primary);
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
    position: relative;
    overflow: hidden;
}
.search-trigger-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.search-trigger-btn:hover::before {
    opacity: 0.1;
}
.search-trigger-btn:hover {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 1);
    border-color: rgba(59, 130, 246, 0.4);
}
.search-trigger-btn svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
.search-trigger-btn span {
    display: none;
}

/* 배너 영역 (로고 + 언어 버튼 영역) */
.header-banner-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 검색 모달 오버레이 */
.search-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}
.search-modal-overlay.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 검색 모달 컨테이너 */
.search-modal {
    background: #ffffff;
    color: #333333;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 var(--spacing-md);
    animation: slideDown 0.25s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 검색 입력 영역 */
.search-modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}
.search-modal-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #767676;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    color: #333333;
    background: #ffffff;
    outline: none;
}
.search-modal-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.search-modal-input::placeholder {
    color: #767676;
}
.search-modal-close {
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #555555;
    font-size: 24px;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
}
.search-modal-close:hover {
    background: #F0F0F0;
    color: #333333;
}

/* 검색 결과 목록 */
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-sm) 0;
}
.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    text-decoration: none;
    color: #333333;
    border-bottom: 1px solid #F0F0F0;
    transition: background 0.15s;
}
.search-result-item:hover {
    background: #F5F8FF;
    color: #1A1A1A;
}
.search-result-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border: 1px solid #BFDBFE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.search-result-info {
    flex: 1;
    min-width: 0;
}
.search-result-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-category {
    font-size: var(--font-size-xs);
    color: #555555;
}
.search-result-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}
.search-stat {
    font-size: 12px;
    color: #767676;
    white-space: nowrap;
}
.search-stat.views::before { content: "👁 "; }
.search-stat.likes::before { content: "❤ "; }
.search-empty {
    text-align: center;
    padding: var(--spacing-2xl);
    color: #767676;
    font-size: var(--font-size-sm);
}

/* ========================================
   좋아요 버튼
   ======================================== */
.like-section {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #fff;
    color: #555555;
    border: 2px solid #D1D5DB;
    border-radius: 50px;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s;
    min-height: 44px;
}
.like-btn:hover {
    border-color: #E11D48;
    color: #E11D48;
    background: #FFF1F2;
    transform: translateY(-1px);
}
.like-btn.liked {
    background: #FFF1F2;
    border-color: #E11D48;
    color: #E11D48;
}
.like-count {
    font-weight: 700;
}

/* ========================================
   브랜드 로고 스타일 + 국기 아이콘 (헤더)
   ======================================== */

/* 로고 링크 내부 정렬: 로고 이미지 + 텍스트 + 국기 아이콘 */
.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.site-logo {
    height: 90px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.logo-link:hover .site-logo {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.3));
}

.site-name-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #1E40AF 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .site-logo {
        height: 110px;
    }
    .site-name-text {
        font-size: 22px;
    }
}

/* 한국 기준 표시 국기 아이콘 (장식용, 클릭 불가) */
.current-country-flag {
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

/* 모바일 가로 넘침 방지 */
@media (max-width: 640px) {
    .header-top {
        gap: 8px;
        padding: 0 12px;
    }

    .site-logo {
        height: 50px;
    }

    .site-name-text {
        font-size: 16px;
    }

    .current-country-flag {
        width: 18px;
        height: 13px;
    }
}

/* ========================================
   계산기 피드 리스트 (인피드 광고 최적화 + 화려한 디자인)
   ======================================== */
.calc-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.calc-feed-item {
    border-bottom: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.calc-feed-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #3B82F6, #8B5CF6);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.calc-feed-item:hover::before {
    transform: scaleY(1);
}

.calc-feed-item:last-child {
    border-bottom: none;
}

.calc-feed-item:hover {
    background: linear-gradient(90deg, #F0F9FF 0%, #FAF5FF 100%);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* 인기 계산기 특별 스타일 */
.calc-feed-item.popular-item {
    background: linear-gradient(90deg, #FEF3C7 0%, #FED7AA 100%);
}

.calc-feed-item.popular-item:hover {
    background: linear-gradient(90deg, #FBBF24 0%, #F59E0B 100%);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3);
}

.calc-feed-item.popular-item .calc-feed-title {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* 최근 업데이트 특별 스타일 */
.calc-feed-item.recent-item {
    background: linear-gradient(90deg, #DBEAFE 0%, #E0E7FF 100%);
}

.calc-feed-item.recent-item:hover {
    background: linear-gradient(90deg, #93C5FD 0%, #A5B4FC 100%);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.calc-feed-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    text-decoration: none;
    color: var(--text);
}

.calc-feed-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #60A5FA 0%, #8B5CF6 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.calc-feed-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.calc-feed-item:hover .calc-feed-icon {
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

.calc-emoji {
    font-size: 28px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Font Awesome 아이콘 스타일 */
.calc-feed-icon i {
    font-size: 28px;
    color: #ffffff;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.calc-feed-icon i.fab {
    font-size: 26px;
}

/* 인기 아이콘 스타일 */
.popular-icon {
    background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.popular-icon .calc-emoji {
    color: #ffffff;
    font-weight: 700;
    font-size: 24px;
}

/* 최근 아이콘 스타일 */
.recent-icon {
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 100%);
}

.calc-feed-content {
    flex: 1;
    min-width: 0;
}

.calc-feed-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.calc-feed-desc {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.calc-feed-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xs);
}

.calc-category-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: rgba(0, 102, 204, 0.1);
    color: var(--primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.calc-views {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.calc-feed-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.calc-feed-item:hover .calc-feed-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* 인피드 광고 슬롯 */
.ad-infeed-inline {
    padding: var(--spacing-lg);
    background-color: #F9FAFB;
    border-bottom: 1px solid var(--border);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 무한 스크롤링 로딩 스피너 */
.loading-spinner {
    padding: var(--spacing-xl);
    text-align: center;
}

.spinner-circle {
    width: 40px;
    height: 40px;
    border: 4px solid #E5E7EB;
    border-top-color: #3B82F6;
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.scroll-end-message {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.scroll-end-message p {
    background: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 모바일 최적화 */
@media (max-width: 640px) {
    .calc-feed-link {
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
    }

    .calc-feed-icon {
        width: 48px;
        height: 48px;
    }

    .calc-emoji {
        font-size: 24px;
    }

    .calc-feed-title {
        font-size: var(--font-size-base);
    }

    .calc-feed-desc {
        font-size: var(--font-size-xs);
        -webkit-line-clamp: 1;
    }
}

/* ========================================
   인쇄 스타일
   ======================================== */
@media print {
    .site-header,
    .site-footer,
    .breadcrumb,
    .ad-slot,
    .share-section,
    .related-section {
        display: none;
    }

    .site-main {
        padding: 0;
    }

    .calc-card,
    .result-card,
    .content-card {
        box-shadow: none;
        border: 1px solid var(--border);
    }
}

/* ============================================================
   국가 선택 모달 (모바일 최적화)
   ============================================================ */

/* 헤더의 국기 아이콘 (클릭 가능) */
.country-flag-icon {
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    width: 32px;
    height: 32px;
}

.country-flag-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.country-flag-icon:hover::before {
    opacity: 0.3;
}

.country-flag-icon:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.country-flag-icon:active {
    transform: scale(0.95);
}

/* 언어 선택 버튼 (생활계산기 옆, 국기+언어코드 표시) */
.lang-code-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 72px;
    height: 36px;
    padding: 0 12px;
    background: #FFFFFF;
    color: #1E40AF;
    border: 2px solid #E5E7EB;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-family);
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.lang-code-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #60A5FA 0%, #8B5CF6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
    z-index: -1;
}

.lang-code-btn:hover::before {
    opacity: 0.2;
}

.lang-code-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
    border-color: transparent;
    color: #FFFFFF;
}

.lang-code-btn:active {
    transform: translateY(0) scale(1.05);
}

@media (max-width: 640px) {
    .lang-code-btn {
        min-width: 64px;
        height: 32px;
        font-size: 12px;
        padding: 0 10px;
        gap: 3px;
    }
}

/* 국가 선택 모달 오버레이 */
.country-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2100;
    animation: fadeIn 0.2s ease;
}

.country-modal-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

/* 언어 선택 모달 */
.country-modal {
    background: #ffffff;
    color: #333333;
    width: 100%;
    max-width: 520px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 모달 헤더 */
.country-modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.country-modal-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.country-modal-close {
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #555555;
    font-size: 24px;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.country-modal-close:hover {
    background: #F0F0F0;
    color: #333333;
}

/* 모달 바디 */
.country-modal-body {
    padding: var(--spacing-lg);
    max-height: 60vh;
    overflow-y: auto;
}

/* 언어 옵션 (언어명 + 국기들) */
.language-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
    border: 1px solid #E5E7EB;
}

.language-option:hover {
    background: linear-gradient(135deg, #EFF6FF 0%, #F3E8FF 100%);
    border-color: #D1D5DB;
}

.language-name {
    font-size: 16px;
    font-weight: 700;
    color: #1F2937;
}

.language-flags {
    display: flex;
    gap: 8px;
    align-items: center;
}

.country-flag-btn {
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.country-flag-btn:hover {
    transform: scale(1.15);
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.country-flag-btn:active {
    transform: scale(0.95);
}

/* 레거시 스타일 (하위 호환) */
.country-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #F5F5F5;
}

.country-option:hover {
    background: #F5F8FF;
}

.country-option:last-child {
    border-bottom: none;
}

/* 언어 선택 그리드 (12개 언어, 모바일 2열 고정) */
.language-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 4px;
}

/* 개별 언어 아이템 */
.language-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.language-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 51, 234, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.language-item:hover {
    background: linear-gradient(135deg, #EFF6FF 0%, #F5F3FF 100%);
    border-color: #3B82F6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.language-item:hover::before {
    opacity: 1;
}

.language-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

/* 언어 국기 이모지 */
.language-item .flag {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

/* 언어 정보 컨테이너 */
.language-item .language-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

/* 언어 네이티브 이름 */
.language-item .language-native {
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 언어 영어 이름 */
.language-item .language-english {
    font-size: 12px;
    font-weight: 400;
    color: #6B7280;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tier 뱃지 (선택사항) */
.language-item.tier-1 {
    border-color: #DBEAFE;
}

.language-item.tier-2 {
    border-color: #E5E7EB;
}

.language-item.tier-3 {
    border-color: #F3F4F6;
}

/* 현재 선택된 언어 강조 */
.language-item.active {
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    border-color: #3B82F6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.language-item.active .language-native,
.language-item.active .language-english {
    color: #FFFFFF;
}

/* 모바일 (< 480px): 2열 유지, 패딩 축소 */
@media (max-width: 480px) {
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .language-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .language-item .flag {
        font-size: 22px;
    }

    .language-item .language-native {
        font-size: 13px;
    }

    .language-item .language-english {
        font-size: 11px;
    }
}

/* 태블릿 이상 (>= 640px): 3열 */
@media (min-width: 640px) {
    .language-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

.country-flag-img {
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.global-icon {
    font-size: 1.8rem;
    width: 32px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.country-name {
    font-size: var(--font-size-base);
    color: #1a1a1a;
    font-weight: 500;
}

/* 모바일 최적화 */
@media (max-width: 640px) {
    .country-modal {
        max-width: 90%;
    }

    .country-flag-icon {
        width: 20px;
        height: 15px;
    }
}

/* ========================================
   무한 스크롤 로딩 인디케이터
   ======================================== */
.scroll-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    gap: var(--spacing-md);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E5E7EB;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.scroll-loader p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.scroll-end {
    padding: var(--spacing-xl);
    text-align: center;
}

.scroll-end p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 600;
    background: linear-gradient(135deg, #10B981 0%, #3B82F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 로딩 애니메이션 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 로딩 중 페이드인 애니메이션 */
@keyframes fadeInItem {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calc-feed-item.fade-in {
    animation: fadeInItem 0.4s ease;
}

/* ========================================
   도움이 됐어요 투표 섹션
   ======================================== */
.helpful-section {
    text-align: center;
    padding: 24px 20px;
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 24px 0 16px;
}

.helpful-question {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text);
    margin: 0 0 16px;
}

.helpful-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* 도움이 됐어요 / 별로예요 버튼 공통 */
.btn-helpful {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    font-family: var(--font-family);
    border: 2px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    min-height: 44px;
    background: #28a745;
    color: #ffffff;
}

.btn-helpful:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-1px);
}

/* 별로예요 버튼 */
.btn-helpful.btn-helpful-no {
    background: #6c757d;
    color: #ffffff;
}

.btn-helpful.btn-helpful-no:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

/* 버튼 비활성화 상태 */
.btn-helpful:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.helpful-icon {
    font-size: 18px;
    line-height: 1;
}

/* 투표 완료 후 카운트 텍스트 */
.helpful-count-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 10px 0 4px;
}

.helpful-count-text #helpfulCount {
    font-weight: 700;
    color: var(--primary);
}

/* 투표 감사 메시지 */
.helpful-voted-msg {
    font-size: var(--font-size-sm);
    color: var(--accent);
    font-weight: 600;
    margin: 4px 0 0;
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    .helpful-buttons {
        flex-direction: column;
        align-items: center;
    }
    .btn-helpful {
        width: 100%;
        max-width: 240px;
        justify-content: center;
    }
}

/* ========================================
   AdSense 배너 컨테이너 (메인 상단)
   ======================================== */
.adsense-banner-container {
    width: 100%;
    min-height: 200px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
    margin-bottom: 30px;
    text-align: center;
}

.adsbygoogle {
    display: inline-block !important;
    max-width: 100%;
}

/* 태블릿 이하 */
@media (max-width: 768px) {
    .adsense-banner-container {
        min-height: 150px;
        padding: 15px 0;
        margin-bottom: 20px;
    }
}

/* 모바일 */
@media (max-width: 480px) {
    .adsense-banner-container {
        min-height: auto;
        padding: 10px 0;
        margin-bottom: 16px;
    }
}
