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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.search-container {
    position: relative;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#search {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: all 0.3s ease;
}

#search:focus {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stats {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
    font-size: 14px;
}

#grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

#grid a {
    display: block;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.4;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    word-break: break-all;
}

#grid a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

#loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    display: none;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.load-more-btn {
    display: block;
    margin: 20px auto;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.no-results {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 40px;
    font-size: 16px;
}

mark {
    background-color: #DFCF6B;
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.open {
    right: 0;
}

.sidebar-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
    font-size: 14px;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

.sidebar-header {
    padding: 20px;
    background: transparent;
    opacity: 0;
}

.sidebar-content {
    padding: 20px;
}

#filterButtons {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding-right: 8px;
}

.filter-button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-align: left;
}

.filter-button:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

.filter-button.active {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.4);
}

.clear-filter-btn {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.clear-filter-btn:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* Style the scrollbar for filter buttons */
#filterButtons::-webkit-scrollbar {
    width: 6px;
}

#filterButtons::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#filterButtons::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#filterButtons::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        right: -280px;
    }
    
    .sidebar-toggle {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #filterButtons {
        max-height: calc(100vh - 120px);
    }
    
    #grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    #grid a {
        font-size: 14px;
        padding: 14px 16px;
    }
}

.clear-search-btn {
    margin-left: 10px;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.clear-search-btn:hover {
    background: #c82333;
}

.search-container input {
    padding-right: 70px;
}
