:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #db2777;
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #0ea5e9;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.2); }
}

/* Layout */
.glass-container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
    min-height: 100vh;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Sidebar */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    padding: 1.5rem;
    height: calc(100vh - 4rem);
    position: sticky;
    top: 2rem;
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Inputs */
.glass-input, .glass-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:focus, .glass-select:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

.glass-select option {
    background: var(--bg-color);
    color: white;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.glass-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.glass-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    transition: all 0.3s;
    flex-grow: 1;
    font-size: 0.9rem;
}

.glass-checkbox:hover input ~ .checkmark {
    background: var(--glass-highlight);
}

.glass-checkbox input:checked ~ .checkmark {
    background: rgba(59, 130, 246, 0.3);
    border-color: var(--accent);
}

.toggle-missing .checkmark {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}
.toggle-missing input:checked ~ .checkmark {
    background: rgba(239, 68, 68, 0.3);
    border-color: var(--danger);
}

/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    margin-top: -6px;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}
.slider-value {
    display: block;
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent-hover);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stat-badge {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

.fabrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Cards */
.fabric-card {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.fabric-card:before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    opacity: 0;
    transition: opacity 0.3s;
}

.fabric-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

.fabric-card:hover:before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-manufacturer {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    border: 1px dashed transparent;
    transition: all 0.2s;
}

.card-price:hover, .card-price:focus {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    outline: none;
}

.price-missing {
    color: var(--danger);
    font-size: 1rem;
}

.card-props {
    display: flex;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.card-specs {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spec-row {
    display: flex;
    justify-content: space-between;
}

.btn-colors {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: auto;
}

.btn-colors:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}

/* Loader */
.loader {
    display: none;
    justify-content: center;
    padding: 2rem;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close-btn:hover {
    color: white;
}

.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    overflow-y: auto;
    padding-right: 1rem;
}

.color-item {
    text-align: center;
}

.color-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    transition: transform 0.3s, border-color 0.3s;
}

.color-item img:hover {
    transform: scale(1.05);
    border-color: var(--accent);
}

.color-name {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.4);
}
