* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 0px; /* 헤더 높이만큼 패딩 제거 */
}

.calculator {
    max-width: 800px;
    margin: 20px auto;
    margin-bottom: 40px; /* 푸터와의 간격 조정 */
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 30px;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 24px;
}

/* 네비게이션 스타일 */
.nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.nav .calculator-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.nav .calculator-links a {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    border-radius: 25px;
    font-size: 15px;
    transition: all 0.3s ease;
    white-space: nowrap;
    background-color: #f8f9fa;
}

.nav .calculator-links a:hover {
    background-color: #e9ecef;
    color: #333;
}

.nav .calculator-links a.active {
    background-color: #007bff;
    color: white;
}

/* 폼 스타일 */
.calc-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #444;
    font-weight: 500;
}

input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

button {
    width: 100%;
    padding: 14px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

button:hover {
    background-color: #0056b3;
}

#result {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: none;
}

#result h3 {
    color: #007bff;
    margin-bottom: 15px;
    font-size: 18px;
}

#result p {
    margin-bottom: 10px;
    font-size: 15px;
    color: #444;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.result-table th,
.result-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.result-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #444;
}

.footer {
    text-align: center;
    color: #666;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 헤더 스타일 */
.site-header {
    background-color: #000000;
    padding: 15px 0;
    position: relative;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    overflow: hidden;
}

.header-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.site-logo {
    color: #ffffff;
    text-decoration: none;
    font-size: 28px !important;
    font-weight: 700;
    transition: color 0.3s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-logo:hover {
    color: #3498db;
}

/* 푸터 스타일 */
.site-footer {
    background-color: #000000;  /* 헤더와 동일한 색상으로 변경 */
    color: #ffffff;
    padding: 30px 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #3498db;
}

.footer-info {
    text-align: center;
}

.footer-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #ecf0f1;
}

/* 모바일 스타일 */
@media screen and (max-width: 768px) {
    html, body {
        width: 100%;
        overflow-x: hidden;
        max-width: 100%;
        position: relative;
    }

    .site-header {
        background-color: #000000;
        padding: 10px 0;
        width: 100vw;
        max-width: 100%;
        overflow: hidden;
    }

    .header-container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }

    .site-logo {
        font-size: 24px !important;
        width: auto;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .site-footer {
        padding: 20px 0;
        width: 100%;
        left: 0;
        right: 0;
    }

    .footer-container {
        width: 100%;
        padding: 0 15px;
        max-width: 100%;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        width: 100%;
    }

    .footer-links a {
        font-size: 14px;
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    .footer-info {
        width: 100%;
        padding: 0 15px;
    }

    .calculator-grid {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 15px;
    }

    .calculator-card {
        width: 100%;
        max-width: 100%;
        margin: 0 0 15px 0;
    }

    .main-container {
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
        margin: 20px 0;
    }
}

/* 메인 페이지 스타일 수정 */
.main-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.calculator-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.calculator-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.calculator-card h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.calculator-card p {
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.6;
}

.calculator-card a {
    display: inline-block;
    padding: 12px 30px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 15px;
}

.calculator-card a:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

/* 메인 페이지 반응형 수정 */
@media screen and (max-width: 768px) {
    .main-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .calculator-card {
        padding: 25px;
    }
    
    .calculator-card h2 {
        font-size: 18px;
    }
    
    .calculator-card p {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .calculator-card a {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* 메인 페이지 타이틀 스타일 */
.main-container h1 {
    text-align: center;
    color: #333;
    font-size: 32px;
    margin-bottom: 20px;
    font-weight: 600;
}

@media screen and (max-width: 768px) {
    .main-container h1 {
        font-size: 24px;
        margin: 20px 0;
    }
}

.main-container {
    flex: 1;
}

/* 로고 스타일 */
.logo-img {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

@media screen and (max-width: 768px) {
    .logo-img {
        height: 30px;
    }
} 