/* ========================================
   匯率查詢系統 - 自定義樣式
   ======================================== */

/* 全局設定 - 修復滾動條導致寬度變化問題 */
html {
    overflow-y: scroll;
    /* 強制顯示垂直滾動條，保持一致的視窗寬度 */
}

body {
    margin: 0;
    padding: 0;
}

/* 全局動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   導覽欄-頁簽的樣式
   ======================================== */
.rate-icon i {
    color: #ffc107;
}

.bank-icon i {
    color: #339af0;
}

.history-icon i {
    color: #b197fc;
}

.convert-icon i {
    color: #51cf66;
}

/* ========================================
   佈局與導航
   ======================================== */
.content-section {
    animation: fadeIn 0.3s ease-in-out;
}

.navbar-brand {
    font-weight: bold;
}

/* ========================================
   卡片與表格
   ======================================== */
.card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 10px;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

/* ========================================
   匯率狀態指示器
   ======================================== */
.rate-up {
    color: #28a745;
}

.rate-down {
    color: #dc3545;
}

.rate-same {
    color: #6c757d;
}

/* ========================================
   圖標與標籤
   ======================================== */
.bank-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #495057;
}

.currency-flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    background-color: #f8f9fa;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bank-tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e9ecef;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
}

.currency-tag {
    display: inline-block;
    padding: 4px 8px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* ========================================
   換算功能
   ======================================== */
.conversion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.conversion-item:last-child {
    border-bottom: none;
}

.conversion-item:hover {
    background-color: #f8f9fa;
}

.conversion-currency {
    font-weight: 500;
    color: #495057;
}

.conversion-amount {
    font-size: 1.1em;
    font-weight: bold;
    color: #28a745;
    font-family: 'Courier New', monospace;
}

/* ========================================
   響應式設計
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .table-responsive {
        font-size: 14px;
    }

    .conversion-item {
        font-size: 14px;
        flex-direction: column;
        align-items: flex-start !important;
    }

    .conversion-amount {
        margin-top: 5px;
        font-size: 1.1em;
    }

    .currency-flag {
        width: 16px;
        height: 12px;
    }
}

/* ========================================
   UI 狀態與動畫
   ======================================== */
#historical-chart {
    max-height: 400px;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ========================================
   訊息提示
   ======================================== */
.error-message {
    color: #dc3545;
    text-align: center;
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}

.success-message {
    color: #155724;
    text-align: center;
    padding: 20px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
}

/* ========================================
   匯率變動與指示器
   ======================================== */
.rate-indicator {
    font-size: 12px;
    margin-left: 5px;
}

.rate-indicator.up::before {
    content: "▲";
    color: #28a745;
}

.rate-indicator.down::before {
    content: "▼";
    color: #dc3545;
}

.rate-indicator.same::before {
    content: "─";
    color: #6c757d;
}

/* 高亮顯示最佳匯率 */
.best-buy {
    background-color: #d4edda !important;
    font-weight: bold;
}

.best-sell {
    background-color: #f8d7da !important;
    font-weight: bold;
}

/* ========================================
   幣別換算樣式
   ======================================== */
.conversion-card {
    transition: all 0.2s ease-in-out;
    cursor: default;
}

.conversion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
}

.conversion-amount {
    color: #2c3e50 !important;
    font-family: 'Courier New', monospace;
}

.conversion-rate {
    color: #6c757d;
    font-size: 0.875rem;
}

.currency-tag {
    background-color: #007bff;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 35px;
    text-align: center;
    display: inline-block;
}

.currency-flag {
    border-radius: 2px;
    border: 1px solid #ddd;
}

/* 換算結果動畫 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.conversion-card .conversion-amount {
    animation: countUp 0.3s ease-out;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .conversion-card {
        margin-bottom: 0.5rem;
    }

    .conversion-amount {
        font-size: 1.1rem !important;
    }
}