label{
	width: 80px;
	height: 40px;
	position: relative;
	top: 20px;
	left: 20px;
	display: block;
	background: #ebebeb;
	border-radius: 40px;
	box-shadow: inset 0px 15px 15px
	rgba(0,0,0,0.4), inset 0px -5px 15px
	rgba(255,255,255,0.4);
	cursor: pointer;
	transition: 5s;
}

label::after{
	content: '';
	width: 36px;
	height: 36px;
	position: absolute;
	top: 2px;
	left: 2px;
	background: linear-gradient(80deg, #777, #3a3a3a);
	border-radius: 36px;
	box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.3);
	transition: 5s;
}

input{
	width: 0;
	height: 0;
	visibility: hidden;
}

input:checked + label{
	backgroun: rgba(110, 110, 120, 1);
}

input:checked + label::after{
	left: 78px;
	transform: translateX(-100%);
	background: linear-gradient(180deg, #ffcc89, #d8860b);
}

label:active::after{
	width: 70px;
}

.background{
	width: 100vw;
	height: 100vh;
	background: rgba(110, 110, 125, 1);
	z-index: -1;
	position: absolute;
	transition: 5s;
}

input:checked + label + .background{
	background: rgba(245, 245, 245, 1);
}

label svg{
	position: absolute;
	z-index: 100;
}

label svg.sun{
	left: 46px;
	width: 30px;
	fill: #7e7e7e;
	top: -380px;
	transition: 5s;
}

label svg.moon{
	left: 0px;
	width: 50px;
	fill: #fff ;
	top: -384px;
	transition: 5s;
}

input:checked + label svg.sun{
	fill: #fff 
}

input:checked + label svg.moon{
	fill:  #7e7e7e
}

.rf-map,
.rf-map *{
    box-sizing: border-box;
}

.rf-map {
	position: relative;
    height: 100%;
    min-height: 620px;
    margin: 0 auto;
	padding: 0 clamp(20px, 5vw, 100px);
}

.rf-map .district b {
    position: absolute;
    z-index: 5;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    left: 6px;
    top: 18px;
    transition: all 0.3s;
}

.rf-map .district span {
    position: absolute;
    z-index: 5;
    top: 20px;
    left: 30px;
    font-size: 13px;
    font-weight: bold;
    font-family: Tahoma, sans-serif;
    line-height: 1;
    color: #ffffff;
    background: #485563b5;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 10px;
    padding: 10px 18px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    white-space: nowrap;
}

.rf-map .district {
    display: none;
}

.rf-map.open .district b {
    top: 0;
    left: 0;
    border-radius: 0;
    width:100%;
    height: 100%;  
}

.rf-map.open .district span {
    color: #FFF;
}

.rf-map svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0px 0px 20px rgba(0, 0, 0, 0.5));    
}

.rf-map path {
    stroke: #FFFFFF;
    stroke-width: 8;
    stroke-linejoin: round; 
}

.rf-map [data-code] {
    fill: #337AB7;
    transition: fill 0.2s;
    cursor: pointer;
}

.rf-map [data-code]:hover {
    fill: #0180ef;
	
}

.rf-map .district-text {
    display: none;
    position: absolute;
    z-index: 6;
    left: 0;
    top: 60px;
    width: calc(100% - 20px);
    height: calc(100% - 90px);
    padding: 0 20px;
    overflow: auto;
    color: #FFF;
    font-size: 13px;
    font-family: Verdana, sans-serif;   
}

.rf-map .close-district {
    opacity: 0;
    z-index: 10;
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;    
    width: 40px;
    height: 40px;
    line-height: 1;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    transition: opacity 1s;
    pointer-events: none;
}

.rf-map.open .close-district {
    opacity: 1;
    pointer-events: initial;
}

.rf-map .district-links {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
}

.rf-map .district-links div {
    font-size: 13px;
    font-family: Verdana, sans-serif; 
    padding: 4px;
}

.rf-map .district-links div:after {
    content: " | ";
    color: #337AB7;
}

.rf-map .district-links div:last-child:after {
    content: "";
}

.rf-map-container .close-district {
    cursor: pointer;
    z-index: 10;
}

.rf-map-container {
    min-height: 700px;
    position: relative;
    background: transparent;
}

/* Компактный список проектов */
.region-projects-list {
    display: none;
    margin-top: 20px;
    padding: 0 20px 20px;
}

.region-projects-list .project-card-link.compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 16px;
    margin-bottom: 8px;
    background: var(--bg-glass-blur);
    border-radius: 8px;
    text-decoration: none;
    color: #ecf0f1;
    font-size: 15px;
    transition: background 0.2s;
}

.region-projects-list .project-card-link.compact:hover {
    background: rgba(255,255,255,0.5);
}

.compact-name {
    flex: 2;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-type {
    flex: 1;
    color: #bdc3c7;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-btn {
    flex: 0 0 auto;
    background: var(--button-default, #2a6cb6);
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    transition: background 0.2s;
}

.compact-btn:hover {
    background: var(--button-default-gradient-2, #1f4d8a);
}

.no-projects-msg {
    color: #aaa;
    font-style: italic;
    padding: 10px 16px;
}

.projects-total-bottom {
    display: inline-block;
    margin: 50px auto 30px auto;
    padding: 24px 56px;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.03em;
    background: rgba(52, 73, 94, 0.954);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    color: #ecf0f1;
}

.map-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width:768px){
    .rf-map .district b {
        width: 28px;
        height: 28px;    
        left: 6px;
        top: 28px;
    }
    .rf-map .district span {
        top: 30px;
        left: 46px;
        font-size: 20px;
        font-weight: normal;
    }
    .rf-map .district-text {
        left: 30px;
        top: 80px;
        width: calc(100% - 60px);
        height: calc(100% - 130px);
        font-size: 16px; 
    }
    .rf-map .close-district {  
        width: 60px;
        height: 60px;
        font-size: 60px;
    }
    .rf-map .district-links {
        display: none;
    }
}

/* стили для new_territory_map.css */
.region-popup {
    position: fixed;
    background: rgba(0, 25, 51, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(91, 234, 139, 0.25);
    border-radius: 18px;
    padding: 12px 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    max-width: 300px;
    font-size: 8px;
    font-family: Verdana, Tahoma, Arial, sans-serif;
    color: #ecf0f1;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.region-popup.visible {
    opacity: 1;
}

.region-popup-title {
    margin: 0 0 12px 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-light, #FFFFFF);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
}

.region-popup-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.region-popup-item {
    margin-bottom: 8px;
}

.region-popup-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    text-decoration: none;
    color: #bdc3c7;
    font-size: 12px;
    transition: background 0.2s, color 0.2s;
}

.region-popup-link:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.back-to-federal {
    position: absolute;
    top: 15px;
    left: 20px;
    z-index: 10;
    padding: 16px 32px;
    background:linear-gradient(135deg,var(--button-default-gradient-2), var(--button-default));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ecf0f1;
    font-size: 14px;
    font-family: Verdana, Tahoma, Arial, sans-serif;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.back-to-federal:hover {
    background: rgba(0, 25, 51, 1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.rf-map [data-code].selected {
    fill: #519837 !important;
    stroke: #ffffff;
    stroke-width: 8;
}