/**
 * Gallery Styles
 */

/* Gallery Container */
.gallery-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color, #e6af2e);
}

/* Gallery Layout */
.gallery-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.gallery-sidebar {
    flex: 0 0 250px;
}

.gallery-content {
    flex: 1;
    min-width: 0; /* Fix for flexbox overflow */
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background-color: #1a1a1a;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.gallery-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

/* Image Info Overlay */
.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-info {
    opacity: 1;
}

.barber-info h3 {
    margin: 0 0 5px;
    font-size: 16px;
    color: var(--secondary-color, #ffffff);
}

.instagram-link {
    color: var(--primary-color, #e6af2e);
    text-decoration: none;
    font-size: 14px;
}

.instagram-link:hover {
    text-decoration: underline;
}

/* Tags */
.image-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
}

/* Filter Form */
.gallery-filter {
    background-color: #1a1a1a;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.gallery-filter h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-color, #e6af2e);
    font-size: 18px;
}

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

.filter-group h4 {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--secondary-color, #ffffff);
}

.filter-option {
    margin-bottom: 8px;
}

.filter-option label {
    margin-left: 8px;
    cursor: pointer;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.filter-apply {
    background-color: var(--primary-color, #e6af2e);
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.filter-reset {
    color: var(--primary-color, #e6af2e);
    text-decoration: none;
    padding: 8px 0;
}

/* Tag Search */
.tag-search-container {
    position: relative;
}

.tag-search-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.search-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.tag-search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.tag-search-input:focus {
    border-color: var(--primary-color, #e6af2e);
    box-shadow: 0 0 0 2px rgba(230, 175, 46, 0.3);
}

.search-icon {
    position: absolute;
    right: 15px;
    font-size: 18px;
    color: #999;
    pointer-events: none;
}

/* Toggle Switch */
.filter-mode-toggle {
    display: flex;
    margin: 12px 0;
    justify-content: flex-end;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle-label {
    margin-right: 10px;
    font-size: 14px;
    color: #999;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #444;
    border-radius: 20px;
    transition: .4s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color, #e6af2e);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* Advanced Search Panel */
.advanced-search-panel {
    background-color: #222;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 2px solid var(--primary-color, #e6af2e);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.search-instructions {
    color: #999;
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 10px;
    font-style: italic;
}

/* Remove duplicate focus style */

.tag-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background-color: #333;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    border: 1px solid #444;
    border-top: none;
}

.tag-search-dropdown.active {
    max-height: 300px;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    padding: 5px 0;
}

.tag-dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    transition: all 0.2s ease;
}

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

.tag-dropdown-item:hover,
.tag-dropdown-item.highlight {
    background-color: #444;
}

.tag-dropdown-item.already-selected {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #2a2a2a;
}

.dropdown-tag-name {
    font-weight: 500;
    font-size: 15px;
}

.dropdown-tag-category {
    font-size: 12px;
    color: var(--primary-color, #e6af2e);
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.selected-tag-pill {
    display: flex;
    align-items: center;
    background-color: #333;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 13px;
}

.tag-pill-text {
    margin-right: 5px;
}

.tag-pill-category {
    font-size: 11px;
    color: var(--primary-color, #e6af2e);
    margin-right: 5px;
}

.tag-pill-remove {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.tag-pill-remove:hover {
    color: #ff6b6b;
}

/* Pagination */
.gallery-pagination {
    margin-top: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination-link,
.pagination-next,
.pagination-prev {
    display: inline-block;
    padding: 8px 12px;
    background-color: #1a1a1a;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.pagination-link:hover,
.pagination-next:hover,
.pagination-prev:hover {
    background-color: var(--primary-color, #e6af2e);
    color: #000;
}

.pagination-link.current {
    background-color: var(--primary-color, #e6af2e);
    color: #000;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
    z-index: 1001;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.open .modal-container {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    display: flex;
    flex-direction: column;
}

.modal-image-container {
    width: 100%;
    max-height: 70vh;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.modal-info {
    padding: 20px;
    background-color: #000;
    color: #fff;
}

/* Empty Gallery */
.empty-gallery {
    text-align: center;
    padding: 50px 0;
}

.reset-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color, #e6af2e);
    text-decoration: none;
}

/* Load More Button */
.load-more {
    display: block;
    width: 200px;
    margin: 30px auto 0;
    padding: 10px 15px;
    background-color: var(--primary-color, #e6af2e);
    color: #000;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.load-more:hover {
    background-color: var(--primary-color-dark, #c99627);
}

.load-more.loading {
    opacity: 0.7;
    cursor: wait;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .gallery-layout {
        flex-direction: column;
    }
    
    .gallery-sidebar {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .gallery-item-info {
        opacity: 1;
    }
}