/* ============================================
   TAGS STYLING
   =.global-tags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* ============================================
   TAGS STYLING
   ============================================ */

/* Global tag filter bar */
.global-tag-filter {
    background: rgba(45, 50, 45, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 30px 0 12px 0;
    margin-bottom: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Light mode variant for global tag filter */
body.light-mode .global-tag-filter {
    background: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Tag filter content layout - tags and search side by side */
.tag-filter-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    min-height: 40px; /* Ensure minimum height for alignment */
}

.tag-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tag-filter-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.8;
}

.filter-clear-all {
    display: inline-block;
    padding: 6px 14px; /* Match tag button padding */
    background: rgba(255, 255, 255, 0.15); /* Match show-more button background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color); /* Use CSS variable like other buttons */
    border-radius: 20px; /* Match tag button border radius */
    font-size: 0.85rem; /* Match tag button font size */
    font-weight: 500; /* Match show-more button font weight */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Match show-more button border */
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    margin-left: 8px; /* Keep consistent spacing with other buttons */
}

.filter-clear-all:hover {
    background: rgba(255, 255, 255, 0.25); /* Match show-more button hover */
    border-color: rgba(255, 255, 255, 0.35); /* Match show-more button hover */
    transform: translateY(-1px);
}

/* Tag filter footer */
.tag-filter-footer {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    padding-top: 0;
}

/* Tag search container */
.search-containers {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    /* Removed margin-top to align with tags */
}

/* Date filters */
.date-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.date-filter-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 8px 16px;
    color: var(--text-color);
    font-size: 0.85rem; /* Match search bars and map button */
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 120px;
    cursor: pointer;
}

.date-filter-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.date-filter-select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.date-filter-select option {
    background: var(--bg-color);
    color: var(--text-color);
    padding: 8px;
}

/* Light mode variants for date filters */
body.light-mode .date-filter-select {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: var(--text-color);
}

body.light-mode .date-filter-select:hover {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.3);
}

body.light-mode .date-filter-select:focus {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.photo-search-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tag-search-container {
    position: relative;
    max-width: 250px;
    min-width: 200px;
    flex-shrink: 0;
}

.photo-search-container {
    position: relative;
    max-width: 450px;
    min-width: 350px;
    flex-shrink: 0;
}

#tag-search,
.photo-search-input {
    width: 100%;
    padding: 8px 35px 8px 40px; /* Match date filter buttons (8px top/bottom) */
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: var(--text-color);
    font-size: 0.85rem; /* Match tag button font size */
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: auto; /* Let padding determine height to match tags */
}

#tag-search::placeholder,
.photo-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#tag-search:focus,
.photo-search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.search-icon,
.tag-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.6;
    font-size: 0.9rem;
    pointer-events: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-search-clear {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.photo-search-clear {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.global-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-items: center; /* Center align tags vertically */
    flex: 1;
    min-width: 0;
    min-height: 40px; /* Match the parent min-height */
}

.global-tag {
    font-size: 0.85rem;
    padding: 6px 14px;
}

/* Gallery tags container */
.gallery-tags {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* Base gallery tag styling */
.gallery-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color);
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 400;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.gallery-tag:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.gallery-tag:active {
    transform: translateY(0);
}

.gallery-tag.tag-selected {
    background: rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.gallery-tag.tag-selected:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
}

/* Tag color variations */
.gallery-tag.tag-green {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(56, 142, 60, 0.3));
    border-color: rgba(76, 175, 80, 0.4);
}

.gallery-tag.tag-green:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.5), rgba(56, 142, 60, 0.5));
    border-color: rgba(76, 175, 80, 0.6);
}

.gallery-tag.tag-blue {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.3), rgba(25, 118, 210, 0.3));
    border-color: rgba(33, 150, 243, 0.4);
}

.gallery-tag.tag-blue:hover {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.5), rgba(25, 118, 210, 0.5));
    border-color: rgba(33, 150, 243, 0.6);
}

.gallery-tag.tag-orange {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.3), rgba(251, 140, 0, 0.3));
    border-color: rgba(255, 152, 0, 0.4);
}

.gallery-tag.tag-orange:hover {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.5), rgba(251, 140, 0, 0.5));
    border-color: rgba(255, 152, 0, 0.6);
}

.gallery-tag.tag-yellow {
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.3), rgba(251, 192, 45, 0.3));
    border-color: rgba(255, 235, 59, 0.4);
    color: #333;
}

.gallery-tag.tag-yellow:hover {
    background: linear-gradient(135deg, rgba(255, 235, 59, 0.5), rgba(251, 192, 45, 0.5));
    border-color: rgba(255, 235, 59, 0.6);
}

.gallery-tag.tag-pink {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.3), rgba(194, 24, 91, 0.3));
    border-color: rgba(233, 30, 99, 0.4);
}

.gallery-tag.tag-pink:hover {
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.5), rgba(194, 24, 91, 0.5));
    border-color: rgba(233, 30, 99, 0.6);
}

.gallery-tag.tag-red {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.3), rgba(211, 47, 47, 0.3));
    border-color: rgba(244, 67, 54, 0.4);
}

.gallery-tag.tag-red:hover {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.5), rgba(211, 47, 47, 0.5));
    border-color: rgba(244, 67, 54, 0.6);
}

.gallery-tag.tag-purple {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.3), rgba(123, 31, 162, 0.3));
    border-color: rgba(156, 39, 176, 0.4);
}

.gallery-tag.tag-purple:hover {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.5), rgba(123, 31, 162, 0.5));
    border-color: rgba(156, 39, 176, 0.6);
}

.gallery-tag.tag-gray {
    background: linear-gradient(135deg, rgba(96, 125, 139, 0.3), rgba(69, 90, 100, 0.3));
    border-color: rgba(96, 125, 139, 0.4);
}

.gallery-tag.tag-gray:hover {
    background: linear-gradient(135deg, rgba(96, 125, 139, 0.5), rgba(69, 90, 100, 0.5));
    border-color: rgba(96, 125, 139, 0.6);
}

.gallery-tag.tag-default-dark {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.gallery-tag.tag-default-dark:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.gallery-tag.tag-default {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

.gallery-tag.tag-default:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000;
}

/* Polish flag colors - white and red */
.gallery-tag.tag-poland {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(220, 53, 69, 0.3));
    border-color: rgba(220, 53, 69, 0.5);
    color: #333;
    font-weight: 500;
}

.gallery-tag.tag-poland:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(220, 53, 69, 0.5));
    border-color: rgba(220, 53, 69, 0.7);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Spanish flag colors - red and yellow */
.gallery-tag.tag-spain {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.4), rgba(220, 53, 69, 0.3));
    border-color: rgba(255, 193, 7, 0.6);
    color: #333;
    font-weight: 500;
}

.gallery-tag.tag-spain:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.6), rgba(220, 53, 69, 0.5));
    border-color: rgba(255, 193, 7, 0.8);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

/* Portuguese flag colors - green and red */
.gallery-tag.tag-portugal {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(220, 53, 69, 0.3));
    border-color: rgba(76, 175, 80, 0.6);
    color: #333;
    font-weight: 500;
}

.gallery-tag.tag-portugal:hover {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.6), rgba(220, 53, 69, 0.5));
    border-color: rgba(76, 175, 80, 0.8);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

/* Filter controls (floating notification) */
.filter-controls {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.filter-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-clear {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Tag hiding functionality for desktop */
.global-tag.tag-hidden {
    display: none;
}

/* Tag hiding functionality for mobile - only applies on mobile screens */
@media (max-width: 768px) {
    .global-tag.tag-hidden-mobile {
        display: none;
    }
}

.show-more-tags {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    margin-left: 8px;
}

.show-more-tags:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

/* Light mode show more button */
body.light-mode .show-more-tags {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: var(--text-color);
}

body.light-mode .show-more-tags:hover {
    background: rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.3);
}

/* Responsive tag styling */
@media (max-width: 768px) {
    .global-tag-filter {
        padding: 15px 0;
        margin-bottom: 20px;
    }

    .tag-filter-content {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .tag-filter-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
    }

    .tag-filter-header h3 {
        font-size: 1rem;
    }

    .tag-search-container {
        max-width: 100%;
        min-width: auto;
    }

    #tag-search {
        font-size: 0.8rem; /* Match mobile tag font size */
        padding: 8px 35px 8px 15px; /* Keep consistent with desktop buttons */
    }

    .global-tags {
        gap: 8px;
        justify-content: center;
    }

    .global-tag {
        font-size: 0.8rem !important;
        padding: 5px 12px !important;
    }

    /* Mobile-specific adjustments for show-more button */
    .show-more-tags {
        font-size: 0.8rem !important;
        padding: 5px 12px !important;
        margin-left: 6px !important;
    }

    /* Mobile-specific adjustments for clear all button */
    .filter-clear-all {
        font-size: 0.8rem !important;
        padding: 5px 12px !important;
        margin-left: 6px !important;
    }
}

/* Dark mode tag styles - override default to use dark variant */
body:not(.light-mode) .gallery-tag.tag-default {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-color);
}

body:not(.light-mode) .gallery-tag.tag-default:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Light mode search styles */
.light-mode #tag-search,
.light-mode .photo-search-input {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

.light-mode #tag-search::placeholder,
.light-mode .photo-search-input::placeholder {
    color: #666;
    opacity: 0.8;
}

.light-mode #tag-search:focus,
.light-mode .photo-search-input:focus {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.light-mode .search-icon,
.light-mode .tag-search-icon {
    color: #666;
    opacity: 0.8;
}

.light-mode .photo-search-row {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .search-containers {
        flex-direction: column;
        gap: 10px;
        margin-top: 8px;
    }

    .photo-search-row {
        margin-top: 8px;
        flex-direction: column;
        gap: 12px;
    }

    .date-filters {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
        order: 1;
    }

    .date-filter-select {
        min-width: 140px;
        font-size: 0.85rem;
        padding: 7px 12px;
    }

    .photo-search-row {
        margin-top: 8px;
        flex-direction: column;
        gap: 12px;
    }

    .photo-search-container {
        max-width: 100%;
        min-width: 100%;
        width: 100%;
        order: 2;
    }

    .map-toggle-container-inline {
        width: 100%;
        justify-content: center;
        margin-top: 0;
        order: 3;
    }

    .inline-map-toggle-btn {
        width: 100%;
        justify-content: center;
        max-width: 200px;
    }

    .tag-search-container {
        max-width: 100%;
        min-width: 100%;
        width: 100%;
    }

    .photo-search-input,
    #tag-search {
        font-size: 0.85rem;
        padding: 8px 32px 8px 35px; /* Consistent 8px padding for all controls */
    }

    .search-icon,
    .tag-search-icon {
        left: 10px;
        font-size: 0.85rem;
    }
}

/* Dark mode "Clear All" button */
/* Light mode clear all button */
body.light-mode .filter-clear-all {
    background: rgba(0, 0, 0, 0.1); /* Match light mode show-more button */
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: var(--text-color);
}

body.light-mode .filter-clear-all:hover {
    background: rgba(0, 0, 0, 0.15); /* Match light mode show-more button hover */
    border-color: rgba(0, 0, 0, 0.3);
}

/* Light mode tag styles */
.light-mode .gallery-tag.tag-default {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.2);
    color: #333;
}

.light-mode .gallery-tag.tag-default:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000;
}

/* Use dark default for light mode when needed */
.light-mode .gallery-tag.tag-default-dark {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
    color: #333;
}

.light-mode .gallery-tag.tag-default-dark:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.3);
    color: #000;
}
