/* Стили для страницы добавления велодорожки */

body {
    background-color: var(--bg1);
    margin: 0;
    padding: 0;
}










.city-select:focus {
    outline: none;
    border-color: var(--accent80)
}



.form-input, .form-textarea {
    width: 100%;
    padding: 1rem;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: var(--spacer-m);
    line-height: 20px;
    font-weight: 400;
    background: var(--bg3);
    color: var(--secondary100);
    appearance: none;
}

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

.form-input::placeholder, .form-textarea::placeholder {
    color: #999;
}

/* Карта */
#map {
    height: 300px;
    width: 100%;
    border-radius: var(--spacer-m)
}

.map-container {
    position: relative;
}

.map-drawer-trigger {
    display: none;
    margin-bottom: var(--spacer-s);
}

.map-drawer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.map-drawer.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.map-drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 28, 34, 0.48);
}



.map-drawer-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacer-s);
    padding: var(--spacer-s) var(--spacer-m) 160px var(--spacer-m);
    background: var(--bg1);
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    max-height: min(88vh, 760px);
}

.map-drawer.is-open .map-drawer-sheet {
    transform: translateY(0);
}

.map-drawer-handle {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: var(--secondary30);
    margin: 0 auto;
}

.map-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacer-s);
}

.map-drawer-header h3 {
    margin: 0;
}

.map-drawer-subtitle {
    margin: 4px 0 0;
    color: var(--secondary100);
    font-size: 14px;
    line-height: 18px;
}

.map-drawer-close {
    flex-shrink: 0;
}

.map-drawer-body {
    overflow-y: auto;
    min-height: 0;
}

.map-drawer-content {
    display: flex;
    flex-direction: column;
}

.map-drawer-open {
    overflow: hidden;
}

.geometry-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.geometry-status.valid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.geometry-status.invalid {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.geometry-status.info {
    position: fixed;
    bottom: 100px;
    left: var(--spacer-m);
    background:var(--bg4);
    color: var(--prime100);
    width: calc(100vw - 32px);
    max-width: 400px;
    left: 50%;
    transform: translateX(-50%);
}

/* Типы велодорожек */
.track-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.track-type-option {
    position: relative;
    cursor: pointer;
}

.track-type-option:hover{
    background-color: var(--secondary10);
}

.track-type-option input[type="radio"] {
    display: none;
}

.track-type-card {
    display: flex;
    flex-direction: column;
    padding: var(--spacer-s);
    align-items: center;
    gap: var(--spacer-xs);
    height: 120px;
    width: 100%;
    
}



.track-type-option input[type="radio"]:checked + .track-type-card {
    background-color: var(--accent80);
    border-radius: var(--spacer-m);
}

.track-icon {
    width: 60px;
    height: 60px;
}

.track-title {
    color: var(--prime100);
    text-align: center;
}

/* Рейтинг качества */
.quality-rating {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.rating-option {
    flex: 1;
    position: relative;
}

.rating-option input[type="radio"] {
    display: none;
}

.rating-icon{
    display: none;
    width: 28px;
    height: 28px;
    border-radius: 100%;
    background: var(--prime100);
}

.rating-star {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacer-xs);
}

.rating-icon-bg{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 100%;
    background: var(--secondary20);
}




.rating-option input[type="radio"]:checked + .rating-star .rating-icon {
    display: block;
    
}



.rating-text {
    font-size: 12px;
    line-height: 15px;
}

/* Загрузка медиа */
.media-upload {
    margin-bottom: 1.5rem;
}

.upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.upload-area:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.upload-subtext {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.upload-limit {
    font-size: 0.8rem;
    color: #999;
}

.photos-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.photo-preview {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.toast-container {
    position: fixed;
    top: var(--spacer-m);
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100vw - 24px), 560px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10020;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px var(--spacer-m);
    border-radius: var(--spacer-m);
    background: rgba(18, 18, 18, 0.96);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    transform: translateY(-8px);
    opacity: 0;
    animation: toast-in 0.2s ease forwards;
}

.toast.toast-error {
    background: #c0392b;
}

.toast.toast-success {
    background: #1f7a4d;
}

.toast.toast-info {
    background: rgba(18, 18, 18, 0.96);
}

.toast-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-line;
}

.toast-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    to {
        transform: translateY(-8px);
        opacity: 0;
    }
}

/* Кнопка отправки */
.submit-section {
    background-color: var(--bg1);
    position: fixed;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    padding: 12px 12px 24px 12px;
    border-top: 1px solid var(--bg3);
    border-radius: 24px 24px 0px 0px;
    z-index: 2;
}

#submit-bikelane-btn:disabled {
    cursor: not-allowed;
}





/* Скрытые элементы */
.hidden {
    display: none;
}
/* Стили для отображения дистанции */
.distance-display {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
}

.distance-label {
    font-weight: 600;
    margin-right: 8px;
}

.distance-value {
    color: #3498db;
    font-weight: 700;
    font-size: var(--spacer-m);
}

/* Стили для отображения дистанции */
.distance-display {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
}

.distance-label {
    font-weight: 600;
    margin-right: 8px;
}

.distance-value {
    color: #3498db;
    font-weight: 700;
    font-size: var(--spacer-m);
}

.map-controls {
    display: flex;
    left: var(--spacer-m);
    gap: var(--spacer-s);
    margin-top: var(--spacer-s);
}

.map-control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 var(--spacer-m);
    border-radius: var(--spacer-m);
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

.map-control-btn:active {
    transform: translateY(0);
}

/* Тоггл для парковки */
.toggle-container {
    padding: 12px 0;
}

.toggle-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-text {
    font-size: var(--spacer-m);
    color: var(--prime100);
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 28px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Отображение качества велодорожки */
.quality-result {
    text-align: center;
    padding: 20px;
}

.quality-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: var(--spacer-m);
    font-size: 32px;
}

.quality-star {
    color: #f39c12;
}

.quality-star.empty {
    color: #ddd;
}

.quality-description {
    font-size: var(--spacer-m);
    color: var(--secondary100);
    line-height: 1.5;
    margin: 0;
}

.quality-breakdown {
    margin-top: var(--spacer-m);
    text-align: left;
    background: var(--bg3);
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

.quality-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: var(--secondary80);
}

.quality-breakdown-value {
    font-weight: 600;
    color: var(--prime100);
}

@media (max-width: 768px) {
    .map-drawer-trigger {
        display: flex;
    }

    #map-inline-anchor {
        display: none;
    }

    #map {
        height: min(52vh, 460px);
    }

    .map-controls {
        position: fixed;
        width: calc(100vw - 32px);
        bottom: var(--spacer-m);
        z-index: 10;
        padding-top: var(--spacer-s);
        background: linear-gradient(to top, var(--bg1), rgba(255, 255, 255, 0));
    }

    .map-control-btn {
        min-height: 48px;
    }

    .geometry-status.info {
        bottom: 80px;;
    }
}

@media (min-width: 769px) {
    .map-drawer {
        display: none;
    }
}
