/* Google Fonts for a clean look */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
    --primary-color: #2A4B8D;
    --secondary-color: #7F8082;
    --background-color: #E9EBF1;
    --card-bg-color: #FFFFFF;
    --text-color: #333333;
    --header-text-color: #FFFFFF;
    --accent-color: #4CAF50;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--primary-color);
    color: var(--header-text-color);
    padding: 20px;
    text-align: center;
    border-bottom: 5px solid var(--secondary-color);
}

header .logo {
    max-width: 150px;
    margin-bottom: 10px;
}

header h1 {
    margin: 0;
    font-weight: 700;
}

header .slogan {
    margin: 5px 0 0;
    font-weight: 300;
    font-style: italic;
    color: #ccc;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tabs-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.tab-button {
    padding: 12px 24px;
    margin: 0 5px;
    border: none;
    background-color: #ddd;
    color: var(--text-color);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tab-button:hover:not(.active) {
    background-color: #c0c0c0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background-color: var(--card-bg-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-top: 0;
}

input[type="file"],
input[type="text"],
select,
button {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box; 
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #1E3A75;
    transform: translateY(-1px);
}

.progress-bar-container {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
    border: 1px solid #ddd;
    height: 25px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    text-align: center;
    line-height: 25px;
    color: white;
    transition: width 0.4s ease;
}

.hidden {
    display: none;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--primary-color);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-controls input,
.filter-controls select {
    flex-grow: 1;
    margin-bottom: 0;
}

.filter-controls button {
    width: auto;
    flex-grow: 0;
}

.filter-list {
    margin-top: 15px;
}

.filter-item {
    background-color: #f0f0f5;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e0e0e5;
}

.filter-item span {
    word-break: break-all;
}

.remove-filter-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: 10px;
}

.mapping-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.mapping-row .from-input {
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    cursor: not-allowed;
    width: 40%;
}

.mapping-row .to-input {
    width: 40%;
}

.mapping-row span {
    font-weight: bold;
    color: #777;
}

.chart-controls {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.graph-title-container {
    text-align: center;
    margin-bottom: 20px;
}

#graphTitleInput {
    width: 60%;
    max-width: 500px;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    min-height: 600px;
}

#resultTable table, #tsResultTable table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#resultTable th, #resultTable td, #tsResultTable th, #tsResultTable td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

#resultTable th, #tsResultTable th {
    background-color: var(--secondary-color);
    color: white;
}

footer {
    background: #333;
    color: #eee;
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
}

footer .signature {
    max-width: 200px;
    margin-top: 15px;
}

.signature {
    max-width: 200px;
    height: auto;
    margin-top: 15px;
    filter: invert(1);
}

@media (max-width: 768px) {
    .config-grid,
    .filter-controls,
    .mapping-row {
        flex-direction: column;
        gap: 15px;
    }

    .filter-controls input,
    .filter-controls select,
    .filter-controls button,
    .mapping-row .from-input,
    .mapping-row .to-input {
        width: 100%;
    }
}