:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #1abc9c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --gray-light: #f8f9fa;
    --gray-medium: #e9ecef;
    --gray-dark: #6c757d;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.controls {
    padding: 25px;
    background-color: var(--gray-light);
    border-bottom: 1px solid var(--gray-medium);
}

.search-box {
    position: relative;
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-dark);
    font-size: 1.2rem;
}

.search-box input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    font-size: 1.1rem;
    border: 2px solid var(--gray-medium);
    border-radius: 8px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-dark);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
    display: none;
}

.clear-btn:hover {
    background-color: var(--gray-medium);
    color: var(--dark-color);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 500;
    color: var(--dark-color);
    white-space: nowrap;
}

.filter-group label i {
    margin-right: 5px;
}

.filter-group select {
    padding: 10px 15px;
    border: 2px solid var(--gray-medium);
    border-radius: 6px;
    background-color: white;
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.stats {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.95rem;
    color: var(--gray-dark);
    border-top: 1px solid var(--gray-medium);
    padding-top: 15px;
}

.table-container {
    overflow-x: auto;
    padding: 0 25px 25px;
    max-height: 600px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

table th {
    background-color: var(--primary-color);
    color: white;
    text-align: left;
    padding: 15px;
    font-weight: 500;
    position: relative;
    user-select: none;
}

table th:after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.5);
}

table th.sort-asc:after {
    border-top: none;
    border-bottom: 5px solid white;
}

table th.sort-desc:after {
    border-top: 5px solid white;
    border-bottom: none;
}

table tbody tr {
    border-bottom: 1px solid var(--gray-medium);
    transition: var(--transition);
}

table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

table td {
    padding: 15px;
    vertical-align: top;
}

table td:nth-child(1) { /* IDX */
    width: 70px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

table td:nth-child(2) { /* Tool Name */
    width: 250px;
    font-weight: 500;
    color: var(--dark-color);
}

table td:nth-child(3) { /* Description */
    min-width: 400px;
}

table td:nth-child(4) { /* Category */
    width: 180px;
}

table td:nth-child(5) { /* Server Name */
    width: 200px;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.category-Databases {
    background-color: rgba(41, 128, 185, 0.1);
    color: #2980b9;
}

.category-Computational {
    background-color: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.category-Model {
    background-color: rgba(155, 89, 182, 0.1);
    color: #8e44ad;
}

.category-Literature {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f39c12;
}

.category-Wet-lab {
    background-color: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.server-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.no-results i {
    font-size: 4rem;
    color: var(--gray-medium);
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.no-results p {
    color: var(--gray-dark);
    font-size: 1.1rem;
}

footer {
    background-color: var(--gray-light);
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--gray-medium);
    color: var(--gray-dark);
    font-size: 0.9rem;
}

footer .github-link {
    margin-top: 10px;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 992px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group select {
        width: 100%;
    }
    
    table td:nth-child(2),
    table td:nth-child(3),
    table td:nth-child(4),
    table td:nth-child(5) {
        width: auto;
    }
    
    .table-container {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .table-container {
        padding: 0 15px 15px;
    }
    
    table td {
        padding: 10px;
    }
    
    table th {
        padding: 12px 10px;
    }
}

@media (max-width: 576px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    .controls {
        padding: 15px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table td, table th {
        padding: 8px;
    }
    
    .category-badge, .server-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}
