/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563EB;
    --primary-hover: #1D4ED8;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --text-dark: #1F2937;
    --text-gray: #6B7280;
    --text-light: #9CA3AF;
    --bg-white: #FFFFFF;
    --bg-gray: #F9FAFB;
    --bg-blue: #EFF6FF;
    --bg-green: #ECFDF5;
    --bg-red: #FEF2F2;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-white);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== Header ===== */
.main-header {
    text-align: center;
    padding: 2rem 0;
    background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
    color: white;
    margin-bottom: 1.5rem;
}

.main-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.main-header .subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.btn-share-header {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-share-header:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Layout ===== */
.layout-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.main-column {
    flex: 1;
    min-width: 0;
}

.app-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* ===== Input Card ===== */
.input-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.input-card h2 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

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

.input-group label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.text-input,
.select-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.2s;
}

.text-input:focus,
.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===== Employment Selector ===== */
.employment-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.employment-btn {
    padding: 1rem;
    background: var(--bg-gray);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-gray);
    transition: all 0.2s;
    text-align: center;
}

.employment-btn small {
    display: block;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.employment-btn.active {
    background: var(--bg-blue);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.employment-btn:hover {
    border-color: var(--primary-color);
}

/* ===== Contribution Display ===== */
.contribution-display {
    background: var(--bg-gray);
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.contribution-display strong {
    color: var(--primary-color);
    font-size: 1.125rem;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    width: 100%;
    padding: 1rem;
    font-size: 1.125rem;
}

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

/* ===== Result Card ===== */
.result-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.result-card h2 {
    margin-bottom: 1.5rem;
}

.breakeven-result {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.breakeven-label {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.breakeven-age {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.breakeven-message {
    font-size: 1rem;
    color: var(--text-gray);
}

.financial-summary {
    display: grid;
    gap: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-gray);
    border-radius: var(--radius);
}

.summary-label {
    font-weight: 500;
    color: var(--text-dark);
}

.summary-value {
    font-weight: 700;
    font-size: 1.125rem;
}

.summary-value.red {
    color: var(--danger-color);
}

.summary-value.blue {
    color: var(--primary-color);
}

.summary-value.green {
    color: var(--success-color);
}

.monthly-pension-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-blue);
    border-radius: var(--radius);
    text-align: center;
}

.monthly-pension-info strong {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* ===== Calculation Process ===== */
.calculation-process {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-gray);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary-color);
}

.calculation-process h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-size: 1rem;
}

.process-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.process-item.highlight {
    background: var(--bg-blue);
    padding: 0.75rem;
    margin: 0.5rem -0.5rem 0;
    border-radius: var(--radius);
    font-weight: 600;
}

.process-label {
    color: var(--text-gray);
    font-size: 0.875rem;
}

.process-value {
    color: var(--text-dark);
    font-weight: 500;
}

/* ===== Chart Card ===== */
.chart-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.chart-card h2 {
    margin-bottom: 1.5rem;
}

#pension-chart {
    height: 400px;
}

/* ===== Scenario Card ===== */
.scenario-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.scenario-card h2 {
    margin-bottom: 0.5rem;
}

.scenario-desc {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.scenario-item {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.scenario-title {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.scenario-age {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.scenario-profit {
    font-size: 0.875rem;
    color: var(--text-gray);
}

/* ===== Info Section ===== */
.info-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.info-section h2 {
    margin-bottom: 1.5rem;
}

.info-card {
    background: var(--bg-gray);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.info-card:last-child {
    margin-bottom: 0;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.info-card ul,
.info-card p {
    color: var(--text-gray);
    line-height: 1.7;
}

.info-card ul {
    margin-left: 1.5rem;
}

.info-card li {
    margin-bottom: 0.5rem;
}

.tip-card {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-left: 4px solid var(--warning-color);
}

/* ===== FAQ Section ===== */
.faq-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.faq-section h2 {
    margin-bottom: 1.5rem;
}

.faq-item {
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.faq-item:hover {
    border-color: var(--primary-color);
}

.faq-item summary {
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
}

.faq-item p {
    margin-top: 1rem;
    color: var(--text-gray);
    line-height: 1.7;
}

/* ===== Sidebar Styles ===== */
.sidebar-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.sidebar-card h3 {
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.sidebar-list {
    list-style: none;
}

.sidebar-list li {
    margin-bottom: 0.75rem;
}

.sidebar-list a {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-gray);
    transition: all 0.2s;
    padding: 0.5rem;
    border-radius: var(--radius);
}

.sidebar-list a:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}

.link-icon {
    font-size: 1.25rem;
}

.link-content {
    display: flex;
    flex-direction: column;
}

.link-title {
    font-weight: 500;
    font-size: 0.95rem;
}

.link-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

/* ===== Ads ===== */
.ad-container {
    margin: 2rem auto;
    min-height: 100px;
    text-align: center;
}

/* ===== Footer ===== */
.main-footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-gray);
    font-size: 0.875rem;
}

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Utility Classes ===== */
.hidden {
    display: none;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .app-sidebar {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
    }

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

    .breakeven-age {
        font-size: 2.5rem;
    }

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

    .employment-selector {
        grid-template-columns: 1fr;
    }
}

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

    .input-card,
    .result-card,
    .chart-card,
    .scenario-card {
        padding: 1rem;
    }
}