/**
 * File: /public_html/css/gallery.css
 * Version: 1.0.7
 * 
 * Changelog v1.0.7:
 * - Removed shuffle button styling
 * - Added header spacer for centered title
 * 
 * Styles for the visual gallery page.
 * Mobile-first design with swipe cards and desktop masonry grid.
 */

/* ============================================
   CSS Variables - Light Mode Default
   ============================================ */
:root {
    --gallery-primary: #6366f1;
    --gallery-primary-hover: #4f46e5;
    --gallery-like: #ef4444;
    --gallery-like-bg: rgba(239, 68, 68, 0.1);
    --gallery-skip: #6b7280;
    --gallery-skip-bg: rgba(107, 114, 128, 0.1);
    --gallery-bg: #f3f4f6;
    --gallery-card-bg: #ffffff;
    --gallery-text: #111827;
    --gallery-text-muted: #6b7280;
    --gallery-border: #e5e7eb;
    --gallery-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --gallery-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --gallery-radius: 12px;
    --gallery-radius-sm: 8px;
    --gallery-header-height: 56px;
    --gallery-filter-bar-height: 52px;
}

/* Dark mode support - match site's dark mode */
[data-theme="dark"] {
    --gallery-bg: #111827;
    --gallery-card-bg: #1f2937;
    --gallery-text: #f9fafb;
    --gallery-text-muted: #9ca3af;
    --gallery-border: #374151;
}

[data-theme="dark"] .filter-bar-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* ============================================
   Base Layout
   ============================================ */
.gallery-page {
    background: var(--gallery-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Gallery Header
   ============================================ */
.gallery-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--gallery-header-height);
    background: var(--gallery-card-bg);
    border-bottom: 1px solid var(--gallery-border);
    z-index: 100;
}

.gallery-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-shuffle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--gallery-border);
    border-radius: var(--gallery-radius-sm);
    color: var(--gallery-text);
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-shuffle-btn:hover {
    background: var(--gallery-bg);
}

.gallery-home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--gallery-border);
    border-radius: var(--gallery-radius-sm);
    color: var(--gallery-text);
    text-decoration: none;
    transition: all 0.2s;
}

.gallery-home-link:hover {
    background: var(--gallery-bg);
}

.gallery-header-spacer {
    width: 40px;
    height: 40px;
}

.gallery-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gallery-text);
    margin: 0;
}

.gallery-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--gallery-border);
    border-radius: var(--gallery-radius-sm);
    color: var(--gallery-text);
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-filter-toggle:hover {
    background: var(--gallery-bg);
}

/* ============================================
   Filter Panel
   ============================================ */
/* ============================================
   Filter Bar (visible on mobile, compact)
   ============================================ */
.gallery-filter-bar {
    position: fixed;
    top: var(--gallery-header-height);
    left: 0;
    right: 0;
    background: var(--gallery-card-bg);
    border-bottom: 1px solid var(--gallery-border);
    padding: 10px 12px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gallery-filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-bar-item {
    flex-shrink: 0;
}

.filter-bar-select {
    padding: 8px 12px;
    background: var(--gallery-bg);
    border: 1px solid var(--gallery-border);
    border-radius: 20px;
    color: var(--gallery-text);
    font-size: 0.8125rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.filter-bar-pills {
    display: flex;
    gap: 6px;
}

.filter-pill {
    padding: 8px 14px;
    background: var(--gallery-bg);
    border: 1px solid var(--gallery-border);
    border-radius: 20px;
    color: var(--gallery-text-muted);
    font-size: 0.8125rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-pill:hover {
    border-color: var(--gallery-primary);
    color: var(--gallery-primary);
}

.filter-pill.active {
    background: var(--gallery-primary);
    border-color: var(--gallery-primary);
    color: white;
}

.filter-pill input {
    display: none;
}

/* Hidden drawer panel (keeping for potential future use) */
.gallery-filter-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: var(--gallery-card-bg);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: var(--gallery-shadow-lg);
}

.gallery-filter-panel.open {
    right: 0;
}

.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--gallery-border);
}

.filter-panel-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gallery-text);
}

.filter-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--gallery-text-muted);
    cursor: pointer;
    border-radius: var(--gallery-radius-sm);
    transition: all 0.2s;
}

.filter-panel-close:hover {
    background: var(--gallery-bg);
    color: var(--gallery-text);
}

.filter-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gallery-text);
    margin-bottom: 8px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-options-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gallery-card-bg);
    border: 1px solid var(--gallery-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.filter-option:hover {
    border-color: var(--gallery-primary);
}

.filter-option input {
    display: none;
}

.filter-option span {
    color: var(--gallery-text-muted);
}

.filter-option input:checked + span {
    color: var(--gallery-primary);
    font-weight: 600;
}

.filter-option:has(input:checked) {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--gallery-primary);
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.875rem;
    border: 1px solid var(--gallery-border);
    border-radius: 20px;
    background: var(--gallery-card-bg);
    color: var(--gallery-text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--gallery-primary);
    outline: none;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gallery-text-muted);
}

.filter-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--gallery-primary);
}

.filter-shuffle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--gallery-card-bg);
    border: 1px solid var(--gallery-border);
    border-radius: 20px;
    color: var(--gallery-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-shuffle-btn:hover {
    border-color: var(--gallery-primary);
    color: var(--gallery-primary);
}

.filter-panel-footer {
    padding: 16px;
    border-top: 1px solid var(--gallery-border);
}

.filter-apply-btn {
    width: 100%;
    padding: 12px;
    background: var(--gallery-primary);
    color: white;
    border: none;
    border-radius: var(--gallery-radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-apply-btn:hover {
    background: var(--gallery-primary-hover);
}

.gallery-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.gallery-filter-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Main Content Area
   ============================================ */
.gallery-main {
    padding-top: calc(var(--gallery-header-height) + var(--gallery-filter-bar-height));
    min-height: 100vh;
    background: var(--gallery-bg);
}

/* Hide main site header on mobile for gallery page */
.gallery-page .site-header,
.gallery-page .header-container,
.gallery-page #site-header {
    display: none !important;
}

/* ============================================
   Stats Bar
   ============================================ */
.gallery-stats-bar {
    position: fixed;
    top: var(--gallery-header-height);
    left: 0;
    right: 0;
    height: var(--gallery-stats-height);
    background: var(--gallery-card-bg);
    border-bottom: 1px solid var(--gallery-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 90;
}

.gallery-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--gallery-text-muted);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-icon {
    font-size: 1rem;
}

.stat-value {
    font-weight: 600;
    color: var(--gallery-text);
}

.stat-divider {
    color: var(--gallery-border);
}

.view-liked-btn {
    padding: 6px 14px;
    background: transparent;
    color: var(--gallery-like);
    border: 1px solid var(--gallery-like);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.view-liked-btn:hover {
    background: var(--gallery-like);
    color: white;
}

/* ============================================
   Mobile: Swipe Container
   ============================================ */
.gallery-swipe-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    padding-bottom: 100px;
}

.swipe-hint {
    font-size: 0.8125rem;
    color: var(--gallery-text-muted);
    margin-bottom: 16px;
    text-align: center;
    opacity: 0.8;
}

.card-stack {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 480px;
}

.swipe-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--gallery-card-bg);
    border-radius: var(--gallery-radius);
    box-shadow: var(--gallery-shadow);
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.swipe-card:active {
    cursor: grabbing;
}

.swipe-card.dragging {
    transition: none;
}

.swipe-card.swiping-left {
    transform: translateX(-120%) rotate(-15deg);
    opacity: 0;
}

.swipe-card.swiping-right {
    transform: translateX(120%) rotate(15deg);
    opacity: 0;
}

.swipe-card-media {
    position: relative;
    width: 100%;
    height: 280px;
    background: var(--gallery-bg);
    overflow: hidden;
}

.swipe-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swipe-card-media .video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.swipe-card-media iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.swipe-card-info {
    padding: 16px;
}

.swipe-card-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gallery-text);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swipe-card-meta {
    font-size: 0.8125rem;
    color: var(--gallery-text-muted);
    margin-bottom: 8px;
}

.swipe-card-description {
    font-size: 0.875rem;
    color: var(--gallery-text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Swipe indicator overlays */
.swipe-card::before,
.swipe-card::after {
    content: '';
    position: absolute;
    top: 16px;
    padding: 8px 16px;
    border-radius: var(--gallery-radius-sm);
    font-weight: 700;
    font-size: 1.25rem;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    pointer-events: none;
}

.swipe-card::before {
    content: 'LIKE';
    right: 16px;
    background: var(--gallery-like-bg);
    color: var(--gallery-like);
    border: 2px solid var(--gallery-like);
}

.swipe-card::after {
    content: 'SKIP';
    left: 16px;
    background: var(--gallery-skip-bg);
    color: var(--gallery-skip);
    border: 2px solid var(--gallery-skip);
}

.swipe-card.drag-right::before {
    opacity: 1;
}

.swipe-card.drag-left::after {
    opacity: 1;
}

/* Swipe Action Buttons */
.swipe-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
}

.swipe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.swipe-btn-skip,
.swipe-btn-like {
    width: 56px;
    height: 56px;
}

.swipe-btn-skip {
    background: var(--gallery-skip-bg);
    color: var(--gallery-skip);
}

.swipe-btn-skip:hover {
    background: var(--gallery-skip);
    color: white;
    transform: scale(1.1);
}

.swipe-btn-like {
    background: var(--gallery-like-bg);
    color: var(--gallery-like);
}

.swipe-btn-like:hover {
    background: var(--gallery-like);
    color: white;
    transform: scale(1.1);
}

.swipe-btn-view {
    width: 48px;
    height: 48px;
    background: var(--gallery-bg);
    color: var(--gallery-primary);
    border: 1px solid var(--gallery-border);
}

.swipe-btn-view:hover {
    background: var(--gallery-primary);
    color: white;
    border-color: var(--gallery-primary);
}

/* ============================================
   Desktop: Masonry Grid
   ============================================ */
.gallery-grid-container {
    display: none;
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.grid-item {
    background: var(--gallery-card-bg);
    border-radius: var(--gallery-radius);
    overflow: hidden;
    box-shadow: var(--gallery-shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.grid-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--gallery-shadow-lg);
}

.grid-item-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--gallery-bg);
    overflow: hidden;
}

.grid-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.grid-item:hover .grid-item-media img {
    transform: scale(1.05);
}

.grid-item-media .video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.grid-item-info {
    padding: 12px;
}

.grid-item-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gallery-text);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-item-subtitle {
    font-size: 0.8125rem;
    color: var(--gallery-text-muted);
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.grid-item-meta {
    font-size: 0.75rem;
    color: var(--gallery-text-muted);
}

.gallery-load-more {
    text-align: center;
    padding: 24px 0;
}

.load-more-btn {
    padding: 12px 32px;
    background: var(--gallery-primary);
    color: white;
    border: none;
    border-radius: var(--gallery-radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: var(--gallery-primary-hover);
}

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

/* ============================================
   Empty State
   ============================================ */
.gallery-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.gallery-empty-state h2 {
    font-size: 1.25rem;
    color: var(--gallery-text);
    margin: 0 0 16px 0;
}

.reset-btn {
    padding: 12px 24px;
    background: var(--gallery-primary);
    color: white;
    border: none;
    border-radius: var(--gallery-radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: var(--gallery-primary-hover);
}

/* ============================================
   Loading State
   ============================================ */
.gallery-loading {
    display: none;
    justify-content: center;
    padding: 48px;
}

.gallery-loading.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gallery-border);
    border-top-color: var(--gallery-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Lightbox (Desktop)
   ============================================ */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox.open {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--gallery-card-bg);
    border-radius: var(--gallery-radius);
    overflow: hidden;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-media iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.lightbox-info {
    padding: 20px;
}

.lightbox-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gallery-text);
    margin: 0 0 4px 0;
}

.lightbox-meta {
    font-size: 0.875rem;
    color: var(--gallery-text-muted);
    margin-bottom: 12px;
}

.lightbox-description {
    font-size: 0.9375rem;
    color: var(--gallery-text);
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.lightbox-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lightbox-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--gallery-radius-sm);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.lightbox-btn-skip {
    background: var(--gallery-skip-bg);
    color: var(--gallery-skip);
}

.lightbox-btn-skip:hover {
    background: var(--gallery-skip);
    color: white;
}

.lightbox-btn-like {
    background: var(--gallery-like-bg);
    color: var(--gallery-like);
}

.lightbox-btn-like:hover {
    background: var(--gallery-like);
    color: white;
}

.lightbox-btn-view {
    background: var(--gallery-primary);
    color: white;
}

.lightbox-btn-view:hover {
    background: var(--gallery-primary-hover);
}

/* ============================================
   Liked Tools Modal
   ============================================ */
.gallery-liked-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.gallery-liked-modal.open {
    display: flex;
}

.liked-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.liked-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--gallery-card-bg);
    border-radius: var(--gallery-radius) var(--gallery-radius) 0 0;
    display: flex;
    flex-direction: column;
}

.liked-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--gallery-border);
}

.liked-modal-header h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gallery-text);
}

.liked-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--gallery-text-muted);
    cursor: pointer;
    border-radius: var(--gallery-radius-sm);
}

.liked-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.liked-tool-item {
    aspect-ratio: 1;
    background: var(--gallery-bg);
    border-radius: var(--gallery-radius-sm);
    overflow: hidden;
    position: relative;
}

.liked-tool-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.liked-tool-item .liked-tool-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    font-size: 0.6875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.liked-modal-footer {
    padding: 16px;
    border-top: 1px solid var(--gallery-border);
}

.liked-clear-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--gallery-like);
    color: var(--gallery-like);
    border-radius: var(--gallery-radius-sm);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.liked-clear-btn:hover {
    background: var(--gallery-like);
    color: white;
}

.liked-modal-empty {
    padding: 32px;
    text-align: center;
    color: var(--gallery-text-muted);
}

/* ============================================
   Desktop Responsive
   ============================================ */
@media (min-width: 768px) {
    /* On desktop, show main site header and hide gallery header/filter bar */
    .gallery-page .site-header,
    .gallery-page .header-container,
    .gallery-page #site-header {
        display: block !important;
    }
    
    .gallery-header {
        display: none;
    }
    
    .gallery-filter-bar {
        display: none;
    }
    
    .gallery-swipe-container {
        display: none;
    }
    
    .gallery-grid-container {
        display: block;
    }
    
    /* Show the desktop filter panel */
    .gallery-filter-panel {
        display: flex !important;
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        max-width: none;
        height: auto;
        flex-direction: row;
        background: var(--gallery-card-bg);
        border-bottom: 1px solid var(--gallery-border);
        box-shadow: none;
        padding: 16px;
        gap: 16px;
        transition: none;
    }
    
    .gallery-filter-panel,
    .gallery-filter-panel.open {
        right: auto;
    }
    
    .filter-panel-header,
    .filter-panel-footer {
        display: none;
    }
    
    .filter-panel-body {
        display: flex;
        align-items: center;
        gap: 20px;
        padding: 0;
        overflow: visible;
        max-width: 1400px;
        margin: 0 auto;
        width: 100%;
    }
    
    .filter-group {
        margin-bottom: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .filter-label {
        margin-bottom: 0;
        white-space: nowrap;
        font-weight: 500;
        color: var(--gallery-text);
    }
    
    .filter-options-row {
        flex-wrap: nowrap;
    }
    
    .filter-select {
        width: auto;
        min-width: 180px;
    }
    
    .filter-shuffle-btn {
        width: auto;
        padding: 8px 16px;
    }
    
    .gallery-filter-toggle {
        display: none;
    }
    
    .gallery-filter-overlay {
        display: none !important;
    }
    
    /* On desktop, stats bar and main content flow normally (no fixed positioning) */
    .gallery-main {
        padding-top: 0;
        background: var(--gallery-bg);
    }
    
    .gallery-stats-bar {
        position: relative;
        top: auto;
        background: var(--gallery-card-bg);
    }
    
    /* Lightbox adjustments */
    .lightbox-content {
        flex-direction: row;
        max-width: 1200px;
    }
    
    .lightbox-media {
        flex: 1;
        aspect-ratio: auto;
        min-height: 400px;
    }
    
    .lightbox-info {
        width: 320px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
    }
    
    .lightbox-description {
        flex: 1;
    }
    
    /* Liked modal on desktop */
    .gallery-liked-modal {
        align-items: center;
    }
    
    .liked-modal-content {
        border-radius: var(--gallery-radius);
        max-height: 70vh;
    }
    
    .liked-modal-body {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ============================================
   Utility
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}