:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
}

/* 헤더 */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-md);
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
}

.header-content h1 a {
    color: white;
    text-decoration: none;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 메인 컨텐츠 */
main {
    padding: 3rem 0;
}

.intro {
    text-align: center;
    margin-bottom: 3rem;
}

.intro h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.intro p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* 계산기 그리드 */
.calculators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.calculator-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.calculator-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.calculator-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.calculator-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.calculator-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 버튼 */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    margin-top: 0.5rem;
}

/* 특징 섹션 */
.features {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 3rem;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-secondary);
}

/* 계산기 페이지 */
.calculator-page {
    max-width: 1000px;
    margin: 0 auto;
}

.calculator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.calculator-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-bottom: 3rem;
}

.calculator-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.calculator-form {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 결과 표시 */
.result-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-color);
}

.result-container h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.bmi-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.bmi-value .label {
    font-weight: 600;
    font-size: 1.125rem;
}

.bmi-value .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.bmi-status {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-text {
    font-size: 1.125rem;
    margin-top: 0.5rem;
}

.bmi-advice {
    background: #eff6ff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.bmi-advice h4 {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.advice-text {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* BMI 차트 */
.bmi-chart {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.bmi-chart h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.chart-item.underweight {
    background: #dbeafe;
    color: #1e40af;
}

.chart-item.normal {
    background: #d1fae5;
    color: #065f46;
}

.chart-item.overweight {
    background: #fef3c7;
    color: #92400e;
}

.chart-item.obese1 {
    background: #fed7aa;
    color: #9a3412;
}

.chart-item.obese2 {
    background: #fecaca;
    color: #991b1b;
}

/* 정보 섹션 */
.info-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.info-section h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-section h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.info-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.info-list li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.warning-text {
    background: #fef3c7;
    border-left: 4px solid var(--warning-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    color: #92400e;
}

/* 관련 계산기 */
.related-calculators {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.related-calculators h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.related-card {
    display: block;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.related-card:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.related-card .card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.related-card h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.related-card:hover h4,
.related-card:hover p {
    color: white;
}

.related-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 광고 컨테이너 */
.ad-container {
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-horizontal {
    max-width: 728px;
}

.ad-vertical {
    max-width: 300px;
}

.ad-placeholder {
    background: var(--light-bg);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    min-height: 90px;
}

.calculator-sidebar .ad-placeholder {
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 추가 계산기 스타일 */
.loan-summary, .exchange-result {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.summary-item, .exchange-from, .exchange-to {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-item .highlight {
    color: var(--danger-color);
}

.loan-details, .exchange-rate {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.comparison-item {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.info-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
}

.btn-swap {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s;
}

.btn-swap:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.exchange-arrow {
    font-size: 2rem;
    text-align: center;
    color: var(--primary-color);
    padding: 1rem 0;
}

.currency-label {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.currency-amount {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rate-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: var(--radius-md);
}

.rate-currency {
    font-weight: 600;
}

.rate-value {
    color: var(--primary-color);
    font-weight: 600;
}

.rate-disclaimer {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.date-result {
    text-align: center;
    padding: 2rem;
}

.big-number, .big-date {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.date-breakdown, .date-info {
    margin-top: 1.5rem;
    text-align: left;
    background: var(--light-bg);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.result-box {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    border-left: 4px solid var(--primary-color);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-content h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

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

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

    .calculator-sidebar {
        order: 2;
    }

    .features {
        padding: 2rem 1.5rem;
    }

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

    .intro h2 {
        font-size: 1.5rem;
    }

    .calculator-header h2 {
        font-size: 1.75rem;
    }

    .bmi-value {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .calculator-card {
        padding: 1.5rem;
    }

    .calculator-form,
    .result-container,
    .bmi-chart,
    .info-section {
        padding: 1.5rem;
    }

    .card-icon {
        font-size: 2.5rem;
    }

    .bmi-value .value {
        font-size: 2rem;
    }
}
