/* 비트코인 적립식 투자 계산기 스타일시트 */

/* 기본 스타일 및 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* 헤더 스타일 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #e1e4e8;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
}

/* 계산기 컨테이너 스타일 */
.calculator-container {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

/* 입력 섹션 스타일 */
.input-section {
    padding: 30px;
    border-bottom: 1px solid #e1e4e8;
}

.input-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
}

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

.form-group input:focus,
.form-group select:focus {
    border-color: #f39c12;
    outline: none;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input {
    width: auto;
    margin-right: 10px;
}

.checkbox-group label {
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    transform: translateY(-2px);
}

#calculateBtn {
    background-color: #f39c12;
    color: white;
    flex: 2;
}

#calculateBtn:hover {
    background-color: #e67e22;
}

#resetBtn {
    background-color: #ecf0f1;
    color: #7f8c8d;
    flex: 1;
}

#resetBtn:hover {
    background-color: #dfe6e9;
}

/* 결과 섹션 스타일 */
.results-section {
    padding: 30px;
}

.results-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
}

.results-section h3 {
    color: #34495e;
    margin: 25px 0 15px;
    font-size: 1.5rem;
    border-bottom: 2px solid #f39c12;
    padding-bottom: 8px;
}

/* 요약 섹션 스타일 */
.summary-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 20px;
}

.summary-left, .summary-right {
    flex: 1;
    min-width: 300px;
}

.summary-container p {
    margin-bottom: 10px;
    padding: 8px;
    border-bottom: 1px dashed #ecf0f1;
}

.summary-container strong {
    color: #34495e;
}

/* S&P 500 비교 섹션 스타일 */
.comparison-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.comparison-container p {
    margin-bottom: 10px;
}

/* 차트 섹션 스타일 */
.charts-section {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 30px 0;
}

.chart-container {
    flex: 1 1 100%;
    min-height: 400px;
    position: relative;
    margin-bottom: 30px;
}

.chart-container h3 {
    text-align: center;
    margin-bottom: 15px;
}

.chart-container canvas {
    width: 100% !important;
    height: 400px !important;
}

.data-source {
    text-align: right;
    font-size: 0.8rem;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 10px;
}

/* 상세 결과 테이블 스타일 */
.table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #e1e4e8;
}

th {
    background-color: #f8f9fa;
    color: #34495e;
    font-weight: 600;
    position: sticky;
    top: 0;
}

th:first-child, td:first-child {
    text-align: left;
}

tr:hover {
    background-color: #f8f9fa;
}

/* 면책 조항 섹션 스타일 */
.disclaimer-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.disclaimer-container p, .data-sources p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.data-sources h4 {
    margin: 15px 0 10px;
    color: #34495e;
    font-size: 1rem;
}

/* 푸터 스타일 */
footer {
    text-align: center;
    padding: 20px 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    border-top: 1px solid #e1e4e8;
    margin-top: 30px;
}

/* 반응형 디자인 */
@media (min-width: 768px) {
    .chart-container {
        flex: 1 1 45%;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-section, .results-section {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .summary-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .summary-left, .summary-right {
        min-width: 100%;
    }
    
    .chart-container {
        min-height: 300px;
    }
    
    .chart-container canvas {
        height: 300px !important;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

/* 접근성 향상을 위한 스타일 */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: more) {
    body {
        background-color: white;
        color: black;
    }
    
    .calculator-container {
        box-shadow: 0 0 0 2px black;
    }
    
    #calculateBtn {
        background-color: black;
        color: white;
    }
    
    #resetBtn {
        background-color: #ddd;
        color: black;
    }
    
    th {
        background-color: #ddd;
        color: black;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #f5f5f5;
    }
    
    .calculator-container {
        background-color: #2c2c2c;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    }
    
    header h1, .input-section h2, .results-section h2, .results-section h3 {
        color: #f5f5f5;
    }
    
    .subtitle {
        color: #aaa;
    }
    
    .form-group label {
        color: #ddd;
    }
    
    .form-group input, .form-group select {
        background-color: #3a3a3a;
        border-color: #444;
        color: #f5f5f5;
    }
    
    .comparison-container, .disclaimer-section {
        background-color: #333;
    }
    
    th {
        background-color: #444;
        color: #f5f5f5;
    }
    
    th, td {
        border-bottom-color: #444;
    }
    
    tr:hover {
        background-color: #3a3a3a;
    }
    
    .disclaimer-container p, .data-sources p {
        color: #bbb;
    }
    
    footer {
        color: #aaa;
        border-top-color: #444;
    }
}
