html {
    color-scheme: dark;
}

body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: var(--weight-bold);
    color: var(--primary);
    text-decoration: none;
    font-family: var(--font-alt);
}

.search-bar-nav {
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--ins-radius-m);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 121, 145, 0.1);
}

.search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--ins-radius-s);
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-dark);
}

.nav-auth {
    display: flex;
    gap: 1rem;
    align-items: center;
}


/* Main Content */

.main-content {
    margin-top: 100px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem;
}


/* Filters Bar */

.filters-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--ins-radius-l);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--ins-radius-s);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.btn-apply {
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--ins-radius-s);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-apply:hover {
    background: var(--primary-dark);
}

.btn-clear {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--ins-radius-s);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-clear:hover {
    border-color: var(--danger);
    color: var(--danger);
}


/* Results Area */

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-info {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.results-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.view-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--ins-radius-s);
    overflow: hidden;
}

.view-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active {
    background: var(--primary);
    color: white;
}

.sort-select {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--ins-radius-s);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}


/* Active Filters */

.active-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--ins-radius-full);
    font-size: 0.875rem;
    color: var(--text-primary);
}

.filter-tag-remove {
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color 0.3s ease;
}

.filter-tag-remove:hover {
    color: var(--danger);
}

.model-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--ins-radius-l);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.model-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.model-image {
    width: 100%;
    aspect-ratio: 4/2;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--surface) 100%);
    position: relative;
    overflow: hidden;
}

.model-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.model-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--ins-radius-s);
}

.model-badge.free {
    background: rgba(16, 185, 129, 0.9);
}

.model-badge.premium {
    background: rgba(245, 158, 11, 0.9);
}

.model-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.model-card:hover .model-actions {
    opacity: 1;
}

.action-btn {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: var(--ins-radius-s);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary);
}

.model-info {
    padding: 1rem;
}

.model-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.author-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.model-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.model-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.model-price.free {
    color: var(--success);
}

.model-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


/* Loading Indicator */

.loading-indicator {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    display: none;
}

.loading-indicator.active {
    display: block;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.end-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-tertiary);
    font-size: 1.125rem;
    display: none;
}

.end-message.active {
    display: block;
}


/* Responsive */

@media (max-width: 1024px) {
    .filters-row {
        flex-direction: column;
    }
    .filter-group {
        width: 100%;
    }
    .main-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    .search-bar-nav {
        display: none;
    }
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .filters-bar {
        padding: 1rem;
    }
    .filter-actions {
        width: 100%;
        flex-direction: column;
    }
    .btn-apply,
    .btn-clear {
        width: 100%;
    }
}