﻿/* Global CSS Variables and Media Queries */
:root {
    --bg: #050505;
    --text: #ffffff;
    --text-muted: #888888;
    --border: #222222;
    --border-light: #333333;
    --accent: #ffffff;
    --accent-bg: #1a1a1a;

    --radius: 0px;

    --radius-pill: 9999px;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

    --base-cols: 7;
    --grid-offset: 0;
    --grid-columns: calc(var(--base-cols) + var(--grid-offset));
}

@media (max-width: 1600px) {
    :root {
        --base-cols: 6;
    }
}

@media (max-width: 1200px) {
    :root {
        --base-cols: 5;
    }
}

@media (max-width: 992px) {
    :root {
        --base-cols: 4;
    }
}

@media (max-width: 768px) {
    :root {
        --base-cols: 3;
    }
}

@media (max-width: 480px) {
    :root {
        --base-cols: 2;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;

    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg);
    padding-bottom: 60px;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-pill);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    background: none;
    border: none;
    color: inherit;
}

/* Top Navigation Bar Styling */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.logo {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.logo-divider {
    color: var(--text-muted);
    font-size: 14px;
}

.logo-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.nav-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

.search-pill {
    display: flex;
    align-items: center;
    background: var(--accent-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    width: 100%;
    max-width: 480px;
    transition: border-color 0.2s;
}

.search-pill:focus-within {
    border-color: var(--border-light);
}

.search-icon,
.jump-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text);
    padding: 4px 12px;
    font-size: 13px;
    outline: none;
    width: 100%;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.jump-input {
    width: 120px;

}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-divider {
    width: 1px;
    height: 14px;
    background: var(--border);
    margin: 0 12px;
}

.clear-input-btn {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
}

.clear-input-btn:hover {
    color: var(--text);
}

.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex: 1;
}

.swipe-btn {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    transition: all 0.2s;
}

.swipe-btn:hover {
    background: var(--text);
    color: var(--bg);
}

.support-btn {
    font-size: 13px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.support-btn:hover {
    color: var(--text);
}

@media (max-width: 600px) {
    .top-nav {
        flex-wrap: wrap;
        gap: 16px;
        padding: 16px;
    }

    .nav-left {
        order: 1;
        flex: 1;
    }

    .nav-right {
        order: 2;
        flex: 1;
    }

    .nav-center {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
    }

    .search-pill {
        max-width: none;
    }
}

.sub-header {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 24px;
    gap: 48px;

    overflow-x: auto;
}

.sh-column {
    display: flex;
    flex-direction: column;
    min-width: max-content;
}

.sh-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    width: 100%;
}

.sh-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sh-link {
    font-size: 13px;
    color: var(--text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    width: fit-content;
}

.sh-link:hover {
    color: var(--text);
}

.sh-link.active {
    color: var(--text);
    font-weight: 500;
}

.sh-link.active::before {
    content: "●";
    font-size: 8px;
    margin-right: 6px;
    transform: translateY(-1px);
}

.sh-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 6px;
    background: var(--accent-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.sort-arrow {
    display: inline-block;
    width: 12px;
    text-align: center;
    margin-left: 4px;
    font-size: 10px;
}

.sh-hint {
    font-size: 11px;
    color: var(--border-light);
    margin-top: 4px;
}

.grid-slider-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sh-label {
    font-size: 13px;
    color: var(--text-muted);
}

#grid-slider-value {
    color: var(--text);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 2px;
    background: var(--border-light);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text);
    cursor: grab;
}

.main-content {
    padding: 24px;
}

/* Main Gallery Grid and Cards */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    grid-auto-rows: min-content;

    gap: 2px;

}

.card {
    position: relative;
    background: transparent;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: zoom-in;
}

.card__visual {
    position: relative;
    width: 100%;
}

.card__image {
    width: 100%;
    height: auto;

    aspect-ratio: 832 / 1216;

    object-fit: cover;
    display: block;
    background-color: var(--bg);
    transition: filter 0.3s ease;
}

.card:hover .card__image {
    filter: brightness(0.75);
}

.card__info {
    width: 100%;
    padding: 8px 4px 16px 4px;
    background: transparent;
    opacity: 1;
    transition: color 0.2s ease;
}

.card:hover .card__info {
    color: var(--text-muted);
}

.card__artist {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.works-count,
.uniqueness-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text);
    line-height: 1;
}

.uniqueness-rank {
    background: rgba(255, 255, 255, 0.9);
    color: var(--bg);
}

.gallery-grid.uniqueness-view .works-count {
    display: none;
}

.gallery-grid:not(.uniqueness-view) .uniqueness-rank {
    display: none;
}

.favorite-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    background-color: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0;

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='48px' viewBox='0 -960 960 960' width='48px' fill='%23ffffff'%3E%3Cpath d='m480-121-41-37q-105.77-97.12-174.88-167.56Q195-396 154-451.5T96.5-552Q80-597 80-643q0-90.15 60.5-150.58Q201-854 290-854q57 0 105.5 27t84.5 78q42-54 89-79.5T670-854q89 0 149.5 60.42Q880-733.15 880-643q0 46-16.5 91T806-451.5Q765-396 695.88-325.56 626.77-255.12 521-158l-41 37Zm0-79q101.24-93 166.62-159.5Q712-426 750.5-476t54-89.14q15.5-39.13 15.5-77.72 0-66.14-42-108.64T670.22-794q-51.52 0-95.37 31.5T504-674h-49q-26-56-69.85-88-43.85-32-95.37-32Q224-794 182-751.5t-42 108.82q0 38.68 15.5 78.18 15.5 39.5 54 90T314-358q66 66 166 158Zm0-297Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px;
    transition: all 0.2s ease;
    opacity: 0;
}

.card:hover .favorite-button,
.card:hover .info-button {
    opacity: 1;
}

.favorite-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.favorite-button.favorited {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.4);

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='48px' viewBox='0 -960 960 960' width='48px' fill='%23ffffff'%3E%3Cpath d='m480-120-58-52q-101-91-167-157T150-447.5Q111-500 95.5-544T80-634q0-94 63-157t157-63q52 0 99 22t81 62q34-40 81-62t99-22q94 0 157 63t63 157q0 46-15.5 90T810-447.5Q771-395 705-329T538-172l-58 52Z'/%3E%3C/svg%3E");
    border: none;
}

.favorite-button.remove-favorite {
    opacity: 1;
    font-size: 20px;
    font-weight: 300;
    line-height: 1;
    color: var(--text);
    background-color: rgba(0, 0, 0, 0.4);
    background-image: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.info-button {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    background-color: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
}

.card:hover .info-button {
    opacity: 1;
}

.info-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Loading Spinner and Toasts */
#loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

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

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

#toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--text);
    color: var(--bg);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 11000;
}

#toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    background: var(--accent-bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 50;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: var(--text);
    color: var(--bg);
}

.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Image Swipe/Zoom Overlay */
.swipe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 9999;
}

.swipe-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.swipe-header {
    position: absolute;
    top: 24px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 10001;
}

.swipe-favorites-counter {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-bg);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.swipe-artist-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: color 0.2s;
}

.swipe-artist-name.favorited-feedback {
    color: var(--text-muted);
}

.swipe-artist-name.copied-feedback {
    color: #4CAF50;

}

.swipe-close-btn {
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    color: var(--text-muted);
}

.swipe-close-btn:hover {
    color: var(--text);
}

.swipe-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.swipe-image {
    position: absolute;
    max-height: 80vh;
    max-width: 80vw;
    object-fit: contain;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
}

.swipe-image--current {
    transform: scale(1);
    opacity: 1;
    z-index: 10000;
}

.swipe-image--prev {
    transform: scale(0.85) translateX(-60vw);
    opacity: 0.3;
}

.swipe-image--next {
    transform: scale(0.85) translateX(60vw);
    opacity: 0.3;
}

.swipe-like-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    z-index: 10005;
    pointer-events: none;
}

.swipe-like-feedback.show {
    animation: quick-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes quick-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

.swipe-like-feedback .heart {
    width: 100px;
    height: 100px;
    background: var(--text);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z'/%3E%3C/svg%3E") no-repeat center;
}

.swipe-hint {
    position: absolute;
    bottom: 32px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.swipe-hint kbd {
    font-family: inherit;
    font-weight: 600;
    color: var(--text);
    padding: 0 4px;
}

/* Artist Details Page (SPA View) */
.details-page-header {
    margin-bottom: 24px;
}

.details-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
}

.details-back-btn svg {
    width: 16px;
    height: 16px;
}

.details-back-btn:hover {
    color: var(--text);
}

.details-hero {
    grid-column: 1 / span var(--detail-hero-cols, 2);
    grid-row: 1 / span var(--detail-hero-rows, 3);
    overflow: hidden;
    padding-right: 16px;

}

.details-hero .details-image {
    width: 100%;
    height: auto;
    aspect-ratio: 832 / 1216;
    object-fit: cover;
    display: block;
}

.details-info-panel {
    align-self: start;
    padding: 4px 0;
    max-width: 360px;
}

.details-info-panel h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
    color: var(--text);
}

.details-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.details-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 16px;
}

.detail-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: var(--radius);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
}

.detail-action-btn:hover {
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

#details-copy-btn,
#details-favorite-btn {
    grid-column: 1 / -1;
}

.detail-action-btn.primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.detail-action-btn.primary:hover {
    background: #e6e6e6;
    color: var(--bg);
    border-color: #e6e6e6;
}

.detail-action-btn svg {
    width: 14px;
    height: 14px;
}

.side-card.card {
    align-self: end;
}

.details-hero .details-image {
    padding-bottom: 16px;
}

@media (max-width: 600px) {
    .details-hero {
        grid-column: 1 / -1;
        grid-row: span 1;
    }

    .details-actions {
        grid-template-columns: 1fr;
    }
}