/* ============================================================
   GALLERY PUBLIC CONTAINER
   ============================================================ */

.gallery-public-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 20dvh);
    box-sizing: border-box;
    overflow-x: hidden;
}

@media (max-width: 480px) {
    .gallery-public-container {
        width: calc(100% - 1.5rem);
        padding: 1rem 0.75rem;
        margin: 1rem auto;
    }
    
    .gallery-header h1,
    .gallery-detail-header h1,
    .filter-header h1 {
        font-size: 2.205rem; /* Reduced from 3.5rem desktop */
    }
}

/* ============================================================
   HEADERS
   ============================================================ */

.gallery-header,
.gallery-detail-header,
.filter-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid var(--border-color);
    position: relative;
}

.gallery-header::after,
.gallery-detail-header::after,
.filter-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--highlight-color), transparent);
}

.gallery-header h1,
.gallery-detail-header h1,
.filter-header h1 {
    font-family: var(--main-font-family2);
    font-size: 4.41rem;
    color: var(--text-color2);
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 6px var(--shadow-color);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-color2) 0%, var(--highlight-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@supports not (-webkit-background-clip: text) {
    .gallery-header h1,
    .gallery-detail-header h1,
    .filter-header h1 {
        -webkit-text-fill-color: var(--text-color2);
        color: var(--text-color2);
    }
}

.gallery-subtitle,
.filter-subtitle {
    font-size: 1.575rem;
    color: var(--text-color3);
    margin: 0;
}

.gallery-description-detail {
    font-size: 1.4175rem;
    color: var(--text-color2);
    line-height: 1.6;
    margin: 1rem 0;
}

.gallery-meta-detail {
    font-size: 1.26rem;
    color: var(--text-color3);
    margin-top: 1rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-back-public,
.btn-nav-prev,
.btn-nav-next {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--background-color3) 0%, var(--background-color4) 100%);
    color: var(--text-color2);
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-back-public::before,
.btn-nav-prev::before,
.btn-nav-next::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;
}

.btn-back-public:hover::before,
.btn-nav-prev:hover::before,
.btn-nav-next:hover::before {
    left: 100%;
}

.btn-back-public:hover,
.btn-nav-prev:hover,
.btn-nav-next:hover {
    background: linear-gradient(135deg, var(--background-color4) 0%, var(--highlight-color) 100%);
    color: var(--text-color4);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 0 12px var(--glow-color);
    border-color: var(--highlight-color);
}

.btn-filter,
.btn-clear {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: var(--main-font-family);
}

.btn-filter {
    background-color: var(--highlight-color);
    color: var(--text-color4);
}

.btn-filter:hover {
    background-color: var(--text-color3);
}

.btn-clear {
    background-color: var(--background-color3);
    color: var(--text-color2);
    border: 1px solid var(--border-color);
}

.btn-clear:hover {
    background-color: var(--background-color4);
}

/* ============================================================
   GALLERY GRID PUBLIC
   ============================================================ */

.gallery-grid-public {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
}

.gallery-card-public {
    background-color: var(--hero-background-color);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    width: 100%;
    min-width: 25dvw;
    min-height: 35dvw;
    aspect-ratio: 25 / 35;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.gallery-card-public::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--highlight-color) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-card-public:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), 0 0 20px var(--glow-color);
    border-color: var(--highlight-color);
}

.gallery-card-public:hover::before {
    opacity: 0.08;
}

.gallery-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-card-image-public {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--background-color3) 0%, var(--background-color4) 100%);
}

.gallery-card-image-public::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.gallery-card-public:hover .gallery-card-image-public::after {
    opacity: 1;
}

.gallery-card-image-public img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-card-public:hover .gallery-card-image-public img {
    transform: scale(1.12);
}

.gallery-card-image-public.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color3);
    font-size: 1.26rem;
}

.gallery-card-content-public {
    padding: 1.75rem;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    flex-grow: 0;
}

.gallery-card-content-public h3 {
    font-family: var(--main-font-family2);
    font-size: 2.0475rem;
    color: var(--text-color2);
    margin: 0 0 0.75rem 0;
    font-weight: 700;
    transition: color 0.3s ease;
}

.gallery-card-public:hover .gallery-card-content-public h3 {
    color: var(--highlight-color);
}

.gallery-description-public {
    color: var(--text-color3);
    font-size: 1.18125rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.gallery-card-public:hover .gallery-description-public {
    color: var(--text-color2);
}

.gallery-card-meta-public {
    font-size: 1.1025rem;
    color: var(--text-color3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.image-count-public {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, var(--background-color3) 0%, var(--background-color4) 100%);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.gallery-card-public:hover .image-count-public {
    background: linear-gradient(135deg, var(--highlight-color) 0%, var(--highlight-color2) 100%);
    color: var(--text-color4);
    border-color: var(--highlight-color2);
    transform: scale(1.05);
}

/* ============================================================
   IMAGE GRID
   ============================================================ */

.gallery-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   GALLERY DETAIL PAGE SPECIFIC STYLING
   ============================================================ */

/* Desktop: 3 cards per row, 50% smaller cards */
.gallery-detail-page .gallery-images-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Reduce card size by 50% - original minmax is 280px, so 50% is 140px */
/* Ensure cards are exactly 50% smaller in both dimensions */
.gallery-detail-page .gallery-image-item {
    /* Cards will be 1/3 of available width (with 3 columns) */
    /* But we want to ensure they're 50% of original size */
    /* Original: minmax(280px, 1fr) - so 50% would be minmax(140px, 1fr) */
    /* With 3 columns, each card gets ~33% of width, which is smaller than original */
    border-radius: 8px;
    border-width: 1.5px;
    /* Maintain aspect ratio but ensure smaller overall size */
    min-width: 0; /* Allow cards to shrink below default minimum */
}

.gallery-detail-page .gallery-image-item:hover {
    transform: translateY(-4px) scale(1.01);
}

.gallery-detail-page .gallery-image-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-image-item {
    position: relative;
    background-color: var(--hero-background-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    aspect-ratio: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--highlight-color) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-image-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), 0 0 20px var(--glow-color);
    border-color: var(--highlight-color);
}

.gallery-image-item:hover::before {
    opacity: 0.1;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-image-item:hover .gallery-image {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4), transparent);
    padding: 1.5rem 1rem 1rem;
    color: white;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(10px);
    z-index: 2;
}

.gallery-image-item:hover .image-overlay {
    opacity: 1;
    transform: translateY(0);
}

.image-overlay h4 {
    font-family: var(--main-font-family2);
    font-size: 1.4175rem;
    margin: 0;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.image-tags-overlay {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag-small {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.945rem;
}

/* ============================================================
   TAG FILTER
   ============================================================ */

.tag-filter-form {
    background-color: var(--hero-background-color);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.tag-filter-section h2 {
    font-family: var(--main-font-family2);
    font-size: 2.205rem;
    color: var(--text-color2);
    margin-bottom: 1rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: 6px;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--background-color3);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tag-checkbox:hover {
    background-color: var(--background-color4);
}

.tag-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.tag-label {
    font-weight: 600;
    color: var(--text-color2);
}

.tag-category {
    font-size: 1.1025rem;
    color: var(--text-color3);
}

.filter-actions {
    display: flex;
    gap: 1rem;
}

.filter-results-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.filter-results-header h2 {
    font-family: var(--main-font-family2);
    font-size: 2.52rem;
    color: var(--text-color2);
    margin: 0 0 0.5rem 0;
}

.filter-results-header p {
    color: var(--text-color3);
    margin: 0;
}

.selected-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--highlight-color);
    color: var(--text-color4);
    border-radius: 4px;
    font-weight: 600;
    margin: 0 0.25rem;
}

/* ============================================================
   IMAGE DETAIL
   ============================================================ */

.image-detail-header {
    margin-bottom: 2rem;
}

.image-detail-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.image-detail-main {
    background-color: var(--hero-background-color);
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.image-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.image-display {
    text-align: center;
}

.image-full {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.image-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.image-info-section,
.image-tags-section,
.image-metadata-section {
    background-color: var(--hero-background-color);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.image-info-section h2,
.image-tags-section h2,
.image-metadata-section h2 {
    font-family: var(--main-font-family2);
    font-size: 1.89rem;
    color: var(--text-color2);
    margin: 0 0 1rem 0;
}

.info-item {
    margin-bottom: 1rem;
}

.info-item label {
    display: block;
    font-weight: 600;
    color: var(--text-color2);
    margin-bottom: 0.25rem;
}

.info-item p {
    color: var(--text-color3);
    margin: 0;
}

.info-item a {
    color: var(--highlight-color);
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--background-color3);
    color: var(--text-color2);
    border-radius: 6px;
    font-size: 1.1025rem;
    font-weight: 600;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(8px);
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    /* Ensure content doesn't exceed viewport */
    overflow: hidden;
}

.lightbox-image {
    max-width: calc(100vw - 2rem) !important;
    max-height: calc(100vh - 2rem) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: opacity 0.4s ease;
    /* Ensure image never exceeds container and fits properly */
    box-sizing: border-box;
    /* Prevent any scaling that would make image too large */
    display: block;
    margin: auto;
    /* Force image to respect both width and height constraints simultaneously */
    image-rendering: auto;
    /* Ensure natural dimensions don't override constraints */
    min-width: 0 !important;
    min-height: 0 !important;
    /* Explicitly prevent image from exceeding viewport */
    position: relative;
    z-index: 1;
}

.lightbox-image-loading {
    opacity: 0;
    transform: scale(0.99);
}

.lightbox-image-loaded {
    opacity: 1;
    transform: scale(1);
    /* Ensure no additional scaling that would make image too large */
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 2.52rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(10px);
    font-weight: 300;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.lightbox-close:active,
.lightbox-prev:active,
.lightbox-next:active {
    transform: scale(0.95);
}

.lightbox-close {
    top: 2rem;
    right: 2rem;
    font-size: 3.15rem;
    line-height: 1;
}

.lightbox-prev {
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-info {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    max-width: 80%;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
}

.lightbox-modal.active .lightbox-info {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.lightbox-info h3 {
    font-family: var(--main-font-family2);
    font-size: 1.575rem;
    margin: 0;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state-public {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-color3);
    background: linear-gradient(135deg, var(--hero-background-color) 0%, var(--background-color3) 100%);
    border-radius: 16px;
    border: 2px dashed var(--border-color);
    margin: 2rem 0;
}

.empty-state-public p {
    font-size: 1.7325rem;
    font-weight: 600;
    margin: 0;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination-public {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.page-link-public {
    padding: 0.75rem 1.5rem;
    background-color: var(--background-color3);
    color: var(--text-color2);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-link-public:hover {
    background-color: var(--background-color4);
    transform: translateY(-2px);
}

.page-info-public {
    color: var(--text-color2);
    font-weight: 600;
    font-size: 1.4175rem;
}

/* ============================================================
   UTILITY CLASSES FOR JAVASCRIPT
   ============================================================ */

body.lightbox-open {
    overflow: hidden;
}

.filter-grid-transition {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.filter-grid-transition.active {
    opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
    .gallery-public-container {
        padding: 1.5rem;
    }
    
    .gallery-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.25rem;
    }
    
    .lightbox-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        padding: 1.5rem;
    }
    
    .lightbox-image {
        max-width: calc(100vw - 3rem) !important;
        max-height: calc(100vh - 3rem) !important;
        width: auto !important;
        height: auto !important;
    }
}

/* ============================================================
   GALLERY DETAIL PAGE RESPONSIVE
   ============================================================ */

/* On mobile, gallery detail page already has 3 cards per row */
@media (max-width: 1024px) {
    .gallery-detail-page .gallery-images-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .gallery-detail-page .gallery-images-grid {
        gap: 0.5rem;
    }
}

/* ============================================================
   MOBILE: Galaxy S23 and similar (360px - 480px)
   ============================================================ */

@media (max-width: 480px) {
    .gallery-public-container {
        width: calc(100% - 1.5rem);
        padding: 1rem 0.75rem;
        margin: 1rem auto;
    }
    
    .gallery-header,
    .gallery-detail-header,
    .filter-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .gallery-header h1,
    .gallery-detail-header h1,
    .filter-header h1 {
        font-size: 2.205rem; /* Reduced from 3.5rem desktop - fixed size for mobile */
    }
    
    .gallery-subtitle,
    .filter-subtitle {
        font-size: 1.02375rem;
    }
    
    .gallery-images-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        margin-top: 1rem;
    }
    
    .gallery-image-item {
        aspect-ratio: 1;
        min-height: 0;
        border-radius: 8px;
        border-width: 1px;
    }
    
    .gallery-image-item:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .lightbox-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        padding: 0.5rem;
    }
    
    .lightbox-image {
        max-width: calc(100vw - 1rem) !important;
        max-height: calc(100vh - 1rem) !important;
        width: auto !important;
        height: auto !important;
    }
    
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
        font-size: 1.89rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.575rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
    
    .lightbox-info {
        bottom: 0.5rem;
        padding: 0.5rem 1rem;
        max-width: 90%;
        font-size: 1.02375rem;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .gallery-public-container {
        padding: 0.75rem;
    }
    
    .gallery-header,
    .gallery-detail-header,
    .filter-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .gallery-header h1,
    .gallery-detail-header h1,
    .filter-header h1 {
        font-size: 1.89rem;
    }
    
    .gallery-subtitle,
    .filter-subtitle {
        font-size: 1.1025rem;
    }
    
    .gallery-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    .gallery-grid-public {
        flex-direction: column;
        gap: 0.75rem;
    }

    .gallery-card-public {
        width: 25dvw !important;
        height: 35dvw !important;
        flex: 0 0 25dvw !important;
        margin-bottom: 0;
        border-radius: 8px;
    }

    .gallery-card-image-public {
        flex: 1;
        min-height: 0;
    }

    .gallery-card-content-public {
        padding: 1rem;
    }

    .gallery-card-content-public h3 {
        font-size: 1.4175rem;
        margin-bottom: 0.5rem;
    }

    .gallery-description-public {
        font-size: 1.02375rem;
        margin-bottom: 0.875rem;
    }

    .image-count-public {
        font-size: 0.945rem;
        padding: 0.25rem 0.625rem;
    }

    .image-detail-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tag-list {
        max-height: 200px;
    }
    
    .lightbox-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        padding: 0.5rem;
    }
    
    .lightbox-image {
        max-width: calc(100vw - 1rem) !important;
        max-height: calc(100vh - 1rem) !important;
        width: auto !important;
        height: auto !important;
    }
    
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 44px;
        height: 44px;
        font-size: 2.205rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 1.89rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
    
    .lightbox-info {
        bottom: 0.5rem;
        padding: 0.5rem 1rem;
        max-width: 95%;
        font-size: 1.1025rem;
    }

    .pagination-public {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .page-link-public {
        padding: 0.625rem 1rem;
        font-size: 1.1025rem;
        min-height: 44px;
    }

    .btn-back-public,
    .btn-nav-prev,
    .btn-nav-next {
        padding: 0.75rem 1.25rem;
        font-size: 1.1025rem;
        min-height: 44px;
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   GALLERY MAIN LAYOUT (Sidebar + Content)
   ============================================================ */

.gallery-main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 2rem;
}

.gallery-filter-sidebar {
    flex: 0 0 25%;
    max-width: 25%;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
}

.gallery-content-area {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   GALLERY FILTER PANEL
   ============================================================ */

.gallery-filter-panel {
    margin-bottom: 0;
}

/* ============================================================
   GALLERY FILTER SLIDE-OUT (MOBILE)
   ============================================================ */

/* Filter Toggle Button (Mobile Only) */
.gallery-filter-toggle-btn {
    display: none; /* Hidden by default, shown on mobile via media query */
    position: fixed;
    top: calc(var(--navbar-bottom, 0) + 1rem);
    left: 1rem;
    z-index: 999;
    width: 3.5rem;
    height: 3.5rem;
    min-width: 44px;
    min-height: 44px;
    background: linear-gradient(135deg, var(--highlight-color) 0%, var(--highlight-color2) 100%);
    color: var(--text-color4);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    transition: all 0.3s ease;
    font-size: 1.575rem;
}

.gallery-filter-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.gallery-filter-toggle-btn .filter-icon {
    font-size: 1.575rem;
}

.gallery-filter-toggle-btn .filter-toggle-text {
    font-size: 0.7875rem;
    font-weight: 600;
    line-height: 1;
}

/* Backdrop Overlay */
.gallery-filter-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-filter-backdrop.is-active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Slide-Out Panel Container */
.gallery-filter-slideout {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    max-width: 320px;
    height: 100vh;
    background: linear-gradient(135deg, var(--hero-background-color) 0%, var(--background-color3) 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s ease, width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.gallery-filter-slideout.is-open {
    width: 85%;
    max-width: 320px;
    transform: translateX(0);
}

/* Slide-Out Header */
.filter-slideout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--background-color3) 0%, var(--background-color4) 100%);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.filter-slideout-header h2 {
    font-family: var(--main-font-family2);
    font-size: 1.575rem;
    color: var(--text-color2);
    margin: 0;
    text-shadow: 1px 1px 2px var(--shadow-color);
}

.filter-slideout-close {
    background: none;
    border: none;
    color: var(--text-color2);
    font-size: 2.52rem;
    cursor: pointer;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.filter-slideout-close:hover {
    background-color: var(--background-color4);
    transform: scale(1.1);
}

/* Slide-Out Content */
.filter-slideout-content {
    padding: 1rem;
}

.filter-slideout-content .gallery-filter-panel {
    margin-bottom: 0;
}

.filter-slideout-content .filter-panel-card {
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

.filter-slideout-content .filter-panel-header {
    display: none; /* Hide the header since we have our own */
}

.filter-panel-card {
    background: linear-gradient(135deg, var(--hero-background-color) 0%, var(--background-color3) 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 8px var(--shadow-color), 0 1px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-panel-card:hover {
    box-shadow: 0 6px 20px var(--shadow-color), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, var(--background-color3) 0%, var(--background-color4) 100%);
    border-bottom: 2px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.filter-panel-title {
    font-family: var(--main-font-family2);
    font-size: 1.575rem;
    color: var(--text-color2);
    margin: 0;
    text-shadow: 1px 1px 2px var(--shadow-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-icon {
    font-size: 1.4175rem;
}

.filter-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color2);
    font-size: 1.4175rem;
    cursor: pointer;
    padding: 0.375rem;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
}

.filter-toggle-btn:hover {
    background-color: var(--background-color4);
    transform: scale(1.1);
}

.filter-toggle-btn.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.toggle-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.filter-panel-content {
    padding: 1.25rem;
    max-height: none;
    overflow: visible;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.filter-panel-content.collapsed {
    max-height: 0;
    padding: 0 1.25rem;
    overflow: hidden;
}

.gallery-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-section-label {
    font-weight: 600;
    color: var(--text-color2);
    font-size: 1.1025rem;
    margin-bottom: 0.125rem;
}

.filter-help-text {
    font-size: 0.945rem;
    color: var(--text-color3);
    font-style: italic;
    margin-top: -0.375rem;
}

.gallery-filter-form input[type="text"],
.gallery-filter-form input[type="search"] {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--main-font-family);
    font-size: 1.1025rem;
    background-color: var(--background-color4);
    color: var(--text-color2);
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-filter-form input[type="text"]:focus,
.gallery-filter-form input[type="search"]:focus {
    outline: none;
    border-color: var(--highlight-color);
    box-shadow: 0 0 0 3px rgba(46, 138, 37, 0.1);
}

/* Search Mode Toggle */
.search-mode-toggle {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.search-mode-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--background-color4);
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.search-mode-option:hover {
    border-color: var(--highlight-color);
    background-color: var(--background-color3);
}

.search-mode-option input[type="radio"] {
    cursor: pointer;
}

.search-mode-option input[type="radio"]:checked + .search-mode-label {
    color: var(--highlight-color);
    font-weight: 600;
}

.search-mode-label {
    color: var(--text-color2);
    font-size: 1.02375rem;
    transition: color 0.3s ease;
}

/* Tag Filtering */
.tag-filter-container {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.tag-search-box {
    margin-bottom: 0.375rem;
}

.tag-search-input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--main-font-family);
    font-size: 1.1025rem;
    background-color: var(--background-color4);
    color: var(--text-color2);
    box-sizing: border-box;
}

.tag-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--border-color2);
    border-radius: 6px;
    padding: 0.75rem;
    background-color: var(--background-color4);
}

.tag-category-group {
    margin-bottom: 1rem;
}

.tag-category-group:last-child {
    margin-bottom: 0;
}

.tag-category-group.hidden {
    display: none;
}

.tag-category-title {
    font-family: var(--main-font-family2);
    font-size: 1.18125rem;
    color: var(--text-color2);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border-color2);
    text-shadow: 1px 1px 2px var(--shadow-color);
}

.tag-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.tag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.tag-checkbox-label:hover {
    background-color: var(--background-color3);
}

.tag-checkbox-label.hidden {
    display: none;
}

.tag-checkbox {
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    accent-color: var(--highlight-color);
}

.tag-checkbox-text {
    color: var(--text-color2);
    font-size: 1.02375rem;
    user-select: none;
}

/* Active Filters */
.active-filters-section {
    padding-top: 0.75rem;
    border-top: 2px solid var(--border-color2);
}

.active-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, var(--highlight-color) 0%, var(--highlight-color2) 100%);
    color: var(--text-color4);
    border-radius: 16px;
    font-size: 0.945rem;
    font-weight: 600;
    border: 1px solid var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.filter-chip-remove {
    background: none;
    border: none;
    color: var(--text-color4);
    font-size: 1.26rem;
    cursor: pointer;
    padding: 0;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
    font-weight: bold;
}

.filter-chip-remove:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.2);
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 0.625rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--border-color2);
}

.btn-filter-apply,
.btn-filter-clear {
    flex: 1;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: var(--main-font-family);
    text-align: center;
    box-sizing: border-box;
    font-size: 1.1025rem;
}

.btn-filter-apply {
    background: linear-gradient(135deg, var(--highlight-color) 0%, var(--highlight-color2) 100%);
    color: var(--text-color4);
    border: 1px solid var(--primary-color);
}

.btn-filter-apply:hover {
    background: linear-gradient(135deg, var(--highlight-color2) 0%, var(--highlight-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.btn-filter-clear {
    background: linear-gradient(135deg, var(--background-color3) 0%, var(--background-color4) 100%);
    color: var(--text-color2);
    border: 2px solid var(--border-color);
}

.btn-filter-clear:hover {
    background: linear-gradient(135deg, var(--background-color4) 0%, var(--background-color3) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Filtered Results Header */
.filtered-results-header {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--background-color4) 0%, var(--hero-background-color) 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.filtered-results-header h2 {
    font-family: var(--main-font-family2);
    font-size: 1.89rem;
    color: var(--text-color2);
    margin: 0 0 0.375rem 0;
    text-shadow: 1px 1px 2px var(--shadow-color);
}

.results-count-text {
    color: var(--text-color3);
    font-size: 1.18125rem;
    margin: 0;
}

/* Gallery Name Badge in Filtered Results */
.gallery-name-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 12px;
    font-size: 0.945rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.image-gallery-info {
    margin-top: 0.5rem;
}

/* Desktop: Keep sidebar visible */
@media (min-width: 1025px) {
    .gallery-filter-toggle-btn {
        display: none !important;
    }
    
    .gallery-filter-backdrop {
        display: none !important;
    }
    
    .gallery-filter-slideout {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        transform: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        display: block !important;
    }
    
    .gallery-filter-slideout .filter-slideout-header {
        display: none !important;
    }
    
    .gallery-filter-slideout .filter-slideout-content {
        padding: 0 !important;
    }
    
    .gallery-filter-sidebar {
        display: block;
    }
}

/* ============================================================
   RESPONSIVE: Galaxy S23 and similar (360px - 480px)
   ============================================================ */

@media (max-width: 1024px) {
    .gallery-filter-toggle-btn {
        display: flex !important;
    }
    
    .gallery-filter-slideout {
        position: fixed !important;
        width: 0 !important;
        max-width: 320px !important;
        height: 100vh !important;
        transform: translateX(-100%) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: block !important;
    }
    
    .gallery-filter-slideout.is-open {
        width: 85% !important;
        max-width: 320px !important;
        transform: translateX(0) !important;
    }
    
    .gallery-filter-slideout .filter-slideout-header {
        display: flex !important;
    }
    
    .gallery-filter-slideout .filter-slideout-content {
        padding: 1rem !important;
    }
    
    .gallery-filter-sidebar {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .gallery-main-layout {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }

    .gallery-filter-sidebar {
        flex: 1;
        max-width: 100%;
        position: static;
    }

    .filter-panel-card {
        border-radius: 6px;
    }

    .filter-panel-header {
        padding: 0.625rem 0.75rem;
    }

    .filter-panel-title {
        font-size: 1.26rem;
        gap: 0.375rem;
    }

    .filter-icon {
        font-size: 1.26rem;
    }

    .filter-toggle-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1.26rem;
        padding: 0.25rem;
    }

    .filter-panel-content {
        padding: 0.75rem;
    }

    .gallery-filter-form {
        gap: 0.75rem;
    }

    .filter-section {
        gap: 0.375rem;
    }

    .filter-section-label {
        font-size: 1.02375rem;
    }

    .filter-help-text {
        font-size: 0.86625rem;
    }

    .gallery-filter-form input[type="text"],
    .gallery-filter-form input[type="search"] {
        padding: 0.5rem 0.5625rem;
        font-size: 20.16px; /* Prevent iOS zoom */
        border-radius: 4px;
    }

    .search-mode-toggle {
        flex-direction: column;
        gap: 0.375rem;
    }

    .search-mode-option {
        min-width: 100%;
        padding: 0.375rem 0.625rem;
        gap: 0.25rem;
    }

    .search-mode-label {
        font-size: 0.945rem;
    }

    .tag-filter-container {
        gap: 0.5rem;
    }

    .tag-search-input {
        padding: 0.5rem 0.5625rem;
        font-size: 20.16px; /* Prevent iOS zoom */
        border-radius: 4px;
    }

    .tag-list-container {
        max-height: 200px;
        padding: 0.625rem;
    }

    .tag-category-title {
        font-size: 1.1025rem;
        margin-bottom: 0.375rem;
        padding-bottom: 0.25rem;
    }

    .tag-checkbox-group {
        gap: 0.25rem;
    }

    .tag-checkbox-label {
        padding: 0.25rem;
        gap: 0.375rem;
    }

    .tag-checkbox {
        width: 0.9375rem;
        height: 0.9375rem;
    }

    .tag-checkbox-text {
        font-size: 0.945rem;
    }

    .active-filters-section {
        padding-top: 0.625rem;
    }

    .active-filters-chips {
        gap: 0.375rem;
    }

    .filter-chip {
        padding: 0.25rem 0.625rem;
        font-size: 0.86625rem;
    }

    .filter-chip-remove {
        width: 1.125rem;
        height: 1.125rem;
        font-size: 1.1025rem;
    }

    .filter-actions {
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 0.625rem;
    }

    .btn-filter-apply,
    .btn-filter-clear {
        width: 100%;
        padding: 0.625rem 0.875rem;
        font-size: 1.1025rem;
        min-height: 44px;
    }

    .filtered-results-header {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }

    .filtered-results-header h2 {
        font-size: 1.575rem;
    }

    .results-count-text {
        font-size: 1.1025rem;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .filter-panel-header {
        padding: 0.75rem 1rem;
    }

    .filter-panel-content {
        padding: 1rem;
    }

    .filter-panel-title {
        font-size: 1.4175rem;
    }

    .search-mode-toggle {
        flex-direction: column;
    }

    .search-mode-option {
        min-width: 100%;
    }

    .tag-list-container {
        max-height: 250px;
    }

    .filter-actions {
        flex-direction: column;
    }

    .btn-filter-apply,
    .btn-filter-clear {
        width: 100%;
    }
}

/* ============================================================
   LOADING INDICATORS AND AJAX FILTERING
   ============================================================ */

.gallery-loading-indicator,
.load-more-indicator {
    text-align: center;
    padding: 2rem;
    margin: 2rem 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.gallery-loading-indicator p,
.load-more-indicator p {
    color: var(--text-color3);
    font-size: 1.134rem;
    margin: 0;
}

.load-more-trigger {
    height: 1px;
    width: 100%;
    margin: 2rem 0;
}

/* Smooth transitions for grid updates */
.gallery-images-grid {
    transition: opacity 0.3s ease;
}

.gallery-image-item {
    animation: fadeIn 0.3s ease-in;
}

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

/* Enhanced search input styling */
#gallerySearchInput {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.197rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.3s ease;
}

#gallerySearchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 99, 22, 0.1);
}

/* Clear button styling */
#clearFiltersBtn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-color2);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1.197rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#clearFiltersBtn:hover {
    background: var(--background-color3);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================================
   GALLERY FILTER AUTO-SUGGEST DROPDOWN
   ============================================================ */

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.gallery-suggestions-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--background-color4, #ffffff);
    border: 2px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px var(--shadow-color);
    margin-top: -2px;
    max-height: 300px;
    overflow-y: auto;
    box-sizing: border-box;
}

.gallery-suggestions-dropdown.active {
    display: block;
}

.suggestions-content {
    padding: 0.5rem 0;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--text-color2);
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid var(--border-color2);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--background-color3);
    color: var(--primary-color);
}

.suggestion-type {
    font-size: 1.26rem;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.suggestion-text {
    flex: 1;
    font-size: 1.197rem;
    color: var(--text-color2);
}

.suggestion-item:hover .suggestion-text,
.suggestion-item.active .suggestion-text {
    color: var(--primary-color);
    font-weight: 600;
}

.suggestion-text mark {
    background: var(--highlight-color, #2e8a25);
    color: white;
    font-weight: 600;
    padding: 0.1rem 0.2rem;
    border-radius: 0.2rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .gallery-suggestions-dropdown {
        max-height: 250px;
    }
    
    .suggestion-item {
        padding: 0.5rem 0.75rem;
    }
    
    .suggestion-text {
        font-size: 1.071rem;
    }
}
