/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    /* Fallback custom property for mobile viewport height */
    --vh: 1vh;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 100%;
    margin: 0;
    background-color: white;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header Styles - Modern 2025 Design */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* Navbar (2025) */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin: 0;
    padding: 0 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 0;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.nav-toggle .bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
}

.nav-toggle .bar::before,
.nav-toggle .bar::after {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

.nav-toggle .bar::before { top: -6px; }
.nav-toggle .bar::after { top: 6px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    justify-content: center;
}

/* New login-language area (right side) */
.login-language {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 0;
    justify-content: flex-end;
}

.auth-container {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    overflow: visible !important;
}

.nav-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.nav-btn::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;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: rgba(255,255,255,0.3);
}

.nav-btn.active {
    background: rgba(255,255,255,0.95);
    color: #667eea;
    border-color: rgba(255,255,255,0.95);
    box-shadow: 0 4px 15px rgba(255,255,255,0.3);
    font-weight: 600;
}

.nav-btn.danger {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 0.9);
    color: white;
}

.nav-btn.danger:hover {
    background: rgba(239, 68, 68, 1);
    border-color: rgba(239, 68, 68, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* Modern Custom Language Dropdown */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.language-select {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 140px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.language-select::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.6s ease;
}

.language-select:hover::before {
    left: 100%;
}

.language-select:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.language-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.language-select:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.selected-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dropdown-arrow {
    transition: transform 0.25s ease;
    opacity: 0.8;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Modern Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999 !important;
    overflow: hidden;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.dropdown-option:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.dropdown-option:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-option:last-child {
    border-radius: 12px;
    padding: 0.75rem;
}

.dropdown-option .flag {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.dropdown-option .text {
    flex: 1;
}

/* Main Content */
main {
    padding: 0;
}

.view {
    display: none;
    height: 100%;
}

.view.active {
    display: block;
}

/* Map View */
#mapView {
    display: flex;
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px); /* Dynamic viewport height for mobile */
}

/* Full height layout for map view */
body.map-view {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
}

body.map-view .container {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
}

body.map-view main {
    flex: 1;
    overflow: hidden;
}

body.map-view .view {
    height: 100%;
}

body.map-view #mapView {
    height: 100%;
}

/* Details Page Main */
.details-main {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    background: #f8f9fa;
    padding: 0;
}

.map-container {
    flex: 1;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
}

/* Filters - 2025 Modern */
.filter-toggle {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 1100;
    display: none; /* desktop hidden */
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.9);
    color: #4f46e5;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.filter-toggle .filter-icon {
    width: 18px;
    height: 18px;
}

.sidebar#mapFilters {
    transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}

@media (max-width: 1100px) {
    /* Keep map dominant; filters slide up as a fixed bottom sheet that never covers header */
    .filters-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(2,6,23,0.45);
        backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        z-index: 1190;
    }

    .filters-backdrop.show { opacity: 1; visibility: visible; }

    .sidebar#mapFilters {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        margin: 0 auto;
        width: 100%;
        max-width: 100vw;
        max-height: 70vh;
        background: #ffffff;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        border: 1px solid #e5e7eb;
        box-shadow: 0 -12px 30px rgba(0,0,0,0.15);
        transform: translateY(100%);
        opacity: 0;
        z-index: 1201;
        overflow: hidden;
        display: grid;
        grid-template-rows: auto 1fr auto;
        padding: 0;
    }

    .sidebar#mapFilters.open {
        transform: translateY(0);
        opacity: 1;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .filters-sheet-header {
        position: sticky;
        top: 0;
        background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
        border-bottom: 1px solid #eef2f7;
        padding: 0.75rem 1rem;
        z-index: 2;
        cursor: pointer; /* make whole header feel draggable */
    }

    /* Dragging visual feedback */
    .sidebar#mapFilters.dragging {
        transition: none !important;
    }

    .sheet-handle {
        width: 42px;
        height: 4px;
        border-radius: 999px;
        background: #d1d5db;
        margin: 0 auto 8px auto;
        cursor: inherit; /* header defines pointer/drag affordance */
    }

    .filters-title {
        text-align: center;
        font-weight: 700;
        color: #111827;
        letter-spacing: -0.2px;
    }

    .filters-sheet-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0 0.5rem 0;
    }

    .sidebar#mapFilters .filter-section {
        padding: 1rem;
        margin: 0.75rem 1rem;
    }

    .filters-sheet-footer {
        position: sticky;
        bottom: 0;
        background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
        border-top: 1px solid #eef2f7;
        padding: 0.75rem 1rem;
        display: flex;
        justify-content: center;
        z-index: 2;
    }

    /* Prevent accidental bottom overscroll blank space on mobile */
    .filters-sheet-content,
    .sidebar#mapFilters {
        overscroll-behavior: contain;
    }

    .filter-toggle { display: inline-flex; }
}

/* Filter section modern visuals */
.filter-section h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.filter-section {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
}

.filter-section .search-filter-label {
    color: #374151;
}

.filter-section input[type="text"],
.filter-section input[type="number"],
.filter-section select {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.filter-section input[type="text"]:focus,
.filter-section input[type="number"]:focus,
.filter-section select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12);
}

.sidebar {
    width: 420px;
    min-width: 320px;
    max-width: 480px;
    background: white;
    border-left: 1px solid #ddd;
    padding: 1rem;
    overflow-y: auto;
}

.filter-section {
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-section > * {
    width: 100%;
    margin: 0;
}

.map-type-autocomplete-row,
.significance-filter-group,
.field-column {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
}

.filter-section h3 {
    color: #667eea;
}

.filter-section select,
.filter-section input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.monuments-list {
    max-height: 500px;
    overflow-y: auto;
}

.monument-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.monument-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.monument-item h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.monument-item p {
    color: #666;
    font-size: 0.9rem;
}

.monument-item .significance {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
}

/* Form Styles */
.form-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
}

.form-container h2 {
    color: #2c3e50;
    margin: 1.5rem 0;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form Sections */
.form-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.section-title {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f8f9fa;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-description {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-style: italic;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-group .autocomplete-suggestions {
}

.form-group .search-suggestions {
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #495057;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #dee2e6;
    background: white;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-group select::placeholder {
    color: #adb5bd;
    opacity: 1;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Container Styles */
.names-container,
.location-container,
.significance-container {
    display: grid;
    gap: 1.5rem;
}

.names-container {
    grid-template-columns: 1fr 1fr;
}

.location-container {
    grid-template-columns: 1fr;
}

.significance-container {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.significance-container {
    display: block;
}

.significance-container .form-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    width: 100%;
}

.significance-container .form-group label {
    min-width: 250px;
    margin-bottom: 0;
    flex-shrink: 0;
    font-weight: 600;
}

.significance-container .form-group select {
    flex: 1;
}

/* Location Input Groups */
.location-input-group {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.location-input-group input {
    flex: 1;
}

.select-location-btn {
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.select-location-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Map Container */
.map-container {
    overflow: hidden;
}

/* Add margin only to map containers in add/edit monument pages */
.form-container .map-container {
    margin-top: 8px;
}

/* Make the layer control dropdown wider and align text properly */
.leaflet-control-layers-expanded {
    min-width: 120px;
}

.leaflet-control-layers-base label {
    display: flex;
    align-items: center;
    min-width: 120px;
    white-space: nowrap;
    padding: 0;
}

.leaflet-control-layers-base input[type="radio"],
.leaflet-control-layers-base input[type="checkbox"] {
    margin: 0 4px 0 0;
    flex-shrink: 0;
    width: auto;
    min-width: auto;
}

.leaflet-control-layers-base span {
    margin-left: 0;
    flex: 1;
}

#miniMap {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.map-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-map-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-map-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Map Search Container */
.map-search-container {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.search-autocomplete-container {
    position: relative;
    flex: 1;
}

.map-search-input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.map-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-suggestion {
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.search-suggestion:hover {
    background: #f8f9fa;
}

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

.map-search-btn {
    padding: 0.75rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.map-search-btn:hover {
    background: #5a6fd8;
}

.map-save-btn {
    padding: 0.75rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.map-save-btn:hover {
    background: #218838;
}

/* Other Names Container */
.other-name-input {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.other-name-input input {
    flex: 1;
}

.remove-name-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-name-btn:hover {
    background: #c82333;
}

/* Add Buttons */
.add-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.form-group input[type="range"] {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.5rem 0;
}

.form-group input[type="range"]:focus {
    transform: none;
    box-shadow: none;
}

.form-group small {
    color: #6c757d;
    font-size: 0.9rem;
}

.field-help {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    font-style: italic;
    display: block;
    line-height: 1.4;
}

/* Date Form Styles */
.date-form-container {
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.date-type-selection {
    margin-bottom: 1.5rem;
}

.date-type-selection label {
    display: block;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

.date-type-selection select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    background: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.date-type-selection select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.date-input-container {
    margin-top: 1.5rem;
}

.date-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.date-form .date-prefix {
    font-weight: 600;
    color: #667eea;
    white-space: nowrap;
    font-size: 1rem;
}

.date-form input[type="text"] {
    flex: 1;
    min-width: 140px;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.date-form input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.date-form select {
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    padding: 0.75rem;
    background: white;
    min-width: 90px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.date-form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.significance-group {
    margin-bottom: 1.5rem;
}

.significance-group label {
    display: block;
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-weight: 600;
    font-size: 1rem;
}

.significance-group select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.significance-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

#linksContainer {
    margin-bottom: 1rem;
}

.link-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

.link-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.link-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

/* Image Upload Styles */
.images-container {
    margin-top: 1rem;
}

.image-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.image-upload-area.dragover {
    border-color: #667eea;
    background: #e8f0ff;
}

.upload-placeholder {
    color: #6c757d;
}

.upload-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-placeholder p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.upload-placeholder small {
    color: #adb5bd;
    font-size: 0.9rem;
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview {
    position: relative;
    border-radius: 12px;
    padding: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-preview .remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.image-preview .remove-image:hover {
    background: #dc3545;
}

.image-description-input {
    width: 100%;
    padding: 0.5rem !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    line-height: 1.6 !important;
    resize: none;
    background: #f8f9fa;
    color: #495057;
}

.image-description-input::placeholder {
    color: #adb5bd;
    opacity: 1;
}

/* Image Attribution Styles */
.image-section {
    margin-bottom: 2rem;
    border: 1px solid #e8ecf4;
    border-radius: 12px;
    padding: 1.5rem;
    background: #f8f9fa;
}

.image-section-title {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.image-section-desc {
    margin: 0 0 1rem 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
}

.all-images-preview {
    margin-top: 2rem;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0f2ff 0%, #e8f0ff 100%);
}

.combined-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.combined-image-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
    transition: transform 0.3s ease;
    cursor: move;
}

.combined-image-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.combined-image-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.combined-image-info {
    padding: 0.75rem;
}

.combined-image-source {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    text-align: center;
}

.source-owned {
    background: #d4edda;
    color: #155724;
}

.source-wikimedia {
    background: #d1ecf1;
    color: #0c5460;
}

.combined-image-attribution {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.combined-image-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-order-number {
    background: #667eea;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.remove-combined-image {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background 0.3s ease;
}

.remove-combined-image:hover {
    background: #c82333;
}

.image-source-selection {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.radio-option {
    flex: 1;
    min-width: 280px;
    cursor: pointer;
    border: 2px solid #e8ecf4;
    border-radius: 12px;
    padding: 1rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.radio-option:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    background: #667eea;
    border-color: #667eea;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    opacity: 1;
}

.radio-option input[type="radio"]:checked ~ .radio-content {
    color: #333;
}

.radio-option input[type="radio"]:checked {
    background: #f0f2ff;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    background: white;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.radio-content {
    flex: 1;
}

.radio-content strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    color: #333;
}

.radio-content small {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
    display: block;
}

/* Wikimedia Commons Styles */
.wikimedia-container {
    margin-top: 1rem;
}

.wikimedia-url-input {
    margin-bottom: 1rem;
}

.wikimedia-url-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.url-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.url-input-group input[type="url"] {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.url-input-group input[type="url"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-wikimedia-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-wikimedia-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.add-wikimedia-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

.wikimedia-url-input small {
    display: block;
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Responsive tightening for Add/Edit Monument forms */
@media (max-width: 768px) {
  .form-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: none;
  }
  /* Hide clear buttons on mobile */
  #clearCurrentLocationBtn,
  #clearOriginalLocationBtn {
    display: none !important;
  }
  .form-section {
    padding: 1rem;
    margin: 0 0 1rem 0;
    border-radius: 12px;
  }
  .form-row {
    flex-direction: column;
    gap: 1rem;
  }
  .names-container {
    grid-template-columns: 1fr;
  }
  .significance-container .form-group label {
    min-width: 0;
  }
  /* Wikimedia URL group: prevent overflow on narrow screens */
  .url-input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .url-input-group input[type="url"] {
    min-width: 0;
    width: 100%;
  }
  .add-wikimedia-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .form-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-width: none;
  }
}

.wikimedia-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.wikimedia-preview {
    border: 1px solid #e8ecf4;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.wikimedia-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wikimedia-preview img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f8f9fa;
}

.wikimedia-preview-content {
    padding: 1rem;
}

.wikimedia-preview-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.wikimedia-preview-attribution {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.wikimedia-preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-wikimedia {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.remove-wikimedia:hover {
    background: #c82333;
}

.wikimedia-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: #d4edda;
    color: #155724;
}

/* Image Attribution Display Styles */
.image-wrapper {
    position: relative;
    display: block;
    width: 100%;
    line-height: 0;
    font-size: 0;
}

.image-attribution-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 16px;
}

.image-attribution-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.info-icon {
    font-style: normal;
    font-size: 14px;
}

/* Attribution Modal Styles */
.attribution-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.attribution-modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.attribution-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.attribution-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-attribution-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-attribution-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.attribution-content {
    padding: 1.5rem;
}

/* Wikimedia page link button */
.wikimedia-page-link {
    margin: 1rem 0;
    text-align: center;
}

.wikimedia-link-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.wikimedia-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Wikimedia source link styling */
.wikimedia-source-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.wikimedia-source-link:hover {
    color: #5a6fd8;
    text-decoration: underline;
    transform: scale(1.05);
}

.attribution-source {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.source-icon {
    font-size: 1.5rem;
}

.source-text {
    font-weight: 600;
    color: #333;
}

.attribution-text {
    background: #f0f2ff;
    border: 1px solid #e8ecf4;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #333;
}

.attribution-note {
    border-top: 1px solid #e8ecf4;
    padding-top: 1rem;
}

.attribution-note small {
    color: #6c757d;
    line-height: 1.4;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.form-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    border-top: 1px solid #e8ecf4;
}

.form-actions button {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#submitBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#submitBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#cancelBtn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

#cancelBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Search View */
.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.search-container h2 {
    color: #667eea;
    margin-bottom: 2rem;
    text-align: center;
}

.search-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 0 !important;
    flex-wrap: wrap;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.search-form input[type="text"],
.search-form select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 500;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.search-form input[type="text"]:focus,
.search-form select:focus {
    outline: none;
    border-color: #667eea;
    background: linear-gradient(145deg, #ffffff, #f0f4ff);
    box-shadow: 
        0 4px 20px rgba(102, 126, 234, 0.15),
        0 0 0 4px rgba(102, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.search-form input[type="text"]:hover,
.search-form select:hover {
    border-color: #a3bffa;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.search-form input[type="range"] {
    flex: 1;
    min-width: 150px;
}

.search-form button {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#searchResults {
    background: white;
    border: 1.5px solid #e1e5e9;
    border-top: none;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.search-result-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.search-result-item:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.search-result-item h3 {
    color: #667eea;
    margin: 0 !important;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.search-result-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-result-row-1 {
    font-size: 1rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.1rem;
    gap: 0.75rem;
}

.search-result-row-1 .type,
.search-result-row-1 .location {
    margin: 0 !important;
}

.search-result-row-1 .type {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-block;
}

.search-result-row-1 .location {
    color: #667eea;
    font-size: 0.95rem;
    font-weight: 500;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.2rem 0.7rem;
    border: 1px solid #e9ecef;
    display: inline-block;
}

.search-result-row-2 {
    font-size: 0.98rem;
    color: #333;
    margin-bottom: 0.1rem;
}

.search-result-row-2 .significance {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-block;
    margin-left: 0 !important;
}

.search-result-row-3 {
    font-size: 0.93rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.1rem;
}

.search-result-row-3 .date {
    font-size: 0.93rem;
    color: #6c757d;
    font-style: italic;
    background: none;
    padding: 0;
    border-radius: 0;
    font-weight: 500;
}

.search-result-item .type {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.search-result-item .location {
    background: #f8f9fa;
    color: #667eea;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
    border: 1px solid #e9ecef;
}

.search-result-item .significance {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
    margin-left: 0.5rem;
}

.search-result-item p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.search-result-item .date {
    color: #6c757d;
    font-size: 0.8rem;
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.monument-detail {
    padding: 1rem 0;
}

.monument-detail h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

.monument-detail img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    padding: 0.75rem;
    margin: 1rem 0;
}

.monument-detail .detail-section {
    margin-bottom: 1.5rem;
}

.monument-detail .detail-section h3 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.monument-detail .detail-section p {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.monument-detail .links {
    margin-top: 1rem;
}

.monument-detail .links a {
    color: #667eea;
    text-decoration: none;
    margin-right: 1rem;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.monument-detail .links a:hover {
    text-decoration: underline;
}

.monument-detail .actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.monument-detail .actions button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #28a745;
    color: white;
}

.edit-btn:hover {
    background: #218838;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 1100px) {
    /* Mobile viewport fixes */
    body {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100); /* Fallback using custom property */
        height: 100dvh; /* Dynamic viewport height for mobile */
        overflow-x: hidden;
    }
    

    
    /* Center the three main navbar blocks in a row: brand | nav-toggle | login-language */

    .brand,
    .login-language {
        width: auto;
        display: flex;
        justify-content: center;
        flex: 0 0 auto;
    }

    .nav-toggle { display: inline-flex; }

    /* Ensure header is positioned for dropdown positioning */
    header { position: relative; }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, rgba(102,126,234,0.98) 0%, rgba(118,75,162,0.98) 100%);
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem 1rem 1rem;
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.25s ease;
        z-index: 1000;
    }

    .nav-links.open {
        max-height: 80vh;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .login-language {
        margin-left: 0;
        /* When placed inside nav-links on small screens */
    }

    .nav-links .login-language {
        justify-content: flex-start;
        gap: 0.75rem;
        padding-top: 0.25rem;
        border-top: 1px solid rgba(255,255,255,0.2);
        margin-top: 0.25rem;
    }

    body.map-view #mapView {
        flex-direction: column;
        height: 100%;
    }
    
    .sidebar {
        width: 100%;
        max-height: 300px;
    }
    
    .map-container {
        height: 50vh;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-form input,
    .search-form select {
        width: 100%;
    }
    
    #searchResults {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    nav {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
        text-align: center;
        margin: 0 auto;
    }
    
    .custom-dropdown {
        width: 100%;
        max-width: 300px;
    }
    
    .dropdown-menu {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #6c757d;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 12px;
    padding: 0.75rem;
    margin: 1rem 0;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 12px;
    padding: 0.75rem;
    margin: 1rem 0;
    border: 1px solid #c3e6cb;
}

/* Custom Leaflet Marker Styles */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

.custom-marker div {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.custom-marker:hover div {
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4));
    box-shadow: 0 6px 20px rgba(0,0,0,0.4) !important;
}

/* Custom Leaflet Popup Styles */
.leaflet-popup-content {
    margin: 0;
    padding: 0;
}

.popup-content {
    padding: 1rem;
}

.popup-content h3 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.popup-content p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.popup-content .significance {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: inline-block;
}

.popup-content .view-details {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.popup-content .view-details:hover {
    background: #218838;
}

/* Success Notification Styles */
.success-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(40, 167, 69, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    animation: slideInRight 0.3s ease-out;
    max-width: 400px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.success-notification .icon {
    font-size: 1.2rem;
    animation: bounce 0.6s ease-in-out;
}

.success-notification .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.success-notification .close-btn:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.success-notification.fade-out {
    animation: slideOutRight 0.3s ease-in;
}

/* Monument Details Page Styles */
.details-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.monument-detail-page {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    overflow: hidden;
}

.monument-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.monument-header h1 {
    margin-left: 1rem;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.other-names {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.other-names-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.other-names-list {
    font-size: 1rem;
    font-style: italic;
    font-weight: 300;
}

.monument-type-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    font-size: 1.1rem;
    border: 2px solid rgba(255,255,255,0.3);
}

.monument-image-container {
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.monument-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Styles for clickable Wikimedia images */
.image-wrapper a {
    display: block;
    border-radius: 12px 12px 0 0;
    line-height: 0;
    font-size: 0;
    cursor: pointer;
}

.image-wrapper a:hover .monument-image {
    opacity: 0.85;
    transition: opacity 0.2s ease;
    box-shadow: 0 6px 25px rgba(0,0,0,0.2);
}

.image-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.image-thumbnails {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.image-description {
    background: #e9ecef;
    color: #495057;
    border-radius: 0 0 12px 12px;
    padding: 0.75rem;
    font-size: 0.9rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.single-image-container .image-description {
    background: #e9ecef;
    color: #495057;
    border-radius: 0 0 12px 12px;
    padding: 0.75rem;
    min-height: auto;
    display: flex;
    align-items: center;
}

.monument-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

.info-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

/* Add side margins to info-cards that are outside the grid */
.monument-detail-page > .info-card {
    margin: 0 2rem 1.5rem 2rem;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.info-card h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #667eea;
}

/* Significance color coding - Auto-generated from colors.js */

.map-link {
    color: #667eea;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    border: 2px solid #667eea;
    transition: all 0.3s ease;
}

.map-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.map-link.secondary {
    background: #f8f9fa;
    color: #667eea;
    border: 1px solid #667eea;
    font-size: 0.9rem;
    font-weight: normal;
}

.map-link.secondary:hover {
    background: #e9ecef;
    color: #667eea;
    border-color: #adb5bd;
}

.description-section, .detail-section {
    padding: 2rem;
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.description-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.description-content {
    font-size: 0.9rem;
    line-height: 1.3;
    max-height: 500px;
    overflow-y: auto;
    padding: 0;
    position: relative;
    /* No box-shadow, just a gradient for scroll hint */
}

.description-content::after {
    content: '';
    display: block;
    position: sticky;
    left: 0;
    right: 0;
    bottom: 0;
    height: 36px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(0,0,0,0.10) 90%, rgba(0,0,0,0.18) 100%);
    z-index: 2;
    opacity: 1;
    transition: opacity 0.2s;
}

.description-content.at-bottom::after {
    opacity: 0;
}

.description-content p,
.description-content > div {
    color: #555;
    margin: 0 0 1.3em 0;
}

.description-content p:last-child,
.description-content > div:last-child {
    margin-bottom: 0;
}

/* Rich text styling for description content */
.description-content strong,
.description-content b {
    font-weight: 700;
    color: #333;
}

.description-content a {
    color: #007bff;
    text-decoration: underline;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.description-content a:hover {
    text-decoration: none;
}

.description-content a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Link context menu styles */
.link-context-menu {
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.5rem 0;
    min-width: 150px;
}

.context-menu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.context-menu-item:hover {
    background-color: #f8f9fa;
}

/* Toolbar layout */
.rich-text-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.toolbar-left {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Toolbar button base styles */
.toolbar-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #495057;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    white-space: nowrap;
    overflow: hidden;
    width: auto;
}

.toolbar-btn.name-color,
.toolbar-btn.date-color {
    font-size: 18px;
    width: auto;
}

.toolbar-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.toolbar-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

/* Color button specific styles */
.toolbar-btn.name-color {
    background: white;
    border: 2px solid #28a745;
    color: #28a745;
    position: relative;
    font-size: 18px;
}

.toolbar-btn.name-color:hover {
    background: #f8f9fa;
    border-color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.toolbar-btn.name-color.active {
    background: #28a745;
    color: white;
    border-color: #28a745;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.4);
}



.toolbar-btn.date-color {
    background: white;
    border: 2px solid #fd7e14;
    color: #fd7e14;
    position: relative;
    font-size: 18px;
}

.toolbar-btn.date-color:hover {
    background: #f8f9fa;
    border-color: #e17055;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(253, 126, 20, 0.3);
}

.toolbar-btn.date-color.active {
    background: #fd7e14;
    color: white;
    border-color: #fd7e14;
    box-shadow: 0 2px 4px rgba(253, 126, 20, 0.4);
}



.toolbar-btn.default-color {
    background: white;
    border: 2px solid #6c757d;
    color: #6c757d;
    position: relative;
    font-size: 18px;
}

.toolbar-btn.default-color:hover {
    background: #f8f9fa;
    border-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.toolbar-btn.default-color.active {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.4);
}



/* Reset button styling */
.toolbar-btn.reset {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.toolbar-btn.reset:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

/* Link Modal Styles - Modern 2025 Design */
.link-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease-out;
}

.link-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.link-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.link-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.link-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.link-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.link-modal-close:hover {
    background-color: #e9ecef;
    color: #495057;
}

.link-modal-body {
    padding: 2rem;
}

.link-modal-body .form-group {
    margin-bottom: 1.5rem;
}

.link-modal-body .form-group:last-child {
    margin-bottom: 0;
}

.link-modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.link-modal-body input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.link-modal-body input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.link-modal-body input::placeholder {
    color: #adb5bd;
}

.link-modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1rem 2rem 2rem 2rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    justify-content: flex-end;
}

.link-modal-footer button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.link-modal-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.link-modal-footer .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.link-modal-footer .btn-danger {
    background: #dc3545;
    color: white;
}

.link-modal-footer .btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.link-modal-footer .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.link-modal-footer .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive design for modal */
@media (max-width: 768px) {
    .link-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .link-modal-header {
        padding: 1rem 1.5rem 0.75rem 1.5rem;
    }
    
    .link-modal-body {
        padding: 1.5rem;
    }
    
    .link-modal-footer {
        padding: 0.75rem 1.5rem 1.5rem 1.5rem;
        flex-direction: column;
    }
    
    .link-modal-footer button {
        width: 100%;
    }
}

/* Color styling for rich text */
.description-content span[style*="color: #28a745"],
.description-content span[style*="color: rgb(40, 167, 69)"] {
    color: #28a745 !important;
}

.description-content span[style*="color: #fd7e14"],
.description-content span[style*="color: rgb(253, 126, 20)"] {
    color: #fd7e14 !important;
}

/* Lists styling */
.description-content ul,
.description-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.description-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.external-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem;
    text-decoration: none;
    color: #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.external-link:hover {
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.monument-actions {
    padding: 2rem;
    background: white;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.monument-actions .btn-group {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-danger, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.error-container {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.error-container h2 {
    color: #dc3545;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .details-main {
        padding: 0;
    }
    .details-container {
        padding: 0.75rem 0.5rem !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .monument-header h1 {
    margin-left: 1rem;
        font-size: 2rem;
    }
    
    .monument-info-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    /* Adjust margins for info-cards outside the grid on mobile */
    .monument-detail-page > .info-card {
        margin: 0 1rem 1rem 1rem;
    }
    
    .monument-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .monument-actions .btn-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-primary, .btn-danger, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    header h1 {
        margin: 0;
        font-size: 1.5rem;
    }
    
    nav {
        gap: 0.5rem;
        padding: 0 0.25rem;
    }
    
    .nav-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .language-select {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
        border-radius: 18px;
        min-width: initial;
    }
    
    .form-container {
        margin: 1rem;
        padding: 0;
    }
    
    /* Monument details mobile adjustments */
    .monument-header {
        padding: 1.25rem;
        text-align: center;
    }
    .monument-header h1 {
        font-size: 1.6rem;
        margin-left: 0;
    }
    .monument-image-container {
        padding: 1rem;
        min-height: 280px;
    }
    .monument-image {
        height: 240px;
    }
    .image-thumbnails .thumbnail {
        width: 64px;
        height: 64px;
    }
    .monument-info-grid {
        padding: 1rem;
        gap: 1rem;
    }
    .monument-detail-page > .info-card {
        margin: 0 0.75rem 0.75rem 0.75rem;
    }
    .info-card {
        padding: 1rem;
    }
    .description-section, .detail-section {
        padding: 1rem;
    }
    
    .form-container h2 {
        font-size: 2rem;
        margin-top: 1.25rem;
    }
    
    .form-section {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .names-container {
        grid-template-columns: 1fr;
    }
    
    .significance-container {
        grid-template-columns: 1fr;
    }

    .location-input-group {
        flex-direction: column;
    }

    .select-location-btn {
        width: 100%;
    }
    
    .date-type-selection select {
        min-width: auto;
        width: 100%;
    }
    
    .date-form {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .date-form input[type="text"],
    .date-form select {
        min-width: auto;
    }

    .image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .form-actions {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .form-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 1.5rem;
    }
    
    .form-container h2 {
        font-size: 1.5rem;
        margin-top: 1rem;
    }
    
    .date-form-container,
    .significance-group {
        padding: 1rem;
    }
}

/* Significance card styles */
.significance-card {
    grid-column: 1 / -1;
}

.significance-item.overall-significance {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.significance-item.overall-significance .significance-label {
    font-size: 1.6rem;
    font-weight: 700;
    color: rgb(51, 51, 51);
    flex: 1;
}

.significance-item.overall-significance .info-value {
    font-size: 1.6rem;
    font-weight: 700;
    flex: 0 0 auto;
    margin-left: 10px;
}

.significance-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.significance-item {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.significance-item > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.significance-label {
    font-weight: 600;
    color: #555;
    flex: 1;
}

.significance-item .info-value {
    flex: 0 0 auto;
    margin-left: 10px;
}

.significance-comment {
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #495057;
    font-style: italic;
    border-left: 3px solid #667eea;
    width: 100%;
    box-sizing: border-box;
}

/* External links fix */
.link-icon {
    margin-right: 8px !important;
}

.link-text {
    margin-left: 0 !important;
}

/* Button styles */
.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Additional responsive styles for significance card */
@media (max-width: 768px) {
    .significance-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .significance-item .info-value {
        margin-left: 0;
    }
}

/* Relationships card styles */
.relationships-card {
    border-left: 4px solid #667eea;
}

.relationship-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.relationship-item {
    display: flex;
    align-items: center;
}

.monument-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.monument-link:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.monument-icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* Iconify icon styles */
.iconify.monument-icon {
    font-size: 1.2rem;
    opacity: 0.7;
    vertical-align: middle;
}



.iconify {
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.monument-name {
    flex: 1;
    font-weight: 500;
}

.parent-link {
    border-left: 3px solid #28a745;
}

.child-link {
    border-left: 3px solid #17a2b8;
}

@media (max-width: 768px) {
    .relationship-items {
        gap: 0.5rem;
    }
    
    .monument-link {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }
    
    .monument-icon {
        font-size: 1rem;
    }
    
    .iconify.monument-icon {
        font-size: 1rem;
    }
    
    .monument-name {
        font-size: 0.9rem;
    }
}

/* Tooltip Styles */
.tooltip-trigger {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #667eea;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
    position: relative;
    vertical-align: middle;
}

.tooltip-trigger:hover {
    background-color: #5a67d8;
}

.tooltip {
    position: fixed;
    background-color: #333;
    color: white;
    padding: 15px;
    border-radius: 12px;
    padding: 0.75rem;
    font-size: 13px;
    line-height: 1.4;
    max-width: 500px;
    width: 450px;
    max-height: 400px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    user-select: none;
}

.tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}



.tooltip-content {
    margin: 0;
    max-height: 370px;
    overflow-y: auto;
    padding-right: 5px;
}

.tooltip-content::-webkit-scrollbar {
    width: 6px;
}

.tooltip-content::-webkit-scrollbar-track {
    background: #444;
    border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

.tooltip-content::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.tooltip-level {
    display: block;
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #555;
}

.tooltip-level:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.tooltip-level-number {
    font-weight: bold;
    color: #667eea;
    margin-right: 8px;
}

.tooltip-level-name {
    font-weight: bold;
    color: #fff;
    margin-right: 8px;
}

.tooltip-level-description {
    color: #ccc;
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
    .tooltip {
        max-width: 320px;
        width: 300px;
        font-size: 12px;
        padding: 12px;
        max-height: 300px;
    }
    
    .tooltip-content {
        max-height: 270px;
    }
    

}

@media (max-width: 480px) {
    .tooltip {
        max-width: 280px;
        width: 260px;
        max-height: 250px;
    }
    
    .tooltip-content {
        max-height: 220px;
    }
} 

.autocomplete-suggestions {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-top: 2px;
  top: 100%;
  left: 0;
}
.autocomplete-suggestions .suggestion {
  padding: 8px 12px;
  cursor: pointer;
}
.autocomplete-suggestions .suggestion:hover, .autocomplete-suggestions .suggestion.active {
  background: #f0f0f0;
}
.autocomplete-suggestions .no-suggestion {
  padding: 8px 12px;
  color: #888;
} 

/* Modern search icon for monument type autocomplete in search form */
.search-form #search_type_autocomplete {
    background: #f8f9fa url('data:image/svg+xml;utf8,<svg fill="%23667eea" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99a1 1 0 001.41-1.41l-4.99-5zm-6 0C8.01 14 6 11.99 6 9.5S8.01 5 10.5 5 15 7.01 15 9.5 12.99 14 10.5 14z"></path></svg>') no-repeat 12px center;
    padding-left: 44px;
    background-size: 20px 20px;
}

/* Vertically center the monument type input in the search form */
.search-form .form-group {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    position: relative;
}

.search-form .autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Significance filter group styling */
.significance-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

.significance-filter-group label {
    margin-bottom: 0;
    font-weight: bold;
    font-size: 1rem;
}

.significance-filter-group .compact-select {
    width: auto;
    min-width: 120px;
    max-width: 180px;
    padding-right: 2rem;
    font-size: 1rem;
}

/* Date filter group styling */
.date-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem !important;
    margin-bottom: 0;
}

.date-filter-group label {
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0;
}

.date-filter-group input[type="number"] {
    width: 220px;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    border: 2px solid #e1e5e9;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    appearance: textfield;
}

/* Specific styling for the Built Before Year input */
.date-filter-group #searchBuiltBeforeYear {
    width: 110px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-right: 0 !important;
    border-right: none !important;
    height: 44px !important;
    box-sizing: border-box !important;
    transform: none !important;
}

/* Prevent any transform effects on Built Before Year input */
.date-filter-group #searchBuiltBeforeYear:focus,
.date-filter-group #searchBuiltBeforeYear:active,
.date-filter-group #searchBuiltBeforeYear:hover {
    transform: none !important;
}

/* Specific styling for the Built Before Era select */
.date-filter-group #searchBuiltBeforeEra {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    margin-left: 0 !important;
    border-left: none !important;
    height: 44px !important;
    box-sizing: border-box !important;
}

/* Remove gap from the date filter group containing Built before inputs */
.date-filter-group {
    gap: 0 !important;
}

/* Add small gap between Built before label and input */
.date-filter-group .search-filter-label {
    margin-right: 0.5rem !important;
}

/* Make searchQuery input wider */
#searchQuery {
    width: 18rem !important;
}

/* Remove ALL hover and focus effects for date filter group elements */
.date-filter-group input[type="number"]:focus,
.date-filter-group select:focus {
    outline: none;
}

.date-filter-group input[type="number"]:hover,
.date-filter-group select:hover {
    /* No hover effect */
}

/* Remove transitions from date filter elements */
.date-filter-group input[type="number"],
.date-filter-group select {
    transition: none !important;
}

.date-filter-group select {
    width: auto;
    min-width: 80px;
    max-width: 120px;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    border: 2px solid #e1e5e9;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

/* Remove ALL hover and focus effects for significance filter group elements */
.significance-filter-group input:focus,
.significance-filter-group select:focus {
    outline: none;
}

.significance-filter-group input:hover,
.significance-filter-group select:hover {
    /* No hover effect */
}

/* Remove transitions from significance filter elements */
.significance-filter-group input,
.significance-filter-group select {
    transition: none !important;
}

/* Specific overrides for searchSignificance and searchBuiltBeforeEra */
#searchSignificance:focus,
#searchSignificance:hover,
#searchBuiltBeforeEra:focus,
#searchBuiltBeforeEra:hover {
    outline: none !important;
    border-color: #e1e5e9 !important;
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    transform: none !important;
}

/* Override any compact-select hover effects */
.compact-select:focus,
.compact-select:hover {
    outline: none !important;
    border-color: #e1e5e9 !important;
    background: linear-gradient(145deg, #ffffff, #f8fafc) !important;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    transform: none !important;
}

/* Remove number input spinners for Webkit browsers */
.date-filter-group input[type="number"]::-webkit-outer-spin-button,
.date-filter-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove number input spinners for Firefox */
.date-filter-group input[type="number"] {
    -moz-appearance: textfield;
}

/* Search Filters Two-Column Layout */
.search-filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}
.search-filter-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (max-width: 700px) {
    .search-filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.2rem;
    gap: 1rem;
}
.search-row-inline {
    flex-direction: row;
    gap: 2rem;
}
@media (max-width: 700px) {
    .search-row,
    .search-row-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
}

.search-filter-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.search-form .search-filter-label {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

/* Modern 2025 Checkbox Styling */
.search-form input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    cursor: pointer;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.search-form input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.search-form input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.search-form input[type="checkbox"]:hover {
    border-color: #a3bffa;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.search-form input[type="checkbox"]:focus {
    outline: none;
    border-color: #e1e5e9;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.search-description-checkbox {
    margin-bottom: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
    white-space: nowrap;
}

.search-description-checkbox:hover {
    color: #667eea;
}

.search-places-checkbox {
    margin-bottom: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: color 0.3s ease;
    user-select: none;
    white-space: nowrap;
}

.search-places-checkbox:hover {
    color: #667eea;
}

.description-content p {
    margin-bottom: 1.5em;
}

/* Date input styling - consistent across all pages */
.date-div {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.date-div input[type="number"] {
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 6px 0 0 6px;
    background: #fff;
    padding: 8px 12px;
    font-size: 1em;
    outline: none;
    height: 38px;
    box-sizing: border-box;
    flex: unset;
    width: 120px;
    min-width: 0;
    transition: border-color 0.2s;
}

.date-div input[type="number"]:focus {
    border-color: #888;
    background: #f8f8f8;
}

.date-div select {
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: #fff;
    padding: 8px 12px;
    font-size: 1em;
    height: 38px;
    box-sizing: border-box;
    width: 90px !important;
    min-width: 0;
    outline: none;
    transition: border-color 0.2s;
    position: relative;
    z-index: 1;
    margin-bottom: 0 !important;
}

.date-div select:focus {
    border-color: #888;
    background: #f8f8f8;
}

/* Thin gray line between input and select */
.date-div::after {
    content: '';
    display: block;
    position: absolute;
    right: 90px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: #e0e0e0;
    z-index: 2;
}

/* Style for the date type select */
select#date_type {
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    padding: 8px 12px;
    font-size: 1em;
    height: 38px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 8px;
}
select#date_type:focus {
    border-color: #888;
    background: #f8f8f8;
}

/* Inline label for date fields */
.inline-label {
    display: flex;
    align-items: center;
    margin-right: 10px;
    font-weight: 500;
    height: 38px;
    line-height: 38px;
    white-space: nowrap;
}

.search-filter-label + .date-div {
    margin-left: 8px;
}

label[data-i18n='add.dateOfConstruction'] {
    font-weight: bold;
    margin-right: 8px;
    display: inline-block;
}

/* Map filter autocomplete styles (copied from Search) */
#map_type_autocomplete {
    font-size: 1rem;
    padding: 10px 12px;
    border-radius: 12px;
    padding: 0.75rem;
    border: 1px solid #bbb;
    background: #fff;
    color: #222;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    /* margin-bottom: 0.5rem; */
    transition: background 0.2s, box-shadow 0.2s;
}
#map_type_autocomplete:focus {
    background: #f7f7f9;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.08);
}
#mapTypeSuggestions.autocomplete-suggestions {
    position: absolute;
    z-index: 100;
    background: #fff;
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.06);
    margin-top: 2px;
    border: 1px solid #eee;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
#mapTypeSuggestions.autocomplete-suggestions .suggestion {
    padding: 10px 16px;
    font-size: 1rem;
    color: #222;
    border-bottom: 1px solid #f2f2f2;
    background: none;
    cursor: pointer;
    transition: background 0.15s;
}
#mapTypeSuggestions.autocomplete-suggestions .suggestion:last-child {
    border-bottom: none;
}
#mapTypeSuggestions.autocomplete-suggestions .suggestion:hover,
#mapTypeSuggestions.autocomplete-suggestions .suggestion.active {
    background: #f7f7f9;
}
#mapTypeSuggestions.autocomplete-suggestions .no-suggestion {
    padding: 10px 16px;
    color: #888;
    font-size: 1rem;
}

.map-type-autocomplete-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}
.map-type-autocomplete-row label {
    margin-bottom: 0;
    white-space: nowrap;
}
.map-type-autocomplete-row input[type="text"] {
    flex: 1 1 0;
    min-width: 0;
}

/* Hide number input arrows in .date-div for all browsers */
.date-div input[type="number"] {
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.date-div input[type="number"]::-webkit-outer-spin-button,
.date-div input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#mapApplyFiltersBtn {
    padding: 0.85rem 1.5rem;
    text-align: center;
    width: 100%;
    font-size: 1rem;
    display: block;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.location-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0.75rem;
    border-left: 3px solid #667eea;
}

.location-item strong {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
}

.location-item span {
    color: #667eea;
    font-size: 1rem;
    font-weight: 500;
}

.location-item a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

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

/* Search Form Layout */
.search-main-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0 !important;
}

.search-query-group {
    flex: 2;
    min-width: 300px;
    flex-direction: row !important;
    align-items: center;
}

.search-options-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.search-filters-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 0 !important;
}

.search-filter-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-filter-row:last-child {
    margin-bottom: 0;
}

.search-filter-row .form-group {
    flex: 1;
    min-width: 250px;
}

.search-submit-row {
    text-align: center;
}

.search-submit-row button {
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Autocomplete Containers */
.autocomplete-container {
    position: relative;
}

.autocomplete-container input {
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.autocomplete-suggestions .suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.autocomplete-suggestions .suggestion:hover {
    background: #f8f9fa;
}

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

.autocomplete-suggestions .no-suggestion {
    padding: 0.75rem 1rem;
    color: #6c757d;
    font-style: italic;
}

@media (max-width: 768px) {
    .search-main-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-query-group,
    .search-options-group {
        width: 100%;
        min-width: auto;
    }
    
    .search-filter-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-filter-row .form-group {
        min-width: auto;
    }

    /* Search page mobile adjustments */
    .search-container {
        padding: 0 !important;
        width: 100%;
    }

    .search-form {
        padding: 1rem;
    }

    .search-options-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .search-submit-row button {
        width: 100%;
    }

    #searchResults {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
}

.search-options-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    gap: 0.5rem;
}

.search-filters-section {
    width: 100%;
    box-sizing: border-box;
}

.search-form .form-group,
.search-form .significance-filter-group,
.search-form .date-filter-group {
    gap: 0.5rem;
    display: flex;
    flex-direction: column;
}

.search-form .form-group {
    flex-direction: row !important;
    gap: 1rem !important;
}

.search-form .form-group label,
.search-form .significance-filter-group label,
.search-form .date-filter-group label {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.date-div input[type="number"],
.date-div select {
    height: 44px !important;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    border: 2px solid #e1e5e9;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
}

.date-div input[type="number"] {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-right: 0 !important;
    border-right: none !important;
    width: 110px !important;
}

.date-div select {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    margin-left: 0 !important;
    border-left: none !important;
    width: 90px !important;
    min-width: 0;
}

.search-filters-grid-vertical {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.search-filter-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .search-filters-grid-vertical {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .search-filter-col {
        flex-direction: column;
        gap: 1rem;
    }
}

.search-filters-grid-align-left {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem 2rem;
    width: 100%;
    box-sizing: border-box;
    align-items: start;
}

@media (max-width: 900px) {
    .search-filters-grid-align-left {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        gap: 1.5rem;
    }
    .search-filters-grid-align-left .form-group {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}

.search-filters-grid-custom {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem 2rem;
    width: 100%;
    box-sizing: border-box;
    align-items: start;
    margin-bottom: 0 !important;
}

@media (max-width: 900px) {
    .search-filters-grid-custom {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        gap: 1.5rem;
    }
    .search-filters-grid-custom .form-group {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}

.clear-location-btn {
    background: #e1e5e9;
    color: #555;
    border: none;
    border-radius: 6px;
    padding: 0 0.75rem;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    white-space: nowrap;
    min-width: 36px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.clear-location-btn:hover {
    background: #d1d5db;
    color: #222;
    transform: none;
    box-shadow: none;
}

.clear-location-btn:active {
    background: #c0c4c9;
    color: #111;
}

.location-input-group {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.search-filters-section label,
.search-filters-grid-custom label {
    margin: 0 !important;
}

.date-filter-group .search-filter-label,
.search-filter-label {
    margin: 0 !important;
}

/* Force correct gap for .date-filter-group */
.date-filter-group {
    gap: 0.5rem !important;
}

/* Enhanced Drag and Drop Styles */
.combined-image-preview {
    cursor: grab;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    user-select: none;
    position: relative;
}

.combined-image-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.combined-image-preview:active {
    cursor: grabbing;
}

/* Dragging state */
.combined-image-preview.dragging {
    opacity: 0.5;
    transform: scale(0.95) rotate(2deg);
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #667eea;
    cursor: grabbing;
}

/* Drop target state */
.combined-image-preview.drop-target {
    border-color: rgba(102, 126, 234, 0.5);
    background-color: rgba(102, 126, 234, 0.05);
    animation: pulse-drop-target 1.5s infinite;
}

/* Active drop zone */
.combined-image-preview.drag-over {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Drag handle indicator */
.combined-image-preview::before {
    content: "⋮⋮";
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    font-family: monospace;
    letter-spacing: -2px;
}

.combined-image-preview:hover::before {
    opacity: 1;
}

.combined-image-preview.dragging::before {
    opacity: 0;
}

/* Pulse animation for drop targets */
@keyframes pulse-drop-target {
    0%, 100% {
        border-color: rgba(102, 126, 234, 0.5);
        background-color: rgba(102, 126, 234, 0.05);
    }
    50% {
        border-color: rgba(102, 126, 234, 0.8);
        background-color: rgba(102, 126, 234, 0.1);
    }
}

/* Improve image preview appearance */
.combined-image-preview img {
    transition: transform 0.2s ease;
    border-radius: 8px;
}

.combined-image-preview:hover img {
    transform: scale(1.02);
}

.combined-image-preview.dragging img {
    transform: scale(0.95);
}

/* Image order number styling */
.image-order-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.combined-image-preview:hover .image-order-number {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Remove button enhancement */
.remove-combined-image {
    transition: all 0.2s ease;
    opacity: 0.7;
}

.remove-combined-image:hover {
    opacity: 1;
    transform: scale(1.1);
    background-color: #dc3545;
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Smooth transitions for all combined image interactions */
.combined-image-info {
    transition: all 0.2s ease;
}

.combined-image-preview:hover .combined-image-info {
    background-color: rgba(255, 255, 255, 0.95);
}

/* Location details styling */
.location-details {
    margin-top: 0.5rem;
}

.location-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    font-size: 0.9rem;
    line-height: 1.4;
}

.location-item:last-child {
    margin-bottom: 0;
}

.location-item strong {
    color: #495057;
    font-weight: 600;
}

/* Location info styling - distinctive and aesthetic */
.location-info {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 1rem 0;
    padding: 0;
    letter-spacing: normal;
    position: relative;
    line-height: 1.4;
}

.location-info::before {
    content: "📍";
    margin-right: 0.5rem;
    font-size: 1rem;
    vertical-align: middle;
}