/* ===== Общие стили ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
}

#map {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 250px;
    height: 100vh;
    width: auto;
    z-index: 1;
}

/* ===== Боковая панель ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    border-right: 1px solid #e9edf2;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 54px;
    border-bottom: 1px solid #e9edf2;
    background: #fafbfc;
    flex-shrink: 0;
    position: relative;
    z-index: 30;
}

.sidebar-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.points-count {
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
    margin-left: 2px;
}

.profile-avatar-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 2px solid #e9edf2;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 0;
    position: relative;
    z-index: 25;
    -webkit-tap-highlight-color: transparent;
}

.profile-avatar-btn:hover {
    border-color: #e9edf2;
    transform: scale(1.05);
}

.profile-avatar-btn:active {
    background: #e2e8f0;
    transform: none;
}

#sidebarOverlay {
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

.profile-dropdown {
    display: none;
    flex-direction: column;
    background: #ffffff;
    border-bottom: 1px solid #e9edf2;
    padding: 16px 18px 14px;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
}

.profile-dropdown-info {
    flex: 1;
    min-width: 0;
}

.profile-dropdown-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-dropdown-email {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-dropdown-divider {
    height: 1px;
    background: #e9edf2;
    margin: 12px 0 10px;
}

.profile-dropdown-logout {
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
}

.profile-dropdown-logout:hover {
    background: #fecaca;
}

.sidebar-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e9edf2;
    background: #ffffff;
    flex-shrink: 0;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-wrapper input {
    width: 100%;
    padding: 8px 32px 8px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    background: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s;
}

.search-wrapper input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.search-wrapper input::placeholder {
    color: #94a3b8;
}

.clear-search {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 16px;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
}

.clear-search:hover {
    background: #e9edf2;
    color: #475569;
}

.points-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 16px;
    background: #ffffff;
}

.points-list .loading {
    text-align: center;
    padding: 30px 0;
    color: #94a3b8;
    font-size: 13px;
}

.point-item {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid #e9edf2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.point-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.point-item .point-name {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.point-item .point-brief {
    font-size: 12px;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.point-item .point-tag {
    font-size: 9px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
}

.point-item.highlight {
    box-shadow: 0 0 0 3px rgba(168, 213, 186, 0.2) !important;
}

.point-item.highlight .point-name {
    color: #2d6a4f !important;
}

.point-item.highlight[data-status="active"] {
    background: #e4f0e6 !important;
    border-color: #7dcd8a !important;
    box-shadow: 0 0 0 3px rgba(125, 205, 138, 0.2) !important;
}

.point-item.highlight[data-status="active"] .point-name {
    color: #1a5a3a !important;
}

.point-item.highlight[data-status="inactive"] {
    background: #f5ecec !important;
    border-color: #d4b8b8 !important;
    box-shadow: 0 0 0 3px rgba(212, 184, 184, 0.2) !important;
}

.point-item.highlight[data-status="inactive"] .point-name {
    color: #7a4a4a !important;
}

.point-item.highlight[data-status="main"] {
    background: #e4f0e6 !important;
    border-color: #7dcd8a !important;
    box-shadow: 0 0 0 3px rgba(125, 205, 138, 0.2) !important;
}

.point-item.highlight[data-status="main"] .point-name {
    color: #1a5a3a !important;
}

/* ===== Панель информации ===== */
.info-panel {
    position: fixed;
    top: 0;
    left: 250px;
    width: 340px;
    height: 100vh;
    background: #ffffff;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-right: 1px solid #e9edf2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.info-panel.open {
    transform: translateX(0);
}

.info-panel-header {
    padding: 0 18px;
    height: 54px;
    border-bottom: 1px solid #e9edf2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    flex-shrink: 0;
}

.info-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.info-panel-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #94a3b8;
    padding: 2px 6px;
    line-height: 1;
    transition: color 0.2s;
}

.info-panel-close:hover {
    color: #475569;
}

.info-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px 20px;
    background: #ffffff;
}

.info-panel-content .info-name {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.info-panel-content .info-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
}

.info-panel-content .info-description {
    font-size: 13px;
    color: #334155;
    line-height: 1.6;
    margin: 8px 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.info-panel-content .info-coords {
    font-size: 12px;
    color: #94a3b8;
    font-family: 'Courier New', monospace;
}

.info-panel-content .info-divider {
    border: none;
    border-top: 1px solid #e9edf2;
    margin: 12px 0;
}

.info-panel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* ===== Слайдер ===== */
.info-slider {
    position: relative;
    width: 100%;
    height: 200px;
    background: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0 14px;
    cursor: pointer;
}

.info-slider .slide {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-slider .slide.active {
    display: block;
}

.info-slider .slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}

.info-slider .slide-nav:hover {
    background: rgba(15, 23, 42, 0.7);
}

.info-slider .slide-prev {
    left: 6px;
}

.info-slider .slide-next {
    right: 6px;
}

.info-slider .slide-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.info-slider .slide-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.info-slider .slide-dot.active {
    background: #ffffff;
}

/* ===== Полноэкранный режим ===== */
.image-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-fullscreen.open {
    display: flex;
}

.image-fullscreen .fullscreen-slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-fullscreen .fullscreen-slider img {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    user-select: none;
    -webkit-user-drag: none;
    cursor: default;
}

.image-fullscreen .close-fullscreen {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 34px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    background: none;
    border: none;
    transition: all 0.2s;
    line-height: 1;
    z-index: 10;
}

.image-fullscreen .close-fullscreen:hover {
    color: #ffffff;
    transform: scale(1.15);
}

.image-fullscreen .fs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
}

.image-fullscreen .fs-nav:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-50%) scale(1.06);
}

.image-fullscreen .fs-prev {
    left: 28px;
}

.image-fullscreen .fs-next {
    right: 28px;
}

.image-fullscreen .fs-counter {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 20px;
    border-radius: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ===== Кнопка бургер ===== */
.open-sidebar-btn {
    display: none;
}

.open-sidebar-btn.outer {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    color: #1e293b;
    line-height: 1;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.3s ease, background 0.15s ease;
    transform: translateX(0);
    will-change: transform;
}

.open-sidebar-btn.outer.open {
    transform: translateX(190px);
}

.open-sidebar-btn:hover {
    background: #f8fafc;
}

.open-sidebar-btn:active {
    background: #e2e8f0;
    transform: none !important;
}

/* ===== Фильтры ===== */
.filter-controls {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.filter-controls .filter-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px 9px 12px;
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    color: #1e293b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 44px;
    width: 44px;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.filter-controls .filter-toggle-btn:hover {
    background: #f8fafc;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.filter-controls .filter-toggle-btn:active {
    background: #e2e8f0;
    transform: none;
}

.filter-controls .filter-toggle-btn svg {
    flex-shrink: 0;
}

.filter-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 16px 18px;
    min-width: 220px;
    max-width: 320px;
    max-height: 60vh;
    overflow-y: auto;
    transform: scale(0.92) translateX(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
    position: absolute;
    right: 100%;
    top: 0;
    margin-right: 10px;
    display: none;
}

.filter-panel.open {
    display: block !important;
    transform: scale(1) translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9edf2;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}

.close-filter-panel {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.close-filter-panel:hover {
    color: #475569;
}

.filter-tags-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.filter-tag-btn {
    padding: 6px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
    pointer-events: auto;
}

.filter-tag-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

.filter-tag-btn.reset-btn {
    grid-column: 1 / -1;
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
    margin-top: 4px;
}

.filter-tag-btn.reset-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* ===== Авторизация ===== */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.auth-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.auth-modal {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px 36px 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
    animation: authSlideUp 0.4s ease;
}

@keyframes authSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f1f5f9;
    border-radius: 14px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 11px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.auth-tab:hover:not(.active) {
    color: #334155;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.auth-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.form-group input {
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: #f8fafc;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.auth-btn {
    padding: 14px;
    background: #3b82f6;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 4px;
    position: relative;
}

.auth-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
}

.auth-btn:active {
    transform: scale(0.97);
}

.auth-error {
    font-size: 13px;
    color: #ef4444;
    min-height: 20px;
    text-align: center;
    margin-top: -4px;
}

.auth-btn.loading .btn-text {
    visibility: hidden;
}

.auth-btn.loading .btn-spinner {
    display: inline-block !important;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.auth-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.password-group {
    position: relative;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #94a3b8;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.toggle-password:hover {
    color: #475569;
}

.toggle-password .eye-icon {
    display: block;
}

.toggle-password .eye-closed {
    display: none;
}

.toggle-password.hidden .eye-open {
    display: none;
}

.toggle-password.hidden .eye-closed {
    display: block !important;
}

.forgot-password {
    text-align: right;
    margin-top: -8px;
}

.forgot-password a {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password a:hover {
    color: #475569;
    text-decoration: underline;
}

/* ===== Leaflet ===== */
.leaflet-control-zoom {
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08) !important;
    overflow: hidden !important;
    margin-bottom: 20px !important;
    margin-right: 20px !important;
}

.leaflet-control-zoom a {
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 24px !important;
    font-weight: 300 !important;
    background: #ffffff !important;
    color: #1e293b !important;
    border: none !important;
    border-radius: 0 !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    -webkit-tap-highlight-color: transparent;
}

.leaflet-control-zoom a:first-child {
    border-bottom: 1px solid #e9edf2 !important;
    border-radius: 14px 14px 0 0 !important;
}

.leaflet-control-zoom a:last-child {
    border-radius: 0 0 14px 14px !important;
}

.leaflet-control-zoom a:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
}

.leaflet-control-zoom a:active {
    background: #e2e8f0 !important;
    transform: none !important;
}

.locate-control {
    margin-bottom: 12px !important;
    margin-right: 20px !important;
}

.locate-btn {
    width: 44px !important;
    height: 44px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08) !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-tap-highlight-color: transparent;
}

.locate-btn::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: currentColor;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 56'%3E%3Cpath d='M5.137 28.246c.82.797 1.64 1.055 3.258 1.078l17.742.07c.164 0 .304.024.375.094c.07.07.093.211.093.375l.07 17.743c.024 1.617.282 2.437 1.102 3.257c1.102 1.125 2.649.938 3.797-.187c.61-.61 1.102-1.617 1.547-2.555L51.051 9.45c.937-1.968.82-3.422-.14-4.36c-.939-.96-2.392-1.077-4.36-.14L7.879 22.88c-.938.445-1.945.937-2.555 1.547c-1.125 1.148-1.312 2.695-.187 3.82m4.758-2.484c-.024-.07.023-.14.164-.211L47.16 8.51c.188-.07.281-.07.352-.023c.047.07.047.164-.024.352L30.45 45.94c-.07.141-.14.188-.21.164c-.048 0-.118-.093-.118-.187l.117-18.516c0-.586-.21-.96-.445-1.195c-.235-.234-.61-.445-1.195-.445l-18.516.117c-.094 0-.187-.07-.187-.117'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 56'%3E%3Cpath d='M5.137 28.246c.82.797 1.64 1.055 3.258 1.078l17.742.07c.164 0 .304.024.375.094c.07.07.093.211.093.375l.07 17.743c.024 1.617.282 2.437 1.102 3.257c1.102 1.125 2.649.938 3.797-.187c.61-.61 1.102-1.617 1.547-2.555L51.051 9.45c.937-1.968.82-3.422-.14-4.36c-.939-.96-2.392-1.077-4.36-.14L7.879 22.88c-.938.445-1.945.937-2.555 1.547c-1.125 1.148-1.312 2.695-.187 3.82m4.758-2.484c-.024-.07.023-.14.164-.211L47.16 8.51c.188-.07.281-.07.352-.023c.047.07.047.164-.024.352L30.45 45.94c-.07.141-.14.188-.21.164c-.048 0-.118-.093-.118-.187l.117-18.516c0-.586-.21-.96-.445-1.195c-.235-.234-.61-.445-1.195-.445l-18.516.117c-.094 0-.187-.07-.187-.117'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    color: #475569;
}

.locate-btn:hover {
    background: #f8fafc !important;
}

.locate-btn:active {
    background: #e2e8f0 !important;
    transform: none !important;
}

.locate-btn.locating {
    background: #ffffff !important;
    color: #475569 !important;
    animation: none !important;
}

.locate-btn.locating::before {
    color: #475569;
}

.locate-btn.active {
    background: #f8fafc !important;
    color: #1e293b !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06) !important;
}

.locate-btn.active::before {
    color: #1e293b;
}

.leaflet-control-layers {
    border: none !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08) !important;
    background: #ffffff !important;
    margin-top: 72px !important;
    margin-right: 20px !important;
    overflow: hidden !important;
}

.leaflet-control-layers-toggle {
    width: 44px !important;
    height: 44px !important;
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='2'/%3E%3Cline x1='2' y1='9' x2='22' y2='9'/%3E%3Cline x1='2' y1='15' x2='22' y2='15'/%3E%3Cline x1='9' y1='2' x2='9' y2='22'/%3E%3Cline x1='15' y1='2' x2='15' y2='22'/%3E%3C/svg%3E") !important;
    background-size: 20px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    -webkit-tap-highlight-color: transparent;
}

.leaflet-control-layers-toggle:active {
    background-color: #e2e8f0 !important;
    transform: none !important;
}

.leaflet-control-layers-expanded {
    padding: 10px 16px !important;
    background: #ffffff !important;
}

.leaflet-control-layers-selector {
    margin-right: 6px !important;
    accent-color: #3b82f6;
}

.leaflet-control-layers-base label {
    font-size: 13px;
    color: #1e293b;
    padding: 3px 0;
    cursor: pointer;
}

.leaflet-control-attribution {
    display: none !important;
}

.leaflet-bottom.leaflet-left {
    display: none !important;
}

/* ===== Маркеры ===== */
.custom-marker-svg {
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    transition: filter 0.2s ease;
}

.custom-marker-svg:hover {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.marker-tooltip {
    background: rgba(30, 41, 59, 0.85);
    color: #f8fafc;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.2px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.marker-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(30, 41, 59, 0.85);
}

/* ===== Скролл ===== */
.points-list::-webkit-scrollbar,
.info-panel-content::-webkit-scrollbar {
    width: 4px;
}

.points-list::-webkit-scrollbar-track,
.info-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.points-list::-webkit-scrollbar-thumb,
.info-panel-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.points-list::-webkit-scrollbar-thumb:hover,
.info-panel-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== Мобильная версия ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 190px !important;
        transform: translateX(-100%);
        border-right: none;
        box-shadow: 2px 0 30px rgba(0, 0, 0, 0.10);
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .open-sidebar-btn.outer {
        display: flex !important;
        position: fixed;
        top: 16px;
        left: 16px;
        z-index: 999;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: #ffffff;
        border: 1.5px solid #e2e8f0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
        align-items: center;
        justify-content: center;
        font-size: 22px;
        cursor: pointer;
        color: #1e293b;
        line-height: 1;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.3s ease, background 0.15s ease;
        transform: translateX(0);
        will-change: transform;
    }

    .open-sidebar-btn.outer.open {
        transform: translateX(190px);
    }

    .info-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: calc(60vh - 60px);
        max-height: calc(70vh - 60px);
        z-index: 1003;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
        border-right: none;
        border-top: 1px solid #e9edf2;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #ffffff;
    }

    .info-panel.open {
        transform: translateY(0);
    }

    .info-panel-header {
        padding: 16px 18px;
        border-bottom: 1px solid #e9edf2;
        background: #fafbfc;
        border-radius: 16px 16px 0 0;
        flex-shrink: 0;
    }

    .info-panel-content {
        padding: 16px 18px 20px;
        flex: 1;
        overflow-y: auto;
    }

    #map {
        left: 0 !important;
        width: 100vw !important;
    }

    .point-item {
        padding: 10px 12px;
    }

    .sidebar-header h2 {
        font-size: 14px;
    }

    .info-slider {
        height: 180px;
    }

    .filter-controls {
        position: fixed !important;
        top: 16px !important;
        right: 16px !important;
        left: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        z-index: 999 !important;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        pointer-events: none;
    }

    .filter-controls .filter-toggle-btn {
        width: 44px !important;
        height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
        border: 1.5px solid #e2e8f0 !important;
        background: #ffffff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        pointer-events: auto;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease;
    }

    .filter-controls .filter-toggle-btn:active {
        background: #e2e8f0 !important;
        transform: none !important;
    }

    .filter-controls .filter-toggle-btn svg {
        width: 20px;
        height: 20px;
    }

    .filter-controls .filter-toggle-btn:hover {
        background: #f8fafc !important;
    }

    .filter-controls .filter-toggle-btn span {
        display: none;
    }

    .filter-panel {
        min-width: 170px;
        max-width: 200px;
        padding: 12px 14px;
        right: auto;
        left: 0;
        margin-right: 0;
        transform-origin: top left;
        transform: scale(0.92) translateX(-20px);
        position: absolute;
        top: 0;
        right: 100%;
        left: auto;
    }

    .filter-panel.open {
        transform: scale(1) translateX(0);
    }

    .filter-tag-btn {
        padding: 4px 6px;
        font-size: 11px;
    }

    .leaflet-control-layers {
        position: fixed !important;
        top: 70px !important;
        right: 16px !important;
        left: auto !important;
        bottom: auto !important;
        margin: 0 !important;
        width: 44px !important;
        min-height: 44px !important;
        z-index: 1001 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
        border: 1.5px solid #e2e8f0 !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    .leaflet-control-layers-expanded {
        padding: 8px 10px !important;
        background: #ffffff !important;
        border-radius: 12px !important;
        min-width: 100px !important;
        font-size: 12px !important;
    }

    .leaflet-control-layers-toggle {
        width: 44px !important;
        height: 44px !important;
        margin: 0 !important;
        background-size: 18px !important;
        background-color: #ffffff !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        border-radius: 12px !important;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease;
    }

    .leaflet-control-layers-toggle:active {
        background-color: #e2e8f0 !important;
        transform: none !important;
    }

    .leaflet-control-layers-toggle:hover {
        background-color: #f8fafc !important;
    }

    .leaflet-control-layers-selector {
        margin-right: 4px !important;
    }

    .leaflet-control-layers-base label {
        font-size: 12px !important;
        color: #1e293b;
        padding: 2px 0;
        cursor: pointer;
        display: block !important;
    }

    .locate-control {
        position: fixed !important;
        bottom: 120px !important;
        right: 16px !important;
        left: auto !important;
        top: auto !important;
        margin: 0 !important;
        z-index: 1001 !important;
    }

    .locate-btn {
        width: 44px !important;
        height: 44px !important;
        margin: 0 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
        border: 1.5px solid #e2e8f0 !important;
        background: #ffffff !important;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease;
    }

    .locate-btn:active {
        background: #e2e8f0 !important;
        transform: none !important;
    }

    .locate-btn:hover {
        background: #f8fafc !important;
    }

    .leaflet-control-zoom {
        position: fixed !important;
        bottom: 16px !important;
        right: 16px !important;
        left: auto !important;
        top: auto !important;
        margin: 0 !important;
        width: 44px !important;
        z-index: 1001 !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
        border: 1.5px solid #e2e8f0 !important;
        overflow: hidden !important;
    }

    .leaflet-control-zoom a {
        width: 44px !important;
        height: 44px !important;
        line-height: 44px !important;
        margin: 0 !important;
        background: #ffffff !important;
        color: #1e293b !important;
        border: none !important;
        border-radius: 0 !important;
        font-size: 24px !important;
        font-weight: 300 !important;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease;
    }

    .leaflet-control-zoom a:first-child {
        border-radius: 0 !important;
        border-bottom: 1px solid #e9edf2 !important;
    }

    .leaflet-control-zoom a:last-child {
        border-radius: 0 !important;
    }

    .leaflet-control-zoom a:hover {
        background: #f8fafc !important;
    }

    .leaflet-control-zoom a:active {
        background: #e2e8f0 !important;
        transform: none !important;
    }

    .leaflet-control-zoom a,
    .locate-btn,
    .filter-toggle-btn,
    .leaflet-control-layers-toggle,
    .open-sidebar-btn,
    .profile-avatar-btn {
        -webkit-tap-highlight-color: transparent !important;
        outline: none !important;
        -webkit-touch-callout: none !important;
        user-select: none !important;
        transition: background 0.15s ease !important;
    }

    .leaflet-control-zoom a:focus,
    .locate-btn:focus,
    .filter-toggle-btn:focus,
    .leaflet-control-layers-toggle:focus,
    .open-sidebar-btn:focus,
    .profile-avatar-btn:focus {
        outline: none !important;
        box-shadow: none !important;
    }
}

@media (max-width: 400px) {
    .sidebar {
        width: 160px;
    }

    .point-item .point-brief {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

    .info-panel-content {
        padding: 12px;
    }

    .info-slider {
        height: 140px;
    }

    .image-fullscreen .fs-nav {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .image-fullscreen .fs-prev {
        left: 10px;
    }

    .image-fullscreen .fs-next {
        right: 10px;
    }
}

/* ===== Тосты ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    background: #1e293b;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: #10b981;
}

.toast-error {
    background: #ef4444;
}

.toast-info {
    background: #3b82f6;
}