/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    height: 100%;
    overflow: hidden; /* Prevent scroll during loading */
}

html.ready {
    overflow: auto; /* Allow scroll after ready */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    transition: background-color 0.3s, color 0.3s;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden; /* Prevent scroll during loading */
    height: 100%;
}

body.ready {
    overflow: auto; /* Allow scroll after ready */
}

/* Loading Screen */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: var(--vh, 100vh); /* JavaScript fallback for iOS */
    height: 100dvh; /* Dynamic viewport height for iOS */
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.dark-theme .app-loader {
    background: #1a1a1a;
}

.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #4F46E5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.dark-theme .loader-spinner {
    border-color: #333;
    border-top-color: #4F46E5;
}

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

.loader-text {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.dark-theme .loader-text {
    color: #999;
}

/* Hide content until ready */
.app-content {
    transition: opacity 0.3s ease-in, visibility 0.3s ease-in;
}

.app-content.ready {
    visibility: visible !important;
    opacity: 1 !important;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

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

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s;
}

.dark-theme .header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.header-logo-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.header-logo-link:hover {
    opacity: 0.9;
}

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

.header-logo {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}


.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
    white-space: nowrap;
}

/* Content Layout */
.content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* View Mode Toggle */
.view-mode-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 8px;
    padding: 0.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.view-mode-map .view-mode-toggle {
    display: none;
}

.view-mode-list .view-mode-toggle {
    display: none;
}

.dark-theme .view-mode-toggle {
    background: #2a2a2a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.view-mode-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dark-theme .view-mode-btn {
    color: #aaa;
}

.view-mode-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.dark-theme .view-mode-btn:hover {
    background: #333;
    color: #fff;
}

.view-mode-btn.active {
    background: #4F46E5;
    color: white;
}

.dark-theme .view-mode-btn.active {
    background: #6366f1;
    color: white;
}

/* View Mode: Map */
.view-mode-map .header {
    display: none;
}

.view-mode-map .view-mode-toggle {
    display: none;
}

.view-mode-map .sidebar {
    display: none;
}

.view-mode-map .map-container {
    flex: 1;
    display: block;
    width: 100%;
    height: 100vh;
    height: var(--vh, 100vh); /* JavaScript fallback for iOS */
    height: 100dvh; /* Dynamic viewport height for iOS */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
    /* No transitions for layout changes */
    transition: none;
}

.view-mode-map #map {
    width: 100%;
    height: 100vh;
    height: var(--vh, 100vh); /* JavaScript fallback for iOS */
    height: 100dvh; /* Dynamic viewport height for iOS */
    min-height: 100vh;
    min-height: var(--vh, 100vh);
    min-height: 100dvh;
    max-height: 100vh;
    max-height: var(--vh, 100vh);
    max-height: 100dvh;
    /* No transitions for layout changes */
    transition: none;
}

.view-mode-map .results {
    display: none;
    /* No transitions for layout changes */
    transition: none;
}

.view-mode-map .container {
    height: 100vh;
    height: var(--vh, 100vh); /* JavaScript fallback for iOS */
    height: 100dvh; /* Dynamic viewport height for iOS */
    overflow: hidden;
    /* No transitions for layout changes */
    transition: none;
}

.view-mode-map .content {
    height: 100vh;
    height: var(--vh, 100vh); /* JavaScript fallback for iOS */
    height: 100dvh; /* Dynamic viewport height for iOS */
    /* No transitions for layout changes */
    transition: none;
}

/* View Mode: List */
.view-mode-list .header {
    display: none;
}

.view-mode-list .sidebar {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.view-mode-list .map-container {
    display: none;
}

.view-mode-list .results {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Allow flex shrinking */
}

/* Hide regular sidebar elements in list mode (overlay controls will replace them) */
.view-mode-list .search-section {
    display: none;
}

.view-mode-list .quick-filters {
    display: none;
}

.view-mode-list .filters {
    display: none;
}

/* Limit property card width in list mode to prevent image stretching */
.view-mode-list .property-card {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.view-mode-list .property-preview {
    max-width: 100%;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 400px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s, border-color 0.3s;
}

.dark-theme .sidebar {
    background: #1e1e1e;
    border-right-color: #333;
}

/* Search Section */
.search-section {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    transition: background-color 0.3s, border-color 0.3s;
}

.dark-theme .search-section {
    background: #252525;
    border-bottom-color: #333;
}

.search-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: white;
    color: #333;
}

.dark-theme .search-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

.dark-theme .search-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Quick Filters */
.quick-filters {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    transition: background-color 0.3s, border-color 0.3s;
}

.dark-theme .quick-filters {
    background: #252525;
    border-bottom-color: #333;
}

.quick-filters h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dark-theme .quick-filters h3 {
    color: #aaa;
}

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

.status-group-radio {
    margin-right: 0.5rem;
    cursor: pointer;
}

.status-group-radio + span {
    color: #333;
    font-size: 0.9rem;
}

.dark-theme .status-group-radio + span {
    color: #e0e0e0;
}

.reset-btn {
    align-self: flex-start;
    margin-top: 0.5rem;
}

.reset-btn:hover {
    color: #e74c3c !important;
    transform: scale(1.1);
}


/* Filters */
.filters {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    overflow-y: auto;
    max-height: 50vh;
    transition: border-color 0.3s;
}

.dark-theme .filters {
    border-bottom-color: #333;
}

.filters h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.dark-theme .filters h2 {
    color: #e0e0e0;
}

/* Collapsible Filter Sections */
.filter-section {
    margin-bottom: 0.8rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.dark-theme .filter-section {
    border-color: #444;
}

.filter-section summary {
    padding: 0.8rem 1rem;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    user-select: none;
    list-style: none;
    transition: background 0.2s;
}

.dark-theme .filter-section summary {
    background: #2a2a2a;
    color: #ccc;
}

.filter-section summary::-webkit-details-marker {
    display: none;
}

.filter-section summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s;
    font-size: 0.7rem;
}

.filter-section[open] summary::before {
    transform: rotate(90deg);
}

.filter-section summary:hover {
    background: #e8f4f8;
}

.dark-theme .filter-section summary:hover {
    background: #333;
}

.filter-section[open] summary {
    border-bottom: 1px solid #e0e0e0;
}

.dark-theme .filter-section[open] summary {
    border-bottom-color: #444;
}

.filter-group {
    margin: 1rem;
}

.filter-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 0.9rem;
}

.dark-theme .filter-group label {
    color: #ccc;
}

.filter-group input[type="number"],
.filter-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
    background: white;
    color: #333;
}

.dark-theme .filter-group input[type="number"],
.dark-theme .filter-group select {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

.filter-group input[type="number"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

.range-inputs {
    display: flex;
    gap: 0.5rem;
}

.range-inputs input {
    flex: 1;
}

.filter-group select[multiple] {
    height: auto;
    min-height: 100px;
}

.filter-group input[type="checkbox"] {
    margin-right: 0.5rem;
    width: auto;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.dark-theme .filter-actions {
    border-top-color: #333;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.7rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #ecf0f1;
    color: #333;
}

.dark-theme .btn-secondary {
    background: #3a3a3a;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #d5dbdb;
}

.dark-theme .btn-secondary:hover {
    background: #4a4a4a;
}

.btn-secondary:disabled {
    background: #f7f9fa;
    color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.dark-theme .btn-secondary:disabled {
    background: #2a2a2a;
    color: #666;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Results */
.results {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.results-header {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.3s, border-color 0.3s;
}

.dark-theme .results-header {
    background: #252525;
    border-bottom-color: #333;
}

.results-header span {
    font-weight: 500;
    color: #555;
}

.dark-theme .results-header span {
    color: #ccc;
}

.results-header select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    background: white;
    color: #333;
}

.dark-theme .results-header select {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: white;
    transition: background-color 0.3s;
}

.dark-theme .results-list {
    background: #1e1e1e;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.dark-theme .no-results {
    color: #666;
}

/* Property Card */
.property-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.dark-theme .property-card {
    background: #2a2a2a;
    border-color: #444;
}

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

.dark-theme .property-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.property-card.selected {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.property-preview-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.property-preview {
    width: 100%;
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: center;
    border-radius: 6px;
    display: block;
}

.property-card-favorite-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dark-theme .property-card-favorite-btn {
    background: rgba(42, 42, 42, 0.9);
}

.property-card-favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.dark-theme .property-card-favorite-btn:hover {
    background: rgba(42, 42, 42, 1);
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    gap: 1rem;
}

.property-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
    flex: 1;
}

.dark-theme .property-title {
    color: #e0e0e0;
}

.property-price {
    font-weight: 700;
    color: #27ae60;
    font-size: 1.1rem;
    white-space: nowrap;
}

.property-details {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.dark-theme .property-details {
    color: #aaa;
}

.property-location {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.dark-theme .property-location {
    color: #888;
}

.property-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.dark-theme .property-meta {
    color: #999;
}

.meta-item {
    padding: 0.2rem 0.5rem;
    background: #f0f0f0;
    border-radius: 3px;
}

.dark-theme .meta-item {
    background: #3a3a3a;
    color: #ccc;
}

.property-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e8f4f8;
    border-radius: 3px;
    font-size: 0.75rem;
    color: #2980b9;
    font-weight: 500;
}

.dark-theme .property-badge {
    background: #2a3a4a;
    color: #5dade2;
}

.state-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.state-badge.state-sale {
    background: #27ae60;
    color: white;
}

.state-badge.state-demolition {
    background: #e74c3c;
    color: white;
}

.state-badge.state-sold {
    background: #95a5a6;
    color: white;
}

.state-badge.state-other {
    background: #f39c12;
    color: white;
}

.images-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

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

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

/* Old map controls removed - replaced with overlay controls */

/* Map Markers */
.cluster-marker {
    background: transparent !important;
    border: none !important;
}

.cluster-inner {
    background: #3498db;
    color: white;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Custom Marker Cluster Styles (Leaflet.markercluster) */
.marker-cluster-container {
    background: transparent !important;
    border: none !important;
}

.marker-cluster {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.marker-cluster img {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.marker-cluster .cluster-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    z-index: 10;
}

.marker-cluster-small {
    width: 50px;
    height: 50px;
}

.marker-cluster-medium {
    width: 55px;
    height: 55px;
}

.marker-cluster-large {
    width: 60px;
    height: 60px;
}

.dark-theme .marker-cluster {
    background: rgba(52, 152, 219, 0.9);
}

.property-marker {
    background: transparent !important;
    border: none !important;
}

.marker-pin {
    width: 24px;
    height: 36px;
    background: #3498db;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.marker-pin::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 0;
    background: white;
}

.dark-theme .leaflet-popup-content-wrapper {
    background: #2a2a2a;
    color: #e0e0e0;
}

/* Property popup on map - uses same styles as property-card */
.property-popup {
    padding: 1rem;
    min-width: 280px;
    max-width: 350px;
    background: white;
    border-radius: 8px;
}

.dark-theme .property-popup {
    background: #2a2a2a;
}

/* Popup uses same classes as property-card, so styles are inherited */

/* Property card on map (at high zoom levels) */
.property-card-marker {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Position card so arrow points to location */
/* Anchor is at top center, so we move card up by full height + arrow height (8px) */
.property-card-marker .property-card-map {
    transform: translateY(calc(-100% - 8px));
}

.property-card-map {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px;
    width: 160px;
    max-width: 160px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.dark-theme .property-card-map {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

.property-card-map.selected {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3), 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2000 !important;
}

.property-card-map::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

.dark-theme .property-card-map::after {
    border-top-color: #2a2a2a;
}

.property-card-map::before {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid #e0e0e0;
    z-index: -1;
}

.dark-theme .property-card-map::before {
    border-top-color: #444;
}

.property-card-map:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(calc(-100% - 8px - 2px));
}

.dark-theme .property-card-map:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Preview container with overlay */
.property-card-map .property-preview-container {
    position: relative;
    width: 100%;
    height: 132px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.property-card-map .property-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.property-card-map .property-logo-overlay {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 10;
}

.property-card-map .property-logo {
    width: 32px;
    height: 32px;
    opacity: 0.9;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.property-card-map .property-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.3) 70%, transparent 100%);
    padding: 6px 8px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Content section */
.property-card-map .property-content {
    padding: 0 2px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.property-card-map .property-id-square {
    font-size: 0.78rem;
    color: #999;
    line-height: 1.2;
}

.dark-theme .property-card-map .property-id-square {
    color: #aaa;
}

.property-card-map .property-location {
    font-size: 0.78rem;
    color: #777;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.dark-theme .property-card-map .property-location {
    color: #999;
}

.property-card-map .property-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 2px;
    font-size: 0.78rem;
}

.property-card-map .property-title-overlay {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

.property-card-map .property-price-overlay {
    font-size: 0.84rem;
    font-weight: 600;
    color: #27ae60;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}


.property-card-map .deterioration-badge {
    display: inline-block;
    padding: 0.25rem 0.4rem;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    color: white;
}

.property-card-map .deterioration-badge.deterioration-good {
    background: #27ae60;
}

.property-card-map .deterioration-badge.deterioration-medium {
    background: #f39c12;
}

.property-card-map .deterioration-badge.deterioration-poor {
    background: #e74c3c;
}

.property-card-map .state-badge {
    display: inline-block;
    padding: 0.25rem 0.4rem;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    color: white;
}

.property-card-map .state-badge.state-sale {
    background: #27ae60;
}

.property-card-map .state-badge.state-demolition {
    background: #e74c3c;
}

.property-card-map .state-badge.state-sold {
    background: #95a5a6;
}

.property-card-map .state-badge.state-other {
    background: #f39c12;
}

.cluster-popup {
    padding: 1rem;
    min-width: 200px;
}

.dark-theme .cluster-popup {
    background: #2a2a2a;
    color: #e0e0e0;
}

.cluster-popup h3 {
    margin-bottom: 0.8rem;
    color: #2c3e50;
}

.dark-theme .cluster-popup h3 {
    color: #e0e0e0;
}

.cluster-popup p {
    margin-bottom: 0.5rem;
    color: #666;
}

.dark-theme .cluster-popup p {
    color: #aaa;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Favorites List */
.favorites-list {
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.favorites-list h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.dark-theme .favorites-list h2 {
    color: #e0e0e0;
}

.favorites-properties {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.favorite-property-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.dark-theme .favorite-property-card {
    background: #2a2a2a;
}

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

.favorite-property-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.favorite-property-image-placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    font-size: 3rem;
}

.dark-theme .favorite-property-image-placeholder {
    background: #1a1a1a;
}

.favorite-property-info {
    padding: 1rem;
}

.favorite-property-info h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
}

.dark-theme .favorite-property-info h3 {
    color: #e0e0e0;
}

.favorite-property-address {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
}

.dark-theme .favorite-property-address {
    color: #aaa;
}

.favorite-property-price {
    margin: 0;
    color: #4F46E5;
    font-weight: 600;
    font-size: 1rem;
}

.dark-theme .favorite-property-price {
    color: #818CF8;
}

.favorite-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    z-index: 10;
}

.dark-theme .favorite-remove-btn {
    background: rgba(42, 42, 42, 0.9);
}

.favorite-remove-btn:hover {
    background: rgba(255, 107, 107, 0.9);
    transform: scale(1.1);
}

/* Help List */
.help-list {
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.help-list h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.dark-theme .help-list h2 {
    color: #e0e0e0;
}

.help-materials {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.help-material-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    cursor: pointer;
}

.dark-theme .help-material-item {
    background: #2a2a2a;
}

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

.help-material-title {
    margin: 0 0 1rem 0;
    color: #4F46E5;
    font-size: 1.25rem;
    font-weight: 600;
}

.dark-theme .help-material-title {
    color: #818CF8;
}

.help-material-preview {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
}

.dark-theme .help-material-preview {
    color: #aaa;
}

.help-material-link {
    display: inline-block;
    color: #4F46E5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.dark-theme .help-material-link {
    color: #818CF8;
}

.help-material-link:hover {
    color: #4338CA;
    text-decoration: underline;
}

.dark-theme .help-material-link:hover {
    color: #A5B4FC;
}

/* Help Detail Page */
.help-detail-page {
    max-width: 800px;
    margin: 0 auto;
}

.help-article {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark-theme .help-article {
    background: #2a2a2a;
}

.help-article h1 {
    margin: 0 0 1.5rem 0;
    color: #333;
    font-size: 2rem;
    font-weight: 600;
}

.dark-theme .help-article h1 {
    color: #e0e0e0;
}

.help-article-content {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.8;
}

.dark-theme .help-article-content {
    color: #aaa;
}

.help-article-content p {
    margin: 0 0 1.5rem 0;
}

.help-article-content p:last-child {
    margin-bottom: 0;
}

.help-article-content h2 {
    margin: 2rem 0 1rem 0;
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.dark-theme .help-article-content h2 {
    color: #e0e0e0;
}

.help-article-content h3 {
    margin: 1.5rem 0 0.75rem 0;
    color: #333;
    font-size: 1.25rem;
    font-weight: 600;
}

.dark-theme .help-article-content h3 {
    color: #e0e0e0;
}

.help-article-content ul,
.help-article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.help-article-content li {
    margin: 0.5rem 0;
}

.help-article-content a {
    color: #4F46E5;
    text-decoration: none;
    transition: color 0.2s;
}

.dark-theme .help-article-content a {
    color: #818CF8;
}

.help-article-content a:hover {
    color: #4338CA;
    text-decoration: underline;
}

.dark-theme .help-article-content a:hover {
    color: #A5B4FC;
}

.help-article-content strong {
    font-weight: 600;
    color: #333;
}

.dark-theme .help-article-content strong {
    color: #e0e0e0;
}

.help-article-content em {
    font-style: italic;
}

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

.dark-theme .modal-content {
    background: #2a2a2a;
    color: #e0e0e0;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    transition: color 0.3s;
    z-index: 10;
}

.close:hover {
    color: #333;
}

.dark-theme .close:hover {
    color: #e0e0e0;
}

/* Property Detail */
/* Property detail page (separate page view) */
.property-detail-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    min-height: var(--vh, 100vh);
    min-height: 100dvh;
    background: white;
    padding: 2rem;
    overflow-y: auto;
    z-index: 10000;
}

.dark-theme .property-detail-page {
    background: #121212;
}

.property-detail-page .property-detail {
    max-width: 1200px;
    margin: 0 auto;
}

.property-detail {
    color: #333;
}

.dark-theme .property-detail {
    color: #e0e0e0;
}

/* Back button and Favorite button container */
.property-detail-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.property-detail-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #4F46E5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.property-detail-back-btn:hover {
    background: #4338CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.dark-theme .property-detail-back-btn {
    background: #6366F1;
}

.dark-theme .property-detail-back-btn:hover {
    background: #818CF8;
}

.property-detail-favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.property-detail-favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #ff6b6b;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.dark-theme .property-detail-favorite-btn {
    background: rgba(42, 42, 42, 0.9);
    border-color: #555;
}

.dark-theme .property-detail-favorite-btn:hover {
    background: rgba(42, 42, 42, 1);
    border-color: #ff6b6b;
}

.property-detail-logo-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-decoration: none;
    color: inherit;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    transition: opacity 0.2s;
}

.dark-theme .property-detail-logo-link {
    border-bottom-color: #444;
}

.property-detail-logo-link:hover {
    opacity: 0.9;
}

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

.property-detail-left h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    color: #2c3e50;
}

.dark-theme .property-detail-left h2 {
    color: #fff;
}

.property-detail-logo {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}


.property-detail-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
    white-space: nowrap;
}

.property-detail h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.dark-theme .property-detail h1 {
    color: #e0e0e0;
}

.property-detail h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

/* Exclude h2 inside property-detail-left from general property-detail h2 styles */
.property-detail-left h2 {
    margin-bottom: 0 !important;
    font-size: 1.5rem !important;
}

.dark-theme .property-detail h2 {
    color: #e0e0e0;
}

.property-detail h3 {
    color: #2c3e50;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.3rem;
}

.dark-theme .property-detail h3 {
    color: #e0e0e0;
}

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

.detail-section ul {
    list-style: none;
    padding-left: 0;
}

.detail-section li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.dark-theme .detail-section li {
    border-bottom-color: #444;
}

.detail-section li:last-child {
    border-bottom: none;
}

/* Image Gallery - styles moved to improved section below */

.gallery-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.3s;
    border: 2px solid #e0e0e0;
}

.dark-theme .gallery-image {
    border-color: #444;
}

.gallery-image:hover {
    transform: scale(1.05);
    border-color: #3498db;
}

/* Timeline - styles moved to timeline-collapsible section below */

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 2.5rem;
    cursor: pointer;
    color: white;
    line-height: 1;
    transition: color 0.3s;
}

.image-modal-close:hover {
    color: #3498db;
}

/* Breadcrumbs */
.breadcrumbs {
    margin: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumbs li {
    display: inline;
    padding: 0;
    border: none;
}

.breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: #999;
}

.breadcrumbs a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.breadcrumbs li:last-child {
    color: #666;
}

.dark-theme .breadcrumbs li:last-child {
    color: #999;
}

/* Property Hero Section */
.property-hero {
    margin: 1.5rem 0;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.dark-theme .property-hero {
    border-bottom-color: #444;
}

.property-address {
    font-size: 1rem;
    color: #666;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.dark-theme .property-address {
    color: #999;
}

/* Key Metrics Cards */
.key-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.metric-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dark-theme .metric-card {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

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

.metric-card.metric-price {
    border-left: 4px solid #27ae60;
}

.metric-card.metric-square {
    border-left: 4px solid #3498db;
}

.metric-card.metric-deterioration {
    border-left: 4px solid #e74c3c;
}

.metric-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0.5rem 0;
}

.dark-theme .metric-value {
    color: #fff;
}

.metric-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dark-theme .metric-label {
    color: #bbb;
}

/* Property Description */
.property-description {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    line-height: 1.8;
}

.dark-theme .property-description {
    background: #2c3e50;
    border-left-color: #5dade2;
}

.property-description p {
    margin: 0;
    color: #555;
    font-size: 1rem;
}

.dark-theme .property-description p {
    color: #ddd;
}

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

.metric-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.dark-theme .metric-item {
    background: #2c3e50;
    border-color: #444;
}

.metric-item:hover {
    background: #e9ecef;
}

.dark-theme .metric-item:hover {
    background: #34495e;
}

.metric-item-label {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.dark-theme .metric-item-label {
    color: #999;
}

.metric-item-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.dark-theme .metric-item-value {
    color: #fff;
}

/* Status Badges - only used classes kept */
.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Deterioration Bar */
.deterioration-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.dark-theme .deterioration-bar {
    background: #444;
}

.deterioration-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60 0%, #f39c12 50%, #e74c3c 100%);
    transition: width 0.3s;
}

.deterioration-percent {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
}

.dark-theme .deterioration-percent {
    color: #fff;
}

/* State Remark */
.state-remark {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #856404;
}

.dark-theme .state-remark {
    background: #856404;
    border-left-color: #ffc107;
    color: #fff3cd;
}

/* Timeline Collapsible */
.timeline-collapsible {
    margin-top: 1rem;
}

.timeline-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
    user-select: none;
    transition: background 0.2s;
}

.dark-theme .timeline-summary {
    background: #2c3e50;
}

.timeline-summary:hover {
    background: #e9ecef;
}

.dark-theme .timeline-summary:hover {
    background: #34495e;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
}

.dark-theme .timeline-title {
    color: #e0e0e0;
}

.timeline-toggle {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.2s;
}

.dark-theme .timeline-toggle {
    color: #999;
}

.timeline-collapsible[open] .timeline-toggle {
    transform: rotate(180deg);
}

.timeline {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #e0e0e0;
}

.dark-theme .timeline {
    border-left-color: #444;
}

.timeline-item {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: #666;
}

.dark-theme .timeline-item {
    color: #999;
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: normal;
    color: #999;
    min-width: 80px;
}

.dark-theme .timeline-date {
    color: #777;
}

.timeline-content {
    font-size: 0.85rem;
    color: #666;
    font-weight: normal;
}

.dark-theme .timeline-content {
    color: #999;
}

.timeline-content span {
    font-weight: normal;
}

/* Improved Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.image-gallery .gallery-image:first-child {
    grid-column: 1 / -1;
    height: 300px;
    border-radius: 8px;
}

.image-gallery .gallery-image:not(:first-child) {
    height: 150px;
}

@media (min-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .image-gallery .gallery-image:first-child {
        grid-column: 1 / -1;
    }
}

/* Similar Properties */
.similar-properties-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e0e0e0;
}

.dark-theme .similar-properties-section {
    border-top-color: #444;
}

.similar-properties-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.dark-theme .similar-properties-loading {
    color: #999;
}

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

.similar-property-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e0e0e0;
}

.dark-theme .similar-property-card {
    background: #2c3e50;
    border-color: #444;
}

.similar-property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.similar-property-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.similar-property-info {
    padding: 1rem;
}

.similar-property-id {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.dark-theme .similar-property-id {
    color: #fff;
}

.similar-property-address {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark-theme .similar-property-address {
    color: #999;
}

.similar-property-price {
    font-size: 1rem;
    font-weight: 600;
    color: #27ae60;
    margin-bottom: 0.25rem;
}

.similar-property-square {
    font-size: 0.85rem;
    color: #666;
}

.dark-theme .similar-property-square {
    color: #999;
}

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

.dark-theme .loading {
    color: #666;
}

.error {
    padding: 1rem;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 4px;
    color: #c33;
    margin: 1rem;
}

.dark-theme .error {
    background: #3a2222;
    border-color: #5a3333;
    color: #ff6666;
}

/* Dark theme base */
.dark-theme {
    background: #121212;
    color: #e0e0e0;
}

.dark-theme body {
    background: #121212;
    color: #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
    .view-mode-toggle {
        position: fixed;
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: auto;
        z-index: 1001;
        padding: 0.2rem;
    }
    
    .view-mode-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .content {
        flex-direction: column;
    }

    .view-mode-map .sidebar {
        display: none;
    }

    .view-mode-list .sidebar {
        width: 100%;
        height: 100%;
        max-height: 100%;
    }

    .view-mode-map .map-container {
        width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for iOS */
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1;
        /* No transitions for layout changes */
        transition: none;
    }

    .view-mode-map #map {
        width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for iOS */
        /* No transitions for layout changes */
        transition: none;
    }

    .view-mode-list .map-container {
        display: none;
    }

    .view-mode-map .container {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for iOS */
        overflow: hidden;
        /* No transitions for layout changes */
        transition: none;
    }

    .view-mode-map .content {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for iOS */
        /* No transitions for layout changes */
        transition: none;
    }

    .filters {
        max-height: 40vh;
    }

    .quick-filter-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ===== MAP OVERLAY CONTROLS (for both desktop and mobile) ===== */
.map-overlay-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
}

.map-overlay-controls > * {
    pointer-events: auto;
}

/* Logo - middle left */
.map-overlay-logo {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
}

.dark-theme .map-overlay-logo {
    background: rgba(80, 80, 80, 0.425);
}

.map-logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dark-theme .map-logo-link {
    color: #e0e0e0;
}

.map-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.map-logo-text {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Top controls - filters and search in one row */
.map-overlay-top-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    max-width: calc(100vw - 20px);
}

/* Filters */
.map-overlay-filters {
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.map-filters-toggle {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    min-height: 36px;
}

.dark-theme .map-filters-toggle {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.map-filters-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.map-filters-label {
    font-weight: 500;
    white-space: nowrap;
}

.map-filters-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: rgba(255, 255, 255, 0.425) !important;
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    min-width: 200px;
}

.dark-theme .map-filters-panel {
    background: rgba(80, 80, 80, 0.425) !important;
}

.map-filters-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.map-filter-option {
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    border-radius: 0;
    transition: background 0.2s;
    width: 100%;
}

.map-filter-option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.map-filter-option:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.dark-theme .map-filter-option {
    color: #e0e0e0;
}

.map-filter-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark-theme .map-filter-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.map-filter-option.active {
    background: rgba(79, 70, 229, 0.2);
    font-weight: 600;
}

/* Search */
.map-overlay-search {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    min-width: 70px;
    max-width: 100px;
    flex: 0 1 auto;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.dark-theme .map-overlay-search {
    background: rgba(80, 80, 80, 0.425);
}

/* View mode toggle (in top row) */
.map-overlay-view-toggle {
    background: transparent;
    border: none;
    padding: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.map-overlay-view-toggle .map-view-mode-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-theme .map-overlay-view-toggle .map-view-mode-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.map-overlay-view-toggle .map-view-mode-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .map-overlay-view-toggle .map-view-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Layer control (in top row) */
.map-overlay-layer-control {
    background: transparent;
    border: none;
    padding: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.map-overlay-layer-control .leaflet-control-layers {
    background: rgba(255, 255, 255, 0.425) !important;
    backdrop-filter: blur(10px) !important;
    border: none !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.dark-theme .map-overlay-layer-control .leaflet-control-layers {
    background: rgba(80, 80, 80, 0.425) !important;
}

/* Style toggle button with standard layers icon */
.map-overlay-layer-control .leaflet-control-layers-toggle {
    background-color: rgba(255, 255, 255, 0.425) !important;
    backdrop-filter: blur(10px) !important;
    background-image: none !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #333 !important;
    font-size: 1.2rem !important;
    line-height: 1 !important;
    border: none !important;
    border-radius: 8px !important;
}

.dark-theme .map-overlay-layer-control .leaflet-control-layers-toggle {
    background-color: rgba(80, 80, 80, 0.425) !important;
    color: #e0e0e0 !important;
}

.map-overlay-layer-control .leaflet-control-layers-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.dark-theme .map-overlay-layer-control .leaflet-control-layers-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Expanded panel styling */
.map-overlay-layer-control .leaflet-control-layers-expanded {
    padding: 0.5rem !important;
    position: relative !important;
    background: rgba(255, 255, 255, 0.425) !important;
    backdrop-filter: blur(10px) !important;
    border: none !important;
    border-radius: 8px !important;
}

.dark-theme .map-overlay-layer-control .leaflet-control-layers-expanded {
    background: rgba(80, 80, 80, 0.425) !important;
}

.map-overlay-layer-control .leaflet-control-layers-list {
    margin: 0 !important;
}

/* Style radio buttons and labels */
.map-overlay-layer-control .leaflet-control-layers-selector {
    margin-right: 0.5rem;
}

.map-overlay-layer-control .leaflet-control-layers label {
    display: flex;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
}

.dark-theme .map-overlay-layer-control .leaflet-control-layers label {
    color: #e0e0e0;
}

.map-search-input {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    width: 100%;
    outline: none;
}

.dark-theme .map-search-input {
    color: #e0e0e0;
}

.map-search-input::placeholder {
    color: #999;
    font-size: 0.9rem;
}

.dark-theme .map-search-input::placeholder {
    color: #666;
}

/* Bottom right controls - horizontal layout */
.map-overlay-bottom-right {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
}

.map-bot-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.dark-theme .map-bot-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.map-bot-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .map-bot-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.map-help-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-theme .map-help-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.map-help-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .map-help-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.map-favorites-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-theme .map-favorites-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.map-favorites-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .map-favorites-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.map-favorites-btn.has-favorites {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.map-theme-toggle-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-theme .map-theme-toggle-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.map-theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .map-theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Zoom controls - bottom left */
.view-mode-map .leaflet-bottom.leaflet-left {
    bottom: 10px !important;
    left: 10px !important;
}

.view-mode-map .leaflet-control-zoom {
    background: rgba(255, 255, 255, 0.425) !important;
    backdrop-filter: blur(10px) !important;
    border: none !important;
    border-radius: 8px !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.dark-theme .view-mode-map .leaflet-control-zoom {
    background: rgba(80, 80, 80, 0.425) !important;
}

.view-mode-map .leaflet-control-zoom a {
    background-color: transparent !important;
    border: none !important;
    color: #333 !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
}

.dark-theme .view-mode-map .leaflet-control-zoom a {
    color: #e0e0e0 !important;
}

.view-mode-map .leaflet-control-zoom a:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.dark-theme .view-mode-map .leaflet-control-zoom a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Leaflet Layer Control Styles */
.leaflet-control-layers {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    margin-bottom: 0;
}

.dark-theme .leaflet-control-layers {
    background: #2a2a2a;
    border: 1px solid #444;
}

/* Ensure layer control in custom wrapper matches theme toggle style */
.custom-layer-wrapper .leaflet-control-layers {
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.leaflet-control-layers-toggle {
    background-color: white;
    width: 36px;
    height: 36px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMTMuMDkgOC4yNkwyMCA5TDEzLjA5IDE1Ljc0TDEyIDIyTDEwLjkxIDE1Ljc0TDQgOUwxMC45MSA4LjI2TDEyIDJaIiBmaWxsPSIjMzMzMzMzIi8+Cjwvc3ZnPgo=');
    background-size: 20px 20px;
    background-position: center;
    background-repeat: no-repeat;
}

.dark-theme .leaflet-control-layers-toggle {
    background-color: #2a2a2a;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMTMuMDkgOC4yNkwyMCA5TDEzLjA5IDE1Ljc0TDEyIDIyTDEwLjkxIDE1Ljc0TDQgOUwxMC45MSA4LjI2TDEyIDJaIiBmaWxsPSIjZTBlMGUwIi8+Cjwvc3ZnPgo=');
}

.leaflet-control-layers-toggle:hover {
    background-color: #f4f4f4;
}

.dark-theme .leaflet-control-layers-toggle:hover {
    background-color: #333;
}

.leaflet-control-layers-expanded {
    padding: 6px 10px 6px 6px;
    color: #333;
}

.dark-theme .leaflet-control-layers-expanded {
    color: #e0e0e0;
}

.leaflet-control-layers-selector {
    margin-top: 2px;
    position: relative;
    top: 1px;
}

.leaflet-control-layers label {
    display: block;
    font-size: 13px;
    font-weight: normal;
    margin-bottom: 4px;
    cursor: pointer;
}

.dark-theme .leaflet-control-layers label {
    color: #e0e0e0;
}

.leaflet-control-layers label:hover {
    color: #3498db;
}

.dark-theme .leaflet-control-layers label:hover {
    color: #5dade2;
}

.leaflet-control-layers-separator {
    height: 0;
    border-top: 1px solid #ddd;
    margin: 5px -10px 5px -6px;
}

.dark-theme .leaflet-control-layers-separator {
    border-top-color: #444;
}

/* ===== LIST OVERLAY CONTROLS (same as map overlay, but for list mode) ===== */
.list-overlay-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
}

.list-overlay-controls > * {
    pointer-events: auto;
}

/* Logo - middle left */
.list-overlay-logo {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
}

.dark-theme .list-overlay-logo {
    background: rgba(80, 80, 80, 0.425);
}

.list-logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    white-space: nowrap;
}

.dark-theme .list-logo-link {
    color: #e0e0e0;
}

.list-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.list-logo-text {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Top controls - filters and search in one row */
.list-overlay-top-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    max-width: calc(100vw - 20px);
    flex-wrap: wrap;
}

/* Filters */
.list-overlay-filters {
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
}

.list-filters-toggle {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    min-height: 36px;
}

.dark-theme .list-filters-toggle {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.list-filters-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .list-filters-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.list-filters-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.list-filters-label {
    font-weight: 500;
    white-space: nowrap;
}

.list-filters-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: rgba(255, 255, 255, 0.425) !important;
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2000;
    min-width: 200px;
}

.dark-theme .list-filters-panel {
    background: rgba(80, 80, 80, 0.425) !important;
}

.list-filters-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.list-filter-option {
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    border-radius: 0;
    transition: background 0.2s;
    width: 100%;
}

.dark-theme .list-filter-option {
    color: #e0e0e0;
}

.list-filter-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dark-theme .list-filter-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.list-filter-option:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.list-filter-option:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.list-filter-option.active {
    background: rgba(79, 70, 229, 0.2);
    font-weight: 600;
}

/* Search */
.list-overlay-search {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    min-width: 70px;
    max-width: 100px;
    flex: 0 1 auto;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.dark-theme .list-overlay-search {
    background: rgba(80, 80, 80, 0.425);
}

.list-search-input {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    width: 100%;
    outline: none;
}

.dark-theme .list-search-input {
    color: #e0e0e0;
}

.list-search-input::placeholder {
    color: #999;
    font-size: 0.9rem;
}

.dark-theme .list-search-input::placeholder {
    color: #666;
}

/* View mode toggle */
.list-overlay-view-toggle {
    background: transparent;
    border: none;
    padding: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.list-overlay-view-toggle .list-view-mode-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-theme .list-overlay-view-toggle .list-view-mode-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.list-overlay-view-toggle .list-view-mode-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .list-overlay-view-toggle .list-view-mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Bottom right controls - horizontal layout */
.list-overlay-bottom-right {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
}

.list-bot-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.dark-theme .list-bot-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.list-bot-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .list-bot-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.list-help-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-theme .list-help-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.list-help-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .list-help-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.list-favorites-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-theme .list-favorites-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.list-favorites-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .list-favorites-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.list-favorites-btn.has-favorites {
    animation: pulse 2s infinite;
}

.list-theme-toggle-btn {
    background: rgba(255, 255, 255, 0.425);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-theme .list-theme-toggle-btn {
    background: rgba(80, 80, 80, 0.425);
    color: #e0e0e0;
}

.list-theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.dark-theme .list-theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
