* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-image: url('/static/asset/BG.png');
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 8px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.input-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

label {
    font-weight: bold;
    min-width: 120px;
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.results-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

#text-response {
    width: 100%;
}

.result-box {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.result-box h2 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: #2c3e50;
}

.content {
    min-height: 150px;
    flex-grow: 1;
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}



/* 響應式設計 */
@media (max-width: 768px) {
    .results-section {
        grid-template-columns: 1fr;
    }
    
    form {
        flex-direction: column;
        align-items: stretch;
    }
    
    label {
        margin-bottom: 5px;
    }
}

/* 修改 JSON 表格樣式，強化直向顯示效果 */
.json-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 14px;
    overflow-x: auto;
    display: block;
}

.json-table th, .json-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.json-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.json-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.json-table tr:hover {
    background-color: #f1f1f1;
}

/* 屬性名稱列樣式 */
.property-name {
    font-weight: 600;
    width: 35%;
    background-color: #f8f8f8;
}

/* 原始 JSON 數據切換按鈕 */
.raw-data-toggle {
    cursor: pointer;
    color: #3498db;
    margin: 10px 0;
    font-size: 14px;
    text-decoration: underline;
}

.raw-data-toggle:hover {
    color: #2980b9;
}

.raw-data {
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

/* 數據表格特定樣式 */
.data-table {
    border: 1px solid #ddd;
    width: 100%;
    margin-bottom: 20px;
    font-size: 16px;
}

.data-table th {
    background-color: #4a89dc;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 12px 15px;
    font-size: 18px;
}

.data-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    line-height: 1.5;
}

.data-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.data-table tr:hover {
    background-color: #e6f2ff;
}

.row-index {
    font-weight: bold;
    background-color: #f8f8f8;
    text-align: center;
    width: 80px;
}

/* 進度顯示樣式 */
.progress-content {
    background-color: #fff;
    border-radius: 5px;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid #3498db;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease-in;
}

.progress-item.system {
    border-left-color: #28a745;
    background-color: #f0f8f0;
}

.progress-item.aralia_search_agent {
    border-left-color: #007bff;
    background-color: #e7f3ff;
}

.progress-item.analytics_planning_agent {
    border-left-color: #fd7e14;
    background-color: #fff3e0;
}

.progress-item.filter_decision_agent {
    border-left-color: #6f42c1;
    background-color: #f0e6ff;
}

.progress-item.analytics_execution_agent {
    border-left-color: #20c997;
    background-color: #e6fff9;
}

.progress-item.interpretation_agent {
    border-left-color: #e83e8c;
    background-color: #ffe6f0;
}

.progress-item.error {
    border-left-color: #dc3545;
    background-color: #ffe6e6;
}

.progress-item .timestamp {
    font-size: 12px;
    color: #6c757d;
    margin-right: 10px;
    font-family: monospace;
    min-width: 80px;
}

.progress-item .message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

/* 進度項目動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 最終回應容器樣式 */
#final-response {
    background-color: #f8f9fa;
    border: 2px solid #28a745;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#final-response h2 {
    color: #28a745;
    border-bottom-color: #28a745;
}

#final-response .content {
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    line-height: 1.6;
    font-size: 14px;
}

/* 載入動畫 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #eee;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}