* {
    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);
}

.current-position,
.additional-buy {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

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-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"],
.input-with-unit input[type="text"] {
    width: 100%;
    padding: 0.8rem;
    padding-right: 35px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-with-unit input[type="number"]:focus,
.input-with-unit input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.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;
}

.update-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.update-button:hover {
    background-color: #0056b3;
}

.history-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.history-title {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    margin-bottom: 15px;
    padding: 5px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid #007bff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.history-content {
    flex: 1;
}

.restore-button {
    padding: 8px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background-color 0.3s;
    height: fit-content;
}

.restore-button:hover {
    background-color: #0056b3;
}

.history-item .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666;
}

.history-item .info-row:last-child {
    margin-bottom: 0;
}

.history-item .info-row .label {
    color: #444;
}

/* 모바일 메뉴 버튼 스타일 */
.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;
    }
} 