/* Global resets removed — handled by Next.js/Tailwind */

/* Map page body overrides */
body.map-page {
    line-height: 1.2;
    font-size: 12px;
}

.container {
    display: flex;
    height: 100vh;
}

#map {
    flex: 2;
    height: 100%;
}

.controls {
    flex: 1;
    padding: 20px;
    background: #f5f5f5;
    overflow-y: auto;
    max-width: 400px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #ddd;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

.tab-btn.active {
    background: #4CAF50;
    color: white;
}

.rooms-select {
    margin-bottom: 20px;
}

.rooms-select select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.data-block {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.data-block h3 {
    margin-bottom: 5px;
    margin-top:10px;
    font-size:14px;
    color: #333;
}

.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.district-info {
    max-height: 300px;
    overflow-y: auto;
}

.places-control {
    margin-top: 20px;
}

.places-toggle {
    width: 100%;
    padding: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
}

.places-checkboxes {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.places-checkboxes label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
}

.place-info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: white;
    margin: 15% auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.place-details {
    text-align: center;
}

.place-intro {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
    line-height: 1.4;
    padding: 0 10px;
}

#place-media {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#place-image {
    max-width: 100%;
    max-height: 50vh;
    width: auto;
    height: auto;
    border-radius: 5px;
    object-fit: contain;
}

#place-video {
    width: 100%;
    max-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

#hls-video {
    width: 100%;
    max-height: 50vh;
    border-radius: 5px;
}

#youtube-video {
    width: 100%;
    max-height: 50vh;
    border-radius: 5px;
    overflow: hidden;
}

#youtube-video iframe {
    width: 100%;
    height: 100%;
    border-radius: 5px;
}

/* Стили для маркеров на карте */
.marker {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
}

/* Стили для границ районов */
.district-boundary {
    stroke: #666;
    stroke-width: 2;
    fill: none;
    pointer-events: all;
}

.district-boundary:hover {
    stroke: #4CAF50;
    stroke-width: 3;
}

#preloader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.85);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}
.loading-text {
    margin-top: 20px;
    font-size: 18px;
    color: #333;
}
.progress-bar-bg {
    width: 220px;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    margin-top: 20px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

.infra-count { display: none; }

.drag-handle {
    display: none;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 18px;
    z-index: 1010;
    cursor: pointer;
}

.drag-handle-bar {
    width: 40px;
    height: 6px;
    background: #ccc;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.filter-panel {
    position: fixed;
    top: 46px;
    right: 32vw;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.filter-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #111;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 8px;
}
.filter-toggle img {
    width: 28px;
    height: 28px;
}
.filter-toggle:active, .filter-toggle:focus {
    background: #333;
}
.places-filter-panel {
    display: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 18px 20px 12px 20px;
    margin-top: 4px;
    min-width: 220px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
}
.filter-panel.open .places-filter-panel {
    display: block;
}

.logo-panel {
    position: fixed;
    top: 46px;
    left: 32px;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.logo-panel a {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo-desktop {
    display: block;
    height: 26px;
    width: auto;
}
.logo-mobile {
    display: none;
    height: 40px;
    width: 40px;
}

@media (max-width: 800px) {
  .container {
    flex-direction: column;
  }
  #map {
    flex: none;
    height: 100vh;
  }
  .controls {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100vw;
    max-width: 100vw;
    height: 30vh;
    min-height: 50px;
    max-height: 80vh;
    z-index: 1001;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding-top: 32px;
    transition: height 0.3s cubic-bezier(.4,2,.6,1), transform 0.3s cubic-bezier(.4,2,.6,1);
    overflow-y: auto;
  }
  .controls.minimized {
    height: 5vh !important;
    min-height: 40px;
    overflow: hidden;
  }
  .controls.expanded {
    height: 80vh !important;
    max-height: 80vh;
  }
  .drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: calc(30vh - 9px);
  }
  .drag-handle-bar {
    display: block;
  }
  .controls .data-block,
  .controls .places-control {
    max-width: 100vw;
  }
  .filter-panel {
    top: 42px;
    right: 16px;
    z-index: 1020;
  }
  .places-filter-panel {
    min-width: 180px;
    max-width: 96vw;
    max-height: 60vh;
    padding: 14px 10px 10px 10px;
  }
  .logo-panel {
    top: 42px;
    left: 16px;
    z-index: 1020;
  }
  .logo-desktop {
    display: none;
  }
  .logo-mobile {
    display: block;
    height: 40px;
    width: 40px;
  }
}

.pro-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    /* min-height: 24px; */
    cursor: pointer;
}
.pro-lock img {
    width: 28px;
    /* height: 28px; */
    vertical-align: middle;
}
.pro-link-row {
    padding: 0;
    border: none;
    margin-bottom: 2px;
}
.pro-action-btn {
    display: inline-block;
    background: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    margin: 0px 0 8px 0;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.pro-action-btn:hover, .pro-action-btn:focus {
    background: #388e3c;
    color: #fff;
    text-decoration: none;
}
.pro-action-btn-black {
    background: #111 !important;
    color: #fff !important;
}
.pro-action-btn-mobile {
    font-size: 12px;
    padding: 4px 10px;
    margin: 0 0 0 8px;
    display: inline-block;
    vertical-align: middle;
}
@media (max-width: 800px) {
  #buy-link-row, #rent-link-row {
    display: none !important;
  }
  .data-row.buy-mobile, .data-row.rent-mobile {
    display: flex;
    align-items: center;
    border-bottom: none;
    margin-bottom: 2px;
    padding: 5px 0;
  }
  .buy-mobile .pro-action-btn-mobile, .rent-mobile .pro-action-btn-mobile {
    margin-left: 8px;
  }
}

.place-labels {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

.place-labels img {
    height: 24px;
    width: auto;
}

/* Map Controls */
.map-controls {
    position: absolute;
    left: 20px;
    bottom: calc(35vh + 30px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.map-control-btn:hover {
    background: #f0f0f0;
}

.map-control-btn:active {
    background: #e0e0e0;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Для состояния, когда панель controls свернута */
.controls.minimized + .map-controls {
    bottom: calc(5vh + 20px);
}

/* Для состояния, когда панель controls развернута */
.controls.expanded + .map-controls {
    bottom: calc(80vh + 20px);
}

@media (max-width: 800px) {
    .map-controls {
        left: 10px;
        bottom: calc(30vh + 10px);
        flex-direction: row;
    }
    
    .map-control-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .controls.minimized + .map-controls {
        bottom: calc(5vh + 10px);
    }

    .controls.expanded + .map-controls {
        bottom: calc(80vh + 10px);
    }
}

/* Map type toggle active state */
.map-control-btn.active-toggle {
    background: #333;
    color: #fff;
}
.map-control-btn.active-toggle svg rect,
.map-control-btn.active-toggle svg path {
    stroke: #fff;
}
.map-control-btn.active-toggle svg circle {
    fill: #8BC34A;
}

/* Income toggle - keep SVG colors when active */
#income-toggle.active-toggle svg rect:nth-child(1) { fill: #e53935; }
#income-toggle.active-toggle svg rect:nth-child(2) { fill: #ff9800; }
#income-toggle.active-toggle svg rect:nth-child(3) { fill: #4caf50; }

/* Code search panel */
.code-search-panel {
    position: fixed;
    top: 46px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1020;
}
.code-search-panel form {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.code-search-panel form:focus-within {
    border-color: #4CAF50;
    box-shadow: 0 2px 16px rgba(76,175,80,0.25);
}
#code-search-input {
    border: none;
    outline: none;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    width: 170px;
    background: transparent;
    color: #333;
    letter-spacing: 0.5px;
}
#code-search-input::placeholder {
    color: #aaa;
    font-weight: 400;
    letter-spacing: 0;
}
#code-search-input.code-error {
    background: #fff0f0;
}
#code-search-input.code-success {
    background: #f0fff0;
}
#code-search-btn {
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-left: 1px solid #eee;
}
#code-search-btn:hover {
    background: #e8e8e8;
}
#code-search-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

@media (max-width: 800px) {
    .code-search-panel {
        top: 42px;
        left: 50%;
        transform: translateX(-50%);
    }
    #code-search-input {
        width: 130px;
        padding: 8px 12px;
        font-size: 13px;
    }
    #code-search-btn {
        padding: 8px 12px;
    }
}

/* First-visit hints */
.map-hints-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9000;
    transition: opacity 0.4s;
}
.map-hint {
    position: fixed;
    z-index: 9001;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    white-space: nowrap;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.4s;
    animation: hintPulse 1.5s ease-in-out infinite;
}
.map-hint::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    transform: rotate(45deg);
}
.map-hint-bottom::before {
    top: -4px;
    left: 50%;
    margin-left: -4px;
}
.map-hint-left::before {
    right: -4px;
    top: 50%;
    margin-top: -4px;
}
.map-hint-right::before {
    left: -4px;
    top: 50%;
    margin-top: -4px;
}
.map-hints-fade {
    opacity: 0 !important;
}
@keyframes hintPulse {
    0%, 100% { box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
    50% { box-shadow: 0 2px 20px rgba(76,175,80,0.4); }
}

/* Price labels on map */
.price-label {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 5;
    background: rgba(255,255,255,0.92);
    color: #333;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    line-height: 1.2;
    letter-spacing: -0.02em;
    border: 1px solid rgba(255,255,255,0.5);
} 