.wallet-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* 반응형 그리드 */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.wallet-card {
    padding: 1.5rem;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wallet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.wallet-card .currency-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.8;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.wallet-card .currency-balance {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.wallet-card .currency-symbol {
    opacity: 0.7;
    margin-right: 5px;
}

/* 통화별 색상 디자인 */
.wallet-krw {
    background: linear-gradient(45deg, #434343, #000000);
}
.wallet-usd {
    background: linear-gradient(45deg, #27ae60, #229954);
}
.wallet-eur {
    background: linear-gradient(45deg, #2980b9, #3498db);
}
.wallet-jpy {
    background: linear-gradient(45deg, #c0392b, #e74c3c);
}

/* 환전소 섹션 디자인 */
.exchange-container {
    display: flex;
    flex-direction: column; /* 모바일에서 세로로 배치 */
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background-color: #f7f9fc;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.currency-selector-box {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.currency-selector-box label {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.8rem;
    display: block;
}

.currency-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* 버튼이 많아지면 줄바꿈 */
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.currency-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    background-color: #fff;
    color: #333;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-grow: 1; /* 너비 동일하게 */
    min-width: 80px;
}

.currency-btn:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.currency-btn.active {
    border-color: #007bff;
    background-color: #007bff;
    color: white;
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
}

.input-group {
    width: 100%;
    position: relative;
}

.input-group input[type="number"],
.input-group input[type="text"] {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #ccc;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 500;
    color: #2c3e50;
    text-align: center;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.exchange-arrow {
    font-size: 2rem;
    color: #777;
    font-weight: bold;
}

.exchange-info {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 1rem;
    color: #666;
}

#from-currency-balance-info,
#to-currency-balance-info {
    font-size: 0.8rem;
    color: #555;
    margin-top: 5px;
    text-align: right;
    height: 1.2em; /* 잔액이 없을 때도 공간을 차지하도록 높이 고정 */
}

/* 환전하기 버튼 */
#exchange-btn {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(45deg, #007bff, #0056b3); /* 그라데이션 배경 */
    border: none;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 1rem;
    position: relative;
    overflow: hidden; /* 효과를 위한 설정 */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2); /* 은은한 그림자 */
}

/* 버튼에 아이콘 추가 */
#exchange-btn::before {
    margin-right: 10px;
    font-size: 1.1rem;
}

/* 마우스를 올렸을 때 효과 */
#exchange-btn:hover {
    transform: translateY(-3px); /* 살짝 위로 이동 */
    box-shadow: 0 7px 20px rgba(0, 123, 255, 0.3);
}

/* 클릭했을 때 효과 */
#exchange-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

/* 비활성화 상태일 때 스타일 */
#exchange-btn:disabled {
    background: #bdc3c7; /* 회색 배경 */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 환전하기 버튼이 로딩 중일 때의 스타일 */
#exchange-btn.loading {
    cursor: not-allowed;
    background: linear-gradient(45deg, #0056b3, #004085); /* 더 어두운 색상 */
    box-shadow: none;
    transform: none;
}

/* 로딩 중 텍스트에 깜빡이는 효과 추가 */
#exchange-btn.loading::before {
    content: '⏳'; /* 로딩 아이콘 */
    margin-right: 10px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.block-center {
    display: flex;
    justify-content: center;
}

@media (min-width: 768px) {
    .exchange-container {
        flex-direction: row; /* 데스크톱에서 가로로 배치 */
        justify-content: center;
    }
}

/* 차트 선택 버튼 그룹 */
.exchange-chart-area {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    border-radius: 15px;
    background-color: #f7f9fc;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.chart-selector-buttons {
    margin-bottom: 1.5rem;
    gap: 10px;
    justify-content: flex-start; /* 버튼을 왼쪽으로 정렬 */
}

.chart-currency-btn {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    color: #555;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-grow: 0; /* 너비 자동 조절 */
}

.chart-currency-btn.active {
    border-color: #3498db;
    background-color: #3498db;
    color: white;
    font-weight: 600;
}

.chart-currency-btn:hover:not(.active) {
    background-color: #e8f0fe;
}

#exchange-chart-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.balance-info { font-size: 0.8rem; color: #555; margin-top: 5px; text-align: right; }
.disabled-btn { opacity: 0.5; cursor: not-allowed !important; }