/**
 * TWD 匯率轉換器 CSS 樣式
 */

/* 通用樣式 */
.twd-converter, 
.twd-chart-container {
    max-width: 100%;
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    text-align: center;
}

/* 標題樣式 */
.twd-converter-title,
.twd-chart-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
}

/* 匯率信息 */
.twd-rate-info {
    background-color: #eef2f7;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #4a90e2;
    font-size: 0.95em;
    text-align: center;
}

.twd-rate-info p {
    margin: 5px 0;
    text-align: center;
}

.twd-current-rate {
    font-weight: bold;
    color: #2a6dc0;
}

.twd-update-time,
.twd-chart-update-time {
    color: #666;
    font-size: 0.85em;
    text-align: center;
    margin-bottom: 15px;
}

/* 轉換表單 */
.twd-converter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.twd-input-group {
    flex: 1;
    min-width: 150px;
    max-width: 300px;
}

.twd-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    text-align: center;
}

.twd-amount-input,
.twd-result {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    text-align: center;
}

.twd-equals {
    margin: 0 10px;
    align-self: flex-end;
    font-size: 1.5em;
    color: #666;
    padding-bottom: 10px;
}

.twd-convert-btn {
    padding: 10px 15px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    margin-top: 25px;
    transition: background-color 0.2s;
}

.twd-convert-btn:hover {
    background-color: #3a7bc8;
}

/* 常見換算表 */
.twd-common-conversions {
    margin-top: 30px;
    text-align: center;
}

.twd-common-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #444;
    text-align: center;
}

.twd-conversion-table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
    margin: 10px auto;
}

.twd-conversion-table th,
.twd-conversion-table td {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.twd-conversion-table th {
    background-color: #f2f2f2;
    color: #333;
    font-weight: 600;
}

.twd-conversion-table tr:last-child td {
    border-bottom: none;
}

.twd-conversion-table tr:hover td {
    background-color: #f5f5f5;
}

/* 圖表容器與包裝器 */
.twd-chart-wrapper {
    margin-bottom: 80px; /* 增加整體底部間距 */
    position: relative;
}

.twd-chart-container {
    position: relative;
    height: 450px;
    margin-bottom: 40px; /* 從原來的 30px 增加到 40px */
    padding-bottom: 30px; /* 添加額外的底部內邊距 */
    text-align: center;
}

/* 添加一個分隔器在圖表底部 */
.twd-chart-container:after {
    content: "";
    display: block;
    height: 1px;
    background-color: #eee;
    width: 80%;
    margin: 30px auto 0;
}

/* 圖表底部空白區域 */
.twd-chart-spacer {
    height: 40px; /* 增加底部空白高度 */
    clear: both;
}

.twd-chart-title {
    margin-bottom: 5px;
}

/* 錯誤信息 */
.twd-error {
    padding: 10px 15px;
    background-color: #fff2f2;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
    margin: 15px 0;
    border-radius: 3px;
    text-align: center;
}

/* 媒體查詢 - 手機版 */
@media screen and (max-width: 600px) {
    .twd-converter-form {
        flex-direction: column;
        align-items: center;
    }
    
    .twd-input-group {
        width: 100%;
        max-width: 100%;
    }
    
    .twd-equals {
        margin: 10px 0;
        align-self: center;
    }
    
    .twd-convert-btn {
        width: 100%;
        margin-top: 15px;
    }
    
    .twd-chart-container {
        height: 350px;
    }
    
    .twd-chart-wrapper {
        margin-bottom: 60px; /* 稍微縮小手機版的底部間距 */
    }
}