/* --- Общие стили --- */
body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #fff;
    font-family: "opinion_pro_condensedlight", "Helvetica Neue", sans-serif;
    -webkit-tap-highlight-color: transparent;
}
@font-face {
    font-family: "opinion_pro_condensedlight";
    src: url("assets/fonts/opinionprocondensed-light-webfont.eot");
    src:
        url("assets/fonts/opinionprocondensed-light-webfont.eot?#iefix")
            format("embedded-opentype"),
        url("assets/fonts/opinionprocondensed-light-webfont.woff2")
            format("woff2"),
        url("assets/fonts/opinionprocondensed-light-webfont.woff")
            format("woff"),
        url("assets/fonts/opinionprocondensed-light-webfont.ttf")
            format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
#map-container {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: grab;
}

#map-canvas {
    display: block;
    background-color: #ffffff;
}

/* --- Кнопки Zoom --- */
.zoom-controls {
    position: absolute;
    right: 20px;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.zoom-controls button {
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 50%;
    border: 1px solid #264162;
    background-color: white;
    cursor: pointer;
    color: #264162;
    transition:
        background-color 0.2s,
        color 0.2s,
        border-color 0.2s;
    opacity: 0.8;
}
.zoom-controls button#zoom-out span {
    position: relative;
    top: -1px;
}

.zoom-controls button:hover {
    border-color: #e73547;
    color: #e73547;
    /* background-color: #264162;
    color:#fff; */
}

.zoom-controls button:disabled,
.zoom-controls button:disabled:hover {
    background-color: #f0f0f0;
    color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.logo {
    position: absolute;
    left: 20px;
    top: 20px;
    outline: none;
}
.logo img {
    height: 90px;
}
.logoproject {
    position: absolute;
    left: 50%;
    top: 5px;
    margin-left: -244px;
    outline: none;
}
.button-project {
    position: absolute;
    left: 50%;
    top: 132px;
    margin-left: -37px;
    background: #264164;
    color: #fff;
    font-size: 17px;
    padding: 9px 32px;
    border-radius: 7px;
    text-decoration: none;
    -webkit-transition: background-color .5s;
    -moz-transition: background-color .5s;
     -o-transition: background-color .5s;
    transition: background-color .5s; 
}
.button-project:hover {
    background: #0f1f33;
}
/* --- Элементы редактора и ссылки --- */
#editor-controls {
    position: absolute;
    left: 20px;
    top: 20px;
    display: none; /* по умолчанию скрыты, показываются JS */
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

#editor-controls button {
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: #e9f5ff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.editor-link-btn {
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background-color: white;
    color: #333;
    text-decoration: none;
    text-align: center;
    display: block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- Модальные окна --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 600px;
    position: relative;
    max-height: 80%;
    overflow: auto;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
}

#modal-title {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* --- Форма редактора --- */
#editor-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#editor-form label {
    font-weight: bold;
    font-size: 14px;
}
#editor-form input[type="text"],
#editor-form input[type="url"],
#editor-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}
#editor-form .form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}
#editor-form button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#editor-form button[type="submit"] {
    background-color: #28a745;
    color: white;
}
#editor-form .delete-btn {
    background-color: #dc3545;
    color: white;
    margin-right: auto;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.radio-group {
    display: flex;
    align-items: center;
    gap: 15px;
}
.radio-group input[type="radio"] {
    margin-right: -10px;
}
.radio-group label {
    font-weight: normal;
}

/* --- Вывод JSON --- */
#json-output {
    width: 100%;
    box-sizing: border-box;
    font-family: monospace;
    font-size: 14px;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* --- Подписи на карте (HTML) --- */
#labels-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.label-element {
    position: absolute;
    background-color: transparent;
    padding: 3px 0;
    font-size: 13px;
    color: black;
    white-space: normal;
    max-width: 300px;
    text-align: left;
    pointer-events: all;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    will-change: transform;
    line-height: 1;
    outline: none;
}

.label-element:hover,
.label-element.hovered {
    color: #e73547;
    border-color: #e73547;
    outline: none;
}

.label-element.label-large {
    font-size: 27px;
}

/* Позиционные классы для подписей */
.label-pos-top-right {
    border-bottom: 1px solid #000;
}
.label-pos-top-left {
    border-bottom: 1px solid #000;
}
.label-pos-bottom-right {
    border-bottom: 1px solid #000;
}
.label-pos-bottom-left {
    border-bottom: 1px solid #000;
}

@keyframes swing {
    0% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(10deg);
    }
    40% {
        transform: rotate(-8deg);
    }
    60% {
        transform: rotate(5deg);
    }
    80% {
        transform: rotate(-5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.logo:hover {
    animation: swing 0.8s ease-in-out;
    transform-origin: top center;
}

@media screen and (max-width: 720px) {
    .logo img {
        height: 80px;
    }
    .logoproject {
        top: 18px;
        margin-left: -172px;
    }
    .logoproject img {
        height: 80px;
    }
}
@media screen and (max-width: 535px) {
    .logo img {
        height: 67px;
    }
    .logoproject {
        top: 18px;
        margin-left: -128px;
    }
    .logoproject img {
        height: 60px;
    }
}
@media screen and (max-width: 430px) {
    .logo {
        left: 10px;
        top: 10px;
    }
    .logo img {
        height: 49px;
    }
    .logoproject {
        top: 11px;
        margin-left: -90px;
    }
    .logoproject img {
        height: 42px;
    }
    .zoom-controls {
        right: 10px;
        top: 10px;
    }
}
