html {
    margin: 0px;
    padding: 0px;
    height: 100%;
}

.err {
    border: 1px solid red;
}

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

body {
    background: #1a1a2e;
    overflow-x: hidden;
    min-height: 100vh;
}

/* WebGL Background */
#webgl-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}


.hc {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
}

button {
    flex: 1;
}

label {
    flex: 1;
}


.hidden {
    display: none !important;
}

.vc {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#main_horizontal {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1800px; /* Or whatever max you want */
    margin: 0 auto;
    padding: 0 20px; /* Add some padding for small screens */
}

#main_vertical {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 120px;
}


@media all and (max-width: 8000px)
{

}


@media all and (max-width: 1100px)
{

}

@media all and (max-width: 900px)
{

}

@media all and (max-width: 650px)
{

}

@media all and (max-width: 500px){

}

@media all and (max-width: 420px){

}

/* ====================================================
   FILTER SYSTEM STYLING
   ==================================================== */
#info_box {
    white-space: pre-line;
    position: relative;
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto 40px auto;
    padding: 30px;
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(20, 20, 35, 0.8) 50%,
        rgba(0, 0, 0, 0.7) 100%);
    backdrop-filter: blur(20px) saturate(1.5);
    border-radius: 20px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Main search options container */
#search_options {
    position: relative;
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto 40px auto;
    padding: 30px;
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(20, 20, 35, 0.8) 50%,
        rgba(0, 0, 0, 0.7) 100%);
    backdrop-filter: blur(20px) saturate(1.5);
    border-radius: 20px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Glow effect when filters are active */
#search_options.has-active-filters {
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(139, 69, 19, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* Loading state for filtering */
#search_options.filtering {
    opacity: 0.7;
    pointer-events: none;
}

/* Filter table styling */
.filter-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 8px;
}

.filter-table thead th {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 5px;
    text-align: center;
    background: linear-gradient(135deg,
        rgba(139, 69, 19, 0.2) 0%,
        rgba(160, 82, 45, 0.15) 100%);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-table tbody td {
    padding: 4px;
    text-align: center;
    vertical-align: middle;
}

/* Empty cells */
.filter-table .empty-cell {
    background: transparent;
    border: none;
}

/* Filter buttons */
.filter-table button {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 100%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* Hover effect */
.filter-table button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Active/Selected state */
.filter-table button.active {
    background: linear-gradient(135deg,
        rgba(139, 69, 19, 0.6) 0%,
        rgba(205, 133, 63, 0.4) 100%);
    border-color: rgba(205, 133, 63, 0.5);
    color: white;
    font-weight: 600;
    transform: translateY(-1px);
    box-shadow:
        0 6px 20px rgba(139, 69, 19, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Active button hover - maintain active appearance */
.filter-table button.active:hover {
    background: linear-gradient(135deg,
        rgba(139, 69, 19, 0.7) 0%,
        rgba(205, 133, 63, 0.5) 100%);
    transform: translateY(-2px);
}

/* Pressed state */
.filter-table button:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

/* Shine effect on hover */
.filter-table button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.filter-table button:hover::before {
    left: 100%;
}

/* Ripple effect on click */
.filter-table button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.filter-table button:active::after {
    width: 100%;
    height: 100%;
}

/* Sort buttons special styling */
.filter-table button[onclick*="filter_sort"] {
    background: linear-gradient(135deg,
        rgba(76, 175, 80, 0.1) 0%,
        rgba(76, 175, 80, 0.05) 100%);
}

.filter-table button[onclick*="filter_sort"]:hover {
    background: linear-gradient(135deg,
        rgba(76, 175, 80, 0.15) 0%,
        rgba(76, 175, 80, 0.08) 100%);
}

.filter-table button[onclick*="filter_sort"].active {
    background: linear-gradient(135deg,
        rgba(76, 175, 80, 0.4) 0%,
        rgba(139, 195, 74, 0.3) 100%);
    border-color: rgba(76, 175, 80, 0.5);
}

/* Clear filters button */
.clear-filters {
    margin-top: 20px;
    padding: 14px 28px;
    background: linear-gradient(135deg,
        rgba(244, 67, 54, 0.2) 0%,
        rgba(244, 67, 54, 0.1) 100%);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.clear-filters:hover {
    background: linear-gradient(135deg,
        rgba(244, 67, 54, 0.3) 0%,
        rgba(244, 67, 54, 0.2) 100%);
    border-color: rgba(244, 67, 54, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
    #search_options {
        padding: 25px 20px;
    }

    .filter-table {
        border-spacing: 6px;
    }

    .filter-table button {
        padding: 10px 12px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    #search_options {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .filter-table {
        border-spacing: 4px;
    }

    .filter-table thead th {
        font-size: 10px;
        padding: 8px 3px;
    }

    .filter-table button {
        padding: 8px 10px;
        font-size: 11px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    #search_options {
        padding: 15px 10px;
        margin-bottom: 25px;
    }

    /* Stack table cells vertically on very small screens */
    .filter-table {
        display: block;
    }

    .filter-table thead {
        display: none;
    }

    .filter-table tbody {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .filter-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .filter-table tbody td {
        padding: 0;
    }

    .filter-table tbody td.empty-cell {
        display: none;
    }

    .filter-table button {
        padding: 10px 8px;
        font-size: 11px;
    }

    .clear-filters {
        padding: 12px 20px;
        font-size: 12px;
        width: 100%;
    }
}

/* Animation states */
@keyframes filterPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(205, 133, 63, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(205, 133, 63, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(205, 133, 63, 0);
    }
}

.filter-table button.active {
    animation: filterPulse 2s infinite;
}

/* Accessibility */
.filter-table button:focus {
    outline: 2px solid rgba(205, 133, 63, 0.5);
    outline-offset: 2px;
}

.filter-table button:focus:not(:focus-visible) {
    outline: none;
}

.blurredContainer {
    padding: 40px;
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(20, 20, 35, 0.8) 50%,
        rgba(0, 0, 0, 0.7) 100%);
    backdrop-filter: blur(20px) saturate(1.5);
    border-radius: 20px;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

/* Loading overlay for results during filtering */
#results_container.filtering-active {
    position: relative;
    pointer-events: none;
}

#results_container.filtering-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 100;
    border-radius: 15px;
}

#results_container.filtering-active::after {
    content: 'Filtering...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: 600;
    z-index: 101;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* ====================================================
   TOY DETAIL PAGE STYLES
   ==================================================== */

.toy-detail-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    max-width: var(--container-max-width, 1200px);
    margin: 0 auto;
    padding: 20px;
}

/* Left Column - Information (1/3) */
.toy-info-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.toy-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.maker-link {
    color: var(--accent-color, #007bff);
    text-decoration: none;
    transition: color 0.3s ease;
}

.maker-link:hover {
    color: var(--accent-color-hover, #0056b3);
    text-decoration: underline;
}

.maker-name {
    font-size: 26px;
    font-weight: 500;
}

.toy--name {
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin: 0;
}

/* Detail Grids */
.toy-details-grid,
.toy-features-grid,
.measurements-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 15px;
    align-items: center;
}

.detail-label {
    font-weight: 600;
    color: var(--text-color-secondary, #666);
    font-size: 14px;
}

.detail-label.small {
    font-size: 13px;
}

.detail-value {
    color: var(--text-color);
    font-size: 14px;
}

.status-label,
.status-value {
    font-size: 14px;
}

.toy-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: center;
    padding: 10px;
    background: var(--bg-color-secondary, rgba(0, 0, 0, 0.05));
    border-radius: 8px;
}

/* Pricing */
.toy-pricing {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: var(--bg-color-secondary, rgba(0, 0, 0, 0.05));
    border-radius: 8px;
}

.selling-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color, #007bff);
}

.price-note {
    font-size: 11px;
    color: var(--text-color-secondary, #666);
    margin: 0;
    font-style: italic;
}

/* Section Headers */
.section-header {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-color, #007bff);
    padding-bottom: 5px;
}

.store-link {
    color: var(--accent-color, #007bff);
    text-decoration: none;
    transition: color 0.3s ease;
}

.store-link:hover {
    color: var(--accent-color-hover, #0056b3);
    text-decoration: underline;
}

/* Right Column - Images (2/3) */
.toy-images-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-image {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.main-image-img {

    max-height: 750px;
    max-width: 500px;
    display: block;
}

/* Additional Images Grid */
.additional-images {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.additional-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 500px;
}

.additional-image {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.additional-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.additional-image-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .toy-detail-container {
        grid-template-columns: 1fr;
        gap: 25px;
        max-width: 800px;
    }
    
    .toy-images-section {
        order: -1;
    }
    
    .additional-images-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .toy-detail-container {
        padding: 15px;
        gap: 20px;
    }
    
    .toy-details-grid,
    .toy-features-grid,
    .measurements-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .toy-status {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .toy-name {
        font-size: 24px;
    }
    
    .selling-price {
        font-size: 20px;
    }
}

/* Filter group indicators */
.filter-table tbody tr:first-child td {
    border-top: 2px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.filter-table tbody tr:last-child td {
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

/* Visual feedback for filter groups */
.filter-table button[onclick*="filter_type"] {
    border-left: 3px solid rgba(255, 107, 107, 0.5);
}

.filter-table button[onclick*="filter_firmness"] {
    border-left: 3px solid rgba(139, 69, 19, 0.5);
}

.filter-table button[onclick*="filter_knot"],
.filter-table button[onclick*="filter_flop"],
.filter-table button[onclick*="filter_ct"],
.filter-table button[onclick*="filter_sc"] {
    border-left: 3px solid rgba(78, 205, 196, 0.5);
}

.filter-table button[onclick*="filter_sort"] {
    border-left: 3px solid rgba(76, 175, 80, 0.5);
}

/* Empty state styling */
.empty-state {
    width: 100%;
    padding: 80px 20px;
    text-align: center;
    display: none; /* Hidden by default */
}

.empty-state p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    font-weight: 500;
    margin: 0 auto;
    max-width: 400px;
    padding: 30px;
    background: linear-gradient(135deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(20, 20, 35, 0.4) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.empty-state p::before {
    content: '🔍';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
    filter: grayscale(20%);
}

/* Animation for empty state appearance */
.empty-state {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .empty-state {
        padding: 60px 15px;
    }

    .empty-state p {
        font-size: 16px;
        padding: 25px;
    }

    .empty-state p::before {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .empty-state {
        padding: 40px 10px;
    }

    .empty-state p {
        font-size: 14px;s
        padding: 20px;
    }

    .empty-state p::before {
        font-size: 28px;
        margin-bottom: 10px;
    }
}