/* Reset & Normalize */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

header {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 1rem;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Search Container Styling */
.search-container {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

#search-input {
    flex: 1;
    padding: 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    min-width: 250px;
}

#search-input:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.2);
}

#search-button, #clear-search {
    padding: 0.7rem 1rem;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#search-button:hover, #clear-search:hover {
    background-color: #1a252f;
}

#clear-search {
    background-color: #95a5a6;
}

#clear-search:hover {
    background-color: #7f8c8d;
}

.search-results {
    width: 100%;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 0.5rem;
    padding: 0 0.2rem;
}

.search-highlight {
    background-color: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: bold;
}

/* Styling for matched rows */
tr.search-match td {
    background-color: rgba(255, 235, 59, 0.1);
}

/* Fade effect for non-matched rows when searching */
tr:not(.search-match) td {
    transition: opacity 0.3s ease;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Loading Indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #2c3e50;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Table Styling */
.table-container {
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    font-size: 0.95rem;
}

.data-table th, 
.data-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.data-table th:hover {
    background-color: #eaeaea;
}

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

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

/* Sorting Icons */
.sort-icon::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 5px;
    opacity: 0.3;
}

th.sort-asc .sort-icon::after {
    content: '\f0de';
    opacity: 1;
}

th.sort-desc .sort-icon::after {
    content: '\f0dd';
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th, 
    .data-table td {
        padding: 0.6rem;
    }
    
    header {
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th, 
    .data-table td {
        padding: 0.5rem;
    }
}

footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1.5rem 0;
    background-color: #2c3e50;
    color: white;
}
