/* Paints Gallery specific styles */

/* Sections */

h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: var(--accent-primary);
}

/* Filters and Sorting Section */
.filters-sorting-section {
    display: flex;
    gap: 40px;
    padding: 30px 40px;
}

.filters-section {
    flex: 1;
}

/* Filters */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
    background: var(--card-bg);
    color: var(--text-primary);
    min-height: 48px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.filter-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

@media (prefers-color-scheme: dark) {
    .filter-group select {
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b0b0b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    }
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filters-actions {
    display: flex;
    gap: 10px;
}

/* Sorting */
.sorting-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.sort-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.sort-link:hover {
    color: var(--accent-primary);
    background: var(--input-bg);
}

.sort-link.active {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--input-bg);
}

.sort-arrow {
    width: 16px;
    height: 16px;
    opacity: 0;
    transition: all 0.3s;
}

.sort-link.active .sort-arrow {
    opacity: 1;
}

.sort-link.active.asc .sort-arrow {
    transform: rotate(180deg);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--card-hover-shadow);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--hover-bg);
}

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

/* Results header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Loading indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading p {
    font-size: 1.2em;
    color: var(--text-secondary);
}

/* Error message */
.error-message {
    background: var(--error-bg);
    border: 2px solid var(--error-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
    font-weight: 600;
    opacity: 0.9;
}

.no-results {
    text-align: center;
    padding: 60px;
    font-size: 1.3em;
    color: var(--text-tertiary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.page-info {
    font-size: 1.1em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    .filters-sorting-section {
        flex-direction: column;
        padding: 20px;
        gap: 30px;
    }

    .sorting-section {
        min-width: auto;
    }

    .results-section {
        padding: 20px;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .sorting-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-group {
        min-width: auto;
    }

    .paints-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
        gap: 10px;
    }
}
