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

body {
    font-family: 'Segoe UI', 'Malgun Gothic', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 헤더 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 언어 선택 메뉴 */
.language-switcher {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.language-switcher a {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.language-switcher a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.language-switcher a.active {
    background: white;
    color: #667eea;
    border-color: white;
    font-weight: 600;
}

/* 간단 계산기 섹션 */
.simple-calculator {
    margin: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.3);
}

.simple-calculator h2 {
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.8em;
}

.simple-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    font-size: 1em;
}

.simple-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.simple-input-group {
    position: relative;
}

.simple-input-group label {
    display: block;
    color: white;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1em;
}

.simple-input-group input {
    width: 100%;
    padding: 15px 50px 15px 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.simple-input-group input:focus {
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.simple-unit {
    position: absolute;
    right: 15px;
    bottom: 15px;
    color: #999;
    font-weight: 600;
    font-size: 1em;
}

.simple-result {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.simple-result-label {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.simple-result-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #f5576c;
    margin: 10px 0;
    word-break: break-all;
    line-height: 1.2;
}

.simple-result-profit {
    font-size: 0.9em;
    color: #666;
    margin-top: 8px;
    word-break: break-all;
    line-height: 1.3;
}

.simple-result-profit span {
    color: #10b981;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

/* 광고 영역 */
.ad-container {
    min-height: 100px;
    background: #f8f9fa;
    margin: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.ad-placeholder {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    border: 2px dashed #ccc;
    border-radius: 10px;
}

.ad-top {
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.ad-middle,
.ad-bottom {
    margin: 30px 20px;
}

/* 메인 콘텐츠 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 30px;
}

/* 계산기 섹션 */
.calculator-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.calculator-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.input-group {
    margin-bottom: 25px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 1em;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 60px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group .unit {
    position: absolute;
    right: 15px;
    bottom: 12px;
    color: #999;
    font-weight: 600;
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* 사이드바 광고 */
.sidebar-ad {
    min-height: 600px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 15px;
}

.sidebar-ad .ad-placeholder {
    height: 600px;
}

/* 결과 섹션 */
.result-section {
    padding: 30px;
    background: #f8f9fa;
    margin: 20px;
    border-radius: 15px;
}

.result-section h2 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.8em;
    text-align: center;
}

.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.result-card.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-card h3 {
    font-size: 0.9em;
    margin-bottom: 10px;
    opacity: 0.8;
}

.result-card.highlight h3 {
    opacity: 1;
}

.result-value {
    font-size: 1.8em;
    font-weight: bold;
    margin: 10px 0;
    color: #333;
}

.result-card.highlight .result-value {
    color: white;
}

.result-value.profit {
    color: #10b981;
}

.result-desc {
    font-size: 0.85em;
    opacity: 0.7;
}

/* 상세 내역 테이블 */
.detail-section {
    margin-top: 30px;
}

.detail-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

table tbody tr:hover {
    background: #f8f9fa;
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* 정보 섹션 */
.info-section {
    padding: 40px 30px;
    background: white;
    margin: 20px;
    border-radius: 15px;
}

.info-section h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.info-section h3 {
    color: #764ba2;
    margin: 25px 0 15px 0;
    font-size: 1.4em;
}

.info-section p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.8;
}

.info-section ul {
    margin-left: 25px;
    color: #555;
}

.info-section li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.info-section strong {
    color: #667eea;
}

/* 푸터 */
.footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 30px;
}

.footer p {
    margin: 5px 0;
}

.disclaimer {
    font-size: 0.85em;
    opacity: 0.7;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar-ad {
        min-height: 250px;
    }

    .sidebar-ad .ad-placeholder {
        height: 250px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.95em;
    }

    .simple-calculator {
        margin: 15px;
        padding: 20px;
    }

    .simple-calculator h2 {
        font-size: 1.4em;
    }

    .simple-calc-grid {
        grid-template-columns: 1fr;
    }

    .simple-result-value {
        font-size: 1.5em;
    }

    .main-content,
    .result-section,
    .info-section {
        padding: 20px;
    }

    .ad-container {
        margin: 15px;
    }

    .result-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .result-value {
        font-size: 1.4em;
    }

    table {
        font-size: 0.9em;
    }

    table th,
    table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .language-switcher {
        gap: 5px;
    }

    .language-switcher a {
        padding: 6px 10px;
        font-size: 0.8em;
    }

    .simple-result-value {
        font-size: 1.3em;
    }

    .calculator-section h2,
    .result-section h2,
    .info-section h2 {
        font-size: 1.4em;
    }

    .result-cards {
        grid-template-columns: 1fr;
    }

    .input-group input,
    .input-group select {
        padding: 10px 50px 10px 10px;
    }

    .calculate-btn {
        font-size: 1em;
        padding: 12px;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: fadeIn 0.5s ease;
}
