/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 - 티스토리 스타일 */
header {
    background: white;
    color: #333;
    padding: 25px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-bottom: 1px solid #e1e8ed;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
}

.header-left {
    text-align: center;
    flex: 1;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: #333;
}

.logo-symbol {
    height: 45px;
    width: auto;
    vertical-align: middle;
    transition: transform 0.3s;
}

header h1:hover .logo-symbol {
    transform: rotate(-5deg) scale(1.1);
}

.subtitle {
    font-size: 0.95rem;
    color: #666;
    margin-top: 5px;
}

.header-nav {
    display: flex;
    gap: 10px;
    align-items: center;
    position: absolute;
    right: 0;
}

.nav-link {
    color: #667eea;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    background: white;
    border: 2px solid #e1e8ed;
}

.nav-link:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateY(-1px);
}

.nav-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-left {
        text-align: center;
    }
    
    header h1 {
        font-size: 1.5rem;
        justify-content: center;
    }
    
    .logo-symbol {
        height: 35px;
    }
    
    .header-nav {
        position: static;
        justify-content: center;
        width: 100%;
    }
    
    .nav-link {
        flex: 1;
        text-align: center;
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* 검색 섹션 */
.search-section {
    margin: 30px 0;
}

.search-box {
    width: 100%;
    max-width: 600px;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 50px;
    display: block;
    margin: 0 auto;
    transition: all 0.3s;
}

.search-box:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* 카테고리 탭 */
.category-section {
    margin: 30px 0;
}

.category-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 25px;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s;
    color: #666;
}

.tab-btn:hover {
    border-color: #4299e1;
    color: #4299e1;
    background: #f0f8ff;
}

.tab-btn.active {
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.25);
}

/* 섹션 제목 */
.popular-section h2,
.info-section h2 {
    font-size: 1.6rem;
    margin: 40px 0 25px;
    color: #333;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 계산기 그리드 - 4x4 배열 */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.calc-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    border: 1px solid #e1e8ed;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 340px;
}

.calc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.calc-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.calc-badge.hot {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
}

.calc-badge.premium {
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
}

.calc-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.calc-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #2d3748;
    min-height: 62px;
    display: flex;
    align-items: center;
}

.calc-desc {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.5;
    min-height: 42px;
    display: flex;
    align-items: center;
}

.calc-stats {
    color: #a0aec0;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.calc-btn {
    display: block;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.2);
    margin-top: auto;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 153, 225, 0.35);
    background: linear-gradient(135deg, #3182ce 0%, #5568d3 100%);
}

/* 정보 섹션 */
.info-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin: 50px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.info-section p {
    color: #4a5568;
    line-height: 1.8;
    margin-bottom: 30px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.feature-item {
    padding: 20px;
    background: #f8fafb;
    border-radius: 10px;
    border-left: 4px solid #4299e1;
}

.feature-item h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #2d3748;
}

.feature-item p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

/* 푸터 */
footer {
    background: #1a202c;
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 1px solid #2d3748;
}

footer p {
    margin-bottom: 10px;
}

.footer-links {
    margin-top: 20px;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* 반응형 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .category-tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .info-section {
        padding: 25px;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

/* 계산기 페이지 공통 스타일 */
.calculator-page {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.calculator-page h1 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.calculator-page .breadcrumb {
    color: #718096;
    margin-bottom: 30px;
}

.calculator-page .breadcrumb a {
    color: #4299e1;
    text-decoration: none;
}

.calculator-page .breadcrumb a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2d3748;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #a0aec0;
    font-size: 0.85rem;
}

.btn-calculate {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 3px 10px rgba(66, 153, 225, 0.25);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(66, 153, 225, 0.4);
    background: linear-gradient(135deg, #3182ce 0%, #5568d3 100%);
}

.result-box {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #e6f2ff 0%, #f0f8ff 100%);
    border-radius: 10px;
    border-left: 5px solid #4299e1;
    display: none;
}

.result-box.show {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-box h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #2d3748;
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    color: #4299e1;
    margin: 15px 0;
}

.result-detail {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f7fafc;
}

.result-item span:first-child {
    color: #4a5568;
}

.result-item span:last-child {
    font-weight: 600;
    color: #2d3748;
}

.info-text {
    background: #f7fafc;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    color: #4a5568;
    line-height: 1.8;
}

.related-calculators {
    margin-top: 50px;
}

.related-calculators h3 {
    margin-bottom: 20px;
    color: #2d3748;
}

.related-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.related-links a {
    padding: 10px 20px;
    background: #f7fafc;
    color: #4299e1;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    border: 2px solid #e2e8f0;
    font-weight: 500;
}

.related-links a:hover {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

/* 애드센스 광고 영역 */
.ad-container {
    margin: 30px 0;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-container.ad-top {
    margin-bottom: 30px;
}

.ad-container.ad-middle {
    margin: 40px 0;
}

.ad-container.ad-bottom {
    margin-top: 40px;
}

.ad-container ins {
    display: block;
    width: 100%;
}

@media (max-width: 768px) {
    .ad-container {
        padding: 15px;
        margin: 20px 0;
    }
}

