* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 2rem;
}

h2 {
    color: #555;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

h3 {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.calculator {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.exchange-rate,
.current-position,
.additional-buy {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.rate-notice {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.rate-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.rate-input label {
    display: block;
    margin-bottom: 0.3rem;
    color: #666;
    font-size: 0.85rem;
}

.rate-input input[type="number"] {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    height: 2rem;
}

input[type="number"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.transaction {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.position-total {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.total-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid #eee;
}

.total-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.results {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #eee;
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.8rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 1.1rem;
}

.result-item span:last-child {
    font-weight: bold;
    color: #007bff;
}

.additional-buy .exchange-rate {
    margin: 0.8rem 0;
    padding: 0.8rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #eee;
}

.additional-buy .exchange-rate h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.input-with-unit {
    position: relative;
    width: 100%;
}

.input-with-unit::after {
    content: attr(data-unit);
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-left: 1px solid #7e7e7e;
    border-radius: 0 4px 4px 0;
    color: #666;
    font-size: 0.9rem;
    pointer-events: none;
}

.input-with-unit input[type="number"] {
    padding-right: 35px;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* 입력칸에 포커스가 있을 때 단위 표시 부분의 스타일 */
.input-with-unit input[type="number"]:focus ~ ::after {
    border-color: #007bff;
    border-left-color: #007bff;
    background-color: #f8f9fa;
}

/* 모바일 메뉴 버튼 스타일 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1001;
    font-size: 1rem;
}

/* 모바일 드롭다운 메뉴 스타일 */
.mobile-dropdown {
    display: none;
    position: fixed;
    top: 4rem;
    right: 1rem;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    overflow: hidden;
}

.mobile-dropdown.active {
    display: block;
}

.mobile-dropdown .menu-item {
    display: block;
    padding: 1rem 2rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.mobile-dropdown .menu-item:last-child {
    border-bottom: none;
}

/* 데스크톱 사이드 메뉴 스타일 */
.desktop-menu {
    background-color: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.desktop-menu .menu-content {
    width: 200px;
}

.desktop-menu h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
    text-align: center;
}

.desktop-menu .menu-item {
    display: block;
    padding: 0.8rem;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
    text-align: center;
}

.desktop-menu .menu-item:hover {
    background-color: #007bff;
    color: white;
}

/* 반응형 스타일 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .desktop-menu {
        display: none;
    }
    
    .container {
        margin-top: 4rem;
        padding: 1rem;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none;
    }
    
    /* .desktop-menu { 
        display: block;
        position: fixed;
        left: calc(50% - 600px);
        top: 50%;
        transform: translateY(-50%);
    } 
        따라가게*/

    @media (min-width: 769px) {
        .desktop-menu {
            display: block;
            position: absolute; /* 또는 static */
            left: 350px; /* 원하는 고정 위치로 설정 */
            top: 30px; /* 원하는 고정 위치로 설정 */
        }
    }
    
    .container {
        margin: 2rem auto;
    }
} 