/**
 * ═══════════════════════════════════════════════════════════════════════════
 * ARTWORK DISPLAY SYSTEM - CONSOLIDATED CSS
 * ═══════════════════════════════════════════════════════════════════════════
 *
 * This file contains all CSS code related to the Artwork Display System.
 * It consolidates code from:
 *   - public/css/pages/Explore-artworks.css (Main page styles)
 *   - public/css/pages/artwork.css (Carousel & card styles)
 *   - public/css/layout/sidebar.css (Filter sidebar)
 *   - public/css/base/scrollbar.css (Custom scrollbar)
 *
 * FEATURES:
 *   • Filter Sidebar (Desktop & Mobile Sheet)
 *   • View Toggle Controls
 *   • Carousel Styles with Custom Scrollbar
 *   • Grid & List Views
 *   • Card Hover Effects
 *   • Artist Action Buttons
 *   • Custom Scrollbar
 *   • Responsive Design
 *
 * Last Updated: October 5, 2025
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════════════════
 * 1. CUSTOM SCROLLBAR (Filter Sheet Body)
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Works on Chrome, Edge, Safari */
.filter__sheet-body::-webkit-scrollbar {
    width: 10px;
    background: transparent;
}

.filter__sheet-body::-webkit-scrollbar-track {
    background: transparent;
}

.filter__sheet-body::-webkit-scrollbar-thumb {
    background-color: rgba(234, 241, 255, 0.30); /* #EAF1FF 30% */
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background-color 0.2s ease-in-out;
}

.filter__sheet-body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(234, 241, 255, 0.50);
}

/* Light theme */
[data-theme="light"] .filter__sheet-body::-webkit-scrollbar-thumb {
    background-color: rgba(14, 17, 24, 0.50);
}

/* Firefox */
.filter__sheet-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(234, 241, 255, 0.30) transparent;
}

[data-theme="light"] .filter__sheet-body {
    scrollbar-color: rgba(14, 17, 24, 0.50) transparent;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 2. FILTER SIDEBAR SYSTEM
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Filter sidebar base */
.filter {
    min-width: 380px;
    display: none;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease-in-out;
}

.filter.active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

/* Filter sheet structure */
.filter__sheet {
    position: relative;
    display: flex;
    flex-direction: column;
}

.filter__sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
}

.filter__sheet-footer {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

/* Filter sections */
.filter__section {
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--color-accent);
}

.filter__section:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

/* Filter toggle */
.filter__header.active svg {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.filter__options {
    display: none;
}

.filter__options.active {
    display: flex !important;
}

/* Filter availability icon */
.filter__availability-icon {
    border-radius: 2px;
}

/* Techniques filter section */
.filter__options--techniques input {
    display: none;
}

.filter__radio-inner {
    display: block;
    width: 20px;
    height: 20px;
    background-color: var(--color-accent);
    border-radius: 50%;
}

.filter__options--techniques input:checked + .filter__radio-inner {
    border: 4px solid var(--color-primary);
    background: var(--color-secondary-alt);
}

.filter__options--techniques .filter__radio-txt {
    font-family: var(--font-family-base);
    font-size: var(--font-size-b-16);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
    color: var(--color-text);
}

.filter__options--techniques .filter__radio-count {
    font-family: var(--font-family-base);
    font-size: var(--font-size-b-14);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
    color: var(--color-support);
}

/* Price filter section */
.filter__range-wrapper {
    position: relative;
    width: 100%;
}

.filter__range-container {
    position: relative;
    width: 100%;
    margin-top: 18px;
}

.filter__range-track {
    width: 100%;
    height: 4px;
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto;
    border-radius: 5px;
}

.filter__range-container input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    outline: none;
    position: absolute;
    margin: auto;
    top: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
}

.filter__range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-color: var(--color-primary);
    border: 1px solid var(--color-secondary-alt);
    cursor: pointer;
    pointer-events: auto;
}

.filter__range-container input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-color: var(--color-primary);
    border: 1px solid var(--color-secondary-alt);
    cursor: pointer;
    pointer-events: auto;
}

/* Orientation, Size filter section */
.filter__radio-tile {
    width: 40px;
    height: 40px;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
}

.filter__radio-tile input {
    display: none;
}

.filter__radio-shape {
    border-radius: 1px;
}

.filter__radio-tile:has(input:checked) {
    border: 1px solid var(--color-secondary-alt);
}

/* Color filter section */
.color-filter__group {
    display: flex;
    gap: var(--spacing-md);
    height: 24px;
}

.color-filter__item {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 60px;
}

.color-filter__tile {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 2px;
    transition: border 0.2s;
    padding: 3px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    min-width: 27px;
    min-height: 18px;
}

.color-filter__tile span {
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

/* Color modifiers */
.color-filter__tile--coral span     { background: #f64e60; }
.color-filter__tile--dodger span    { background: #3699ff; }
.color-filter__tile--turquoise span { background: #1bc5bd; }
.color-filter__tile--violet span    { background: #8950fc; }
.color-filter__tile--midnight span  { background: #1b283f; }
.color-filter__tile--lavender span  { background: #d6d6e0; }

/* Checked state */
.color-filter__input:checked + .color-filter__tile--coral { border: 2px solid #3a2434; }
.color-filter__input:checked + .color-filter__tile--dodger { border: 2px solid #1d5d94; }
.color-filter__input:checked + .color-filter__tile--turquoise { border: 2px solid #127d75; }
.color-filter__input:checked + .color-filter__tile--violet { border: 2px solid #4a28a6; }
.color-filter__input:checked + .color-filter__tile--midnight {border: 2px solid #232e41;}
.color-filter__input:checked + .color-filter__tile--lavender { border: 2px solid #a5a5b4; }

/* ═══════════════════════════════════════════════════════════════════════════
 * 3. MAIN CONTAINER & LAYOUT
 * ═══════════════════════════════════════════════════════════════════════════ */

.explore-artworks-main-container {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-5xl) var(--spacing-9xl) !important;
    gap: var(--spacing-5xl); /* 40px */
    width: 100%;
    margin-bottom: var(--spacing-6xl);
}

/* Explore artworks flex container - prevent overflow */
.explore-artworks {
    min-width: 0; /* Allow flex container to shrink */
    width: 100%;
}

/* Artworks content area - properly constrain width when filter is open */
.artworks-content {
    flex: 1;
    min-width: 0; /* Important: allows flex item to shrink below content size */
    width: 100%;
}

/* Ensure artwork views properly constrain to available space */
.artist-card__sliders,
.discover-view__list,
.discover-view__grid {
    width: 100%;
    min-width: 0; /* Allow proper shrinking */
}

/* Individual slider cards should also constrain properly */
.artist-card__slider {
    width: 100%;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 4. FILTER TOGGLE BUTTON
 * ═══════════════════════════════════════════════════════════════════════════ */

.toggle-filter-btn.active {
    background-color: var(--color-primary);
    color: var(--color-secondary-alt);
}

/* Filter icon button toggle */
.toggle-filter-btn .toggle-filter-btn-icon__active {
    display: none;
}

.toggle-filter-btn.active .toggle-filter-btn-icon__active {
    display: block;
}

.toggle-filter-btn .toggle-filter-btn-icon {
    display: block;
}

.toggle-filter-btn.active .toggle-filter-btn-icon {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 5. CAROUSEL SYSTEM
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Carousel wrapper */
.artist-card__carousel-wrapper {
    position: relative;
    overflow: hidden;
    margin: 0 var(--spacing-5xl) var(--spacing-6xl);
}

/* Carousel track & items */
.artist-card__carousel-track {
    display: flex;
    gap: var(--spacing-xl);
    transition: transform 0.3s ease;
}

.artist-card__carousel-item {
    flex: 0 0 auto;
    height: 320px;
    border-radius: 6px;
    overflow: hidden;
}

.artist-card__carousel-img {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.artist-card__carousel-img img {
    height: 320px;
    width: auto;
}

/* Carousel navigation buttons */
.artist-card__carousel-nav-wrapper {
    position: relative;
    top: calc(320px / 2);
    width: 100%;
}

.artist-card__carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 50px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #0A2852;
    box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.30);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(6px);
    border: none;
}

.artist-card__carousel-nav--prev {
    left: 0;
}

.artist-card__carousel-nav--next {
    right: 0;
}

.artist-card__carousel-nav:hover {
    transform: translateY(-50%) scale(1.04);
}

/* Custom scrollbar for carousel */
.artist-card__scrollbar {
    position: relative;
    width: 100%;
    height: 8px;
    background: #22293A;
    border-radius: 4px;
    cursor: pointer;
}

.artist-card__scroll-track {
    position: absolute;
    border-radius: 4px;
    inset: 0;
}

.artist-card__scroll-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 37.042px;
    height: 40.455px;
    transform: translateY(-50%);
    cursor: grab;
    z-index: 10;
}

/* Hexagon SVG thumb */
.scroll-thumb__svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    transition: transform 0.3s;
}

.scroll-thumb__bg {
    fill: rgba(1, 107, 255, 0.3);
}

.scroll-thumb__ring {
    fill: #016BFF;
    transform-origin: 50% 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* Hover state */
.artist-card__scroll-thumb:hover .scroll-thumb__svg {
    transform: scale(1.15);
}

/* Active state */
.artist-card__scroll-thumb:active {
    cursor: grabbing;
}

.artist-card__scroll-thumb:active .scroll-thumb__svg {
    transform: scale(1.05);
}

/* Pulse animation on the ring */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 6. GRID & LIST VIEWS
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Grid view */
.discover-view__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 8px;
    gap: 20px;
}

.discover-view__grid .discover-view__image-wrap {
    width: 100%;
    aspect-ratio: auto;
    overflow: visible;
}
.discover-view__title {
    column-gap: 3px;
}

/* List view */
.discover-view__list,
.recent-view__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 425px));
    gap: var(--spacing-xl);
}

.recent-view__list:has(> *:nth-child(4):last-child),
.discover-view__list {
    grid-template-columns: repeat(4, 1fr);
}

/* Image containers */
.discover-view__image-wrap,
.recent-view__image-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.discover-view__image-wrap > img,
.artist-card__carousel-img > img,
.recent-view__image-wrap > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 7. CARD HOVER EFFECTS
 * ═══════════════════════════════════════════════════════════════════════════ */

.discover-view__hover--container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: var(--spacing-md);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
    border-radius: inherit;
}

.discover-view__card:hover .discover-view__hover--container,
.artist-card__carousel-img:hover .discover-view__hover--container,
.recent-view__card:hover .discover-view__hover--container {
    opacity: 1;
    transform: scale(1);
}

.discover-view__hover--container-bottom {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
    border-radius: 10px;
    background: rgba(14, 17, 24, 0.80);
    box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(5px);
}

.discover-view__hover--details {
    display: flex;
    flex-direction: column;
}

.discover-view__artist-image {
    width: 30px !important;
    height: 30px !important;
    object-fit: cover;
}

.discover-view__divider,
.recent-view__divider {
    width: 100%;
    height: 1px;
    background: var(--color-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 8. FAVORITE BUTTON
 * ═══════════════════════════════════════════════════════════════════════════ */

.fav-artwork__favorite {
    width: 30px;
    height: 30px;
    background: #0E1118CC;
    backdrop-filter: blur(10px);
    box-shadow: 0px 0px 30px 0px #0000004D;
    border-radius: 50%;
}

.fav-artwork__favorite input {
    display: none;
}

.fav-artwork__favorite input:checked + .fav-artwork__heart svg {
    fill: #BB003E;
    stroke: #BB003E;
    animation: heartButton 0.6s;
}

@keyframes heartButton {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 9. RESPONSIVE DESIGN - MOBILE FILTER SHEET
 * ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .filter {
        position: fixed;
        inset: 0;
        width: 100%;
        min-width: 0;
        height: 100vh;
        padding: 0 !important;
        margin: 0;
        border-radius: 0 !important;
        opacity: 1;
        transform: none;
        background: transparent !important;
        pointer-events: none;
        z-index: 11;
    }

    .filter.active {
        display: block;
        pointer-events: auto;
    }

    .filter__sheet {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        background: var(--color-secondary);
        height: 100vh;
        transform: translateY(-100%);
        transition: transform 0.35s ease;
        overflow: hidden;
        z-index: 1;
    }

    .filter.active .filter__sheet {
        transform: translateY(0);
    }

    .filter__sheet-footer,
    .filter__sheet-header {
        padding: var(--spacing-xl) var(--spacing-3xl);
        align-items: center;
    }

    .filter__sheet-header {
        border-bottom: 1px solid var(--color-accent);
    }

    .filter__sheet-footer {
        border-top: 1px solid var(--color-accent);
        gap: var(--spacing-xl);
    }

    .filter__sheet-body {
        flex: 1 1 auto;
        overflow-y: auto;
        padding: var(--spacing-3xl);
    }

    body.filter-sheet-open {
        overflow: hidden;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * 10. RESPONSIVE DESIGN - GENERAL
 * ═══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1921px) {
    .explore-artworks-main-container {
        max-width: 1920px;
        padding-top: 0 !important;
        margin: 0 auto;
        transition: .6s all;
        width: auto;
    }
}

@media (max-width: 1200px) {
    .discover-view__grid,
    .recent-view__list,
    .discover-view__list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 950px) {
    .explore-artworks-main-container {
        padding: 0 var(--spacing-5xl) !important;
    }

    /* Hide slider view on mobile */
    .artist-card__sliders {
        display: none !important;
    }

    /* Hide option1 (slider view toggle) on mobile */
    #option1,
    label[for="option1"] {
        display: none !important;
    }

    .discover-view__grid,
    .recent-view__list,
    .discover-view__list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .discover-view__grid,
    .recent-view__list,
    .discover-view__list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 580px) {
    .discover-view__grid {
        display: flex;
        flex-direction: column;
    }

    .discover-view__grid .discover-view__card {
        grid-row-end: auto !important;
    }

    .discover-view__grid .discover-view__card img {
        width: 100% !important;
    }
}

@media (max-width: 520px) {
    .explore-artworks-main-container {
        padding-inline: var(--spacing-4xl) !important;
    }
}

