/* Thiết lập biến màu và font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');
:root {
    /* Màu Chủ Đạo: Màu Xanh Ngọc (Teal/Cyan) - Hiện đại và Chuyên nghiệp */
    --primary-color: #00BCD4; /* Màu Xanh Bầu Trời Nhạt */
    /* Màu Tương Phản: Xanh Đen */
    --secondary-color: #1a237e; /* Indigo đậm */
    /* Nền: Xám Nhạt hiện đại */
    --background-light: #f6f8fa;
    --card-background: #ffffff;
    --shadow-strong: 0 10px 30px rgba(0, 0, 0, 0.08);
    --border-radius-xl: 12px;

    /* Màu cho Trạng thái */
    --success-color: #4CAF50;
    --error-color: #D32F2F;
}

body {
    font-family: 'Inter', sans-serif;
    padding: 10px;
    background: var(--background-light);
    line-height: 1.6;
    color: var(--secondary-color);
    min-height: 100vh;
}

/* Container chính */
.container {
    max-width: 1300px;
    margin: 20px auto;
    background: var(--card-background);
    padding: clamp(20px, 5vw, 50px);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-strong);
}
/*
h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 5px;
    font-weight: 800;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}*/
h2 {
    color: var(--secondary-color);
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px;
    margin-top: 0;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
}
h2 + p {
    color: #6c757d;
    text-align: center;
    margin-bottom: 40px;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
}

/* Khu vực chức năng */
.tool-section {
    margin-bottom: 40px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius-xl);
    background-color: #ffffff;
}

/* Cố định khung Input và Output */
.io-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.io-item {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 1.1em;
    color: var(--secondary-color);
}

/* Cố định chiều cao cho Textarea và JSON Editor */
textarea, #jsonEditorContainer {
    width: 100%;
    margin-top: 5px;
    border: 2px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.95em;
    font-family: 'Consolas', 'Courier New', monospace;
    min-height: 500px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.2);
    outline: none;
}

textarea {
    padding: 15px;
    resize: vertical;
}

/* Thiết lập cho JSONEditor (Tree View) */
#jsonEditorContainer {
    padding: 0;
    /* Cần điều chỉnh viền của thư viện JSON Editor */
    border: 2px solid #ccc !important;
}

/* Các nút chức năng */
.button-group {
    margin-top: 30px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 6px 15px rgba(0, 188, 212, 0.5);
}

.btn-primary:hover {
    background-color: #0097a7;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 188, 212, 0.7);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 4px 10px rgba(73, 80, 87, 0.3);
}
.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(73, 80, 87, 0.5);
}

/* Khu vực Trạng thái */
#statusArea {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f0f4f7;
    min-height: 50px;
    font-family: sans-serif;
    font-size: 1.0em;
    text-align: center;
    font-weight: 600;
}
.status-valid {
    color: var(--success-color);
}
.status-invalid {
    color: var(--error-color);
    font-family: monospace;
    text-align: left;
    white-space: pre-wrap;
}

/* Responsive cho thiết bị di động */
@media (max-width: 900px) {
    .io-group {
        flex-direction: column;
    }
    .container {
        margin: 10px auto;
        padding: 20px;
    }
    .btn {
        width: 100%;
        margin: 5px 0;
    }
    .button-group {
        flex-direction: column;
    }
}