:root {
    --bg-main: #0d1117;
    --bg-card-blur: rgba(22, 27, 34, 0.75);
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --border: #30363d;
    --accent-blue: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.3);
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.4);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(88, 166, 255, 0.1) 0%, transparent 30%),
        radial-gradient(circle at 75% 75%, rgba(37, 99, 235, 0.1) 0%, transparent 30%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 5vh 20px;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: var(--bg-card-blur);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 80px rgba(88, 166, 255, 0.1) inset;
    transition: all 0.3s ease;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.card-selector-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    width: 300px;
}

#gpu-search {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    box-sizing: border-box;
}

#gpu-search:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-glow);
}

.search-results {
    display: none;
    position: absolute;
    width: 100%;
    background-color: #1e293b; /* A more solid background */
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
}

.search-results.visible {
    display: block;
}

.search-results div {
    padding: 10px 14px;
    color: var(--text-main);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

.search-results div:last-child {
    border-bottom: none;
}

.search-results div:hover {
    background-color: var(--accent-blue);
}

/* Custom scrollbar for results */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
    border: 3px solid transparent;
    background-clip: content-box;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-blue);
}

.settings-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 28px;
    height: 28px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.settings-icon:hover {
    color: var(--text-main);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(5px);
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-main);
}

.close-btn {
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--text-main);
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section h3 {
    color: var(--text-main);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

#vendor-filters, #arch-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.filter-checkbox:hover {
    border-color: var(--border);
}

.filter-checkbox input {
    display: none; /* Hide default checkbox */
}

.filter-checkbox .custom-box {
    width: 18px;
    height: 18px;
    background-color: transparent;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.filter-checkbox .custom-box::after {
    content: '✔';
    color: var(--bg-main);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.filter-checkbox input:checked + .custom-box {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.filter-checkbox input:checked + .custom-box::after {
    opacity: 1;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

button {
    padding: 10px 22px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: pointer;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    position: relative;
}

button:hover {
    color: var(--text-main);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

button.active {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px var(--accent-glow);
}

#chart {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.bar-container {
    display: grid;
    grid-template-columns: 250px 1fr 80px;
    gap: 12px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.bar-container:last-child {
    border-bottom: none;
}

.bar-container:hover {
    background-color: rgba(255, 255, 255, 0.03);
    transform: scale(1.01);
}

.label {
    text-align: right;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.2s ease;
}

.label:hover {
    color: var(--gold);
}

.arch-badge {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.bar-wrapper {
    flex-grow: 1;
    background-color: rgba(0, 0, 0, 0.2);
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.bar {
    height: 100%;
    border-radius: 5px 0 0 5px;
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.05);
}

.value-text {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-main);
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    text-align: right;
}

/* Marked State */
.bar-container.marked {
    background-color: rgba(255, 215, 0, 0.05);
}

.bar-container.marked .label {
    color: var(--gold);
    font-weight: 600;
}

.bar-container.marked .bar {
    box-shadow: 0 0 15px var(--gold-glow), inset 0 1px 2px rgba(255,255,255,0.2);
}

.bar-container.marked .value-text {
    color: var(--gold);
    text-shadow: 0 0 8px var(--gold-glow);
}

/* Responsive */
@media (max-width: 768px) {
    body { padding: 20px 15px; }
    .container { padding: 24px; }
    h1 { font-size: 1.75rem; }
    .controls { gap: 8px; }
    button { padding: 8px 18px; font-size: 0.85rem; }

    .bar-container {
        grid-template-columns: 1fr 80px;
        gap: 10px;
        margin-bottom: 12px;
        border-bottom: 1px solid var(--border);
        padding-bottom: 12px;
    }
    .bar-container:hover { transform: none; }
    .label { grid-column: 1 / -1; text-align: left; margin-bottom: 4px; }
    .bar-wrapper { grid-column: 1 / 2; }
    .value-text { grid-column: 2 / 3; text-align: right; }
    .arch-badge { display: inline; margin-left: 8px; }
}

@media (max-width: 480px) {
    .container { padding: 20px; border-radius: 16px; }
    h1 { font-size: 1.5rem; margin-bottom: 24px; }
    .controls { justify-content: space-around; }
    button { flex-grow: 1; text-align: center; }
    .bar-container { grid-template-columns: 1fr 70px; }
    .value-text { font-size: 0.8rem; }
}