:root {
    --primary-color: #0056b3;
    --text-color: #333;
    --border-color: #ccc;
    --background-color: #f4f4f4;
    --header-background: #e0e0e0;
    --table-header-background: #d4d4d4;
    --focus-outline-color: #007bff;
}

/* Basic Reset & Box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

.container {
    background-color: #fff;
    width: 100%;
    overflow: auto;
}

.header {
    background-color: var(--header-background);
    padding: 20px;
}

.search-and-filters-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 auto;
}

.search-bar {
    display: flex;
    gap: 10px;
}

.search-bar input[type="text"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
}

.search-bar input[type="text"]:focus {
    outline: 2px solid var(--focus-outline-color);
    border-color: transparent;
}

.search-bar button {
    padding: 0;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.search-bar button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.search-bar button:hover {
    background-color: #004499;
}

.filters {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.filters label {
    font-weight: bold;
    color: var(--text-color);
    font-size: 0.9em;
}

.filters input[type="text"],
.filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
    min-width: 100px;
}

.filters input[type="text"]:focus,
.filters select:focus {
    outline: 2px solid var(--focus-outline-color);
    border-color: transparent;
}

.batch-actions {
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    /* min-height: 72px; */ /* To prevent layout shift when switching to progress bar */
}

#batch-actions-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

#progress-section {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

#progress-section .progress-container {
    flex-grow: 1;
    background-color: #ddd;
    border-radius: 4px;
    overflow: hidden;
    height: 1em; /* Match line height */
}

#progress-section .progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 4px;
    transition: width 0.2s ease-in-out;
}

#progress-section .progress-text {
    color: var(--text-color);
    font-size: 0.9em;
    white-space: nowrap;
    flex-shrink: 0;
}

.batch-actions .separator {
    color: var(--border-color);
}

.batch-actions input[type="number"] {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9em;
}

    padding: 4px 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    flex-shrink: 0;

.batch-actions button:hover {
    background-color: #004499;
}

.batch-actions button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.results-section {
    position: relative;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

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

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

table th:first-child,
table td:first-child {
    width: 40px;
    text-align: center;
}

table th {
    background-color: var(--table-header-background);
    color: var(--text-color);
    font-weight: bold;
    white-space: nowrap;
}

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

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

table td button {
    padding: 6px 10px;
    border: 1px solid var(--primary-color);
    background-color: #fff;
    color: var(--primary-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

table td button:hover {
    background-color: var(--primary-color);
    color: white;
}

@media (max-width: 768px) {
    .header {
        padding: 15px;
    }

    .filters {
        padding-top: 10px;
        gap: 15px;
        justify-content: flex-start;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .filters input[type="text"],
    .filters select {
        width: 100%;
        max-width: 180px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px;
    }

    .search-bar input[type="text"] {
        font-size: 0.95em;
    }
    .search-bar button,
    .batch-actions button {
        width: 36px;
        height: 36px;
    }
    .search-bar button svg,
    .batch-actions button svg {
        width: 20px;
        height: 20px;
    }

    .filters {
        padding-top: 8px;
        gap: 10px;
    }

    table th,
    table td {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    table td button {
        padding: 5px 8px;
        font-size: 0.75em;
    }
}