* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

#map {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

/* Скрываем копирайты Яндекс Карт */
.ymaps-2-1-79-copyright,
.ymaps-2-1-79-copyright__link,
.ymaps-2-1-79-copyrights-pane,
.ymaps-2-1-79-copyright_logo_no,
.ymaps-2-1-79-map-copyrights-promo,
[class*="copyright"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Кнопка центрирования на местоположении (как в навигаторе) */
.location-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #333;
    position: relative;
}

.location-btn:hover {
    background: #f8f9fa;
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.location-btn:active {
    transform: scale(0.9);
}

.location-btn svg {
    width: 22px;
    height: 22px;
    fill: #333;
}

/* Стрелка-компас в кнопке */
.location-btn::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid #4CAF50;
}

/* Кнопка меню */
.menu-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #333;
    backdrop-filter: blur(10px);
}

.menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Боковое меню */
.side-menu {
    position: absolute;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    z-index: 2000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    left: 0;
}

.menu-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.menu-header h3 {
    margin: 0;
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.close-menu {
    background: none;
    border: none;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: transform 0.3s;
}

.close-menu:hover {
    transform: rotate(90deg);
}

.menu-items {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.menu-item {
    padding: 15px;
    border: none;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-size: 16px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.menu-item:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.menu-item svg {
    flex-shrink: 0;
    transition: transform 0.3s;
}

.menu-item:hover svg {
    transform: scale(1.1);
}

/* Панели секций */
.section-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1500;
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.section-panel h3 {
    margin-bottom: 25px;
    color: #333;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

/* Красивые поля ввода */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8f9fa;
    color: #333;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-field::placeholder {
    color: #999;
}

/* Красивые кнопки */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

/* Кнопки записи */
#recordControls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.record-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.record-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.record-btn.stop {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.record-btn.save {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.record-btn.discard {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.3);
}

/* Панель воспроизведения */
#playbackControls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

#playbackControls button {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

#playbackControls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.speed-control input[type="range"] {
    width: 100px;
    -webkit-appearance: none;
    height: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    outline: none;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #667eea;
    cursor: pointer;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.3s;
    background: #f8f9fa;
}

.close:hover {
    background: #e9ecef;
    color: #000;
    transform: rotate(90deg);
}

/* Фильтры */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.filter-buttons button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Список маршрутов */
.route-item {
    padding: 15px;
    margin-bottom: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.route-item:hover {
    background: white;
    border-color: #667eea;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.route-info {
    margin-bottom: 10px;
}

.route-actions {
    display: flex;
    gap: 10px;
}

.route-actions button {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.copy-link {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.delete-route {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

/* Профиль */
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f8f9fa;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 5px;
    font-size: 12px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-avatar:hover .avatar-overlay {
    opacity: 1;
}

/* Скрытый input file */
.hidden-input {
    display: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    #recordControls {
        width: 90%;
        bottom: 20px;
    }
    
    .record-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .section-panel {
        width: 95%;
        padding: 20px;
    }
    
    #playbackControls {
        width: 90%;
        bottom: 20px;
        padding: 15px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
}

/* Кнопка центрирования на местоположении */
.location-btn {
    position: absolute;
    top: 80px;
    right: 15px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #333;
}

.location-btn:hover {
    background: #f8f9fa;
    border-color: #4CAF50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.location-btn:active {
    transform: scale(0.9);
}

.location-btn svg {
    width: 22px;
    height: 22px;
}

/* Кнопка Яндекс Навигатора */
.btn-yandex {
    background: linear-gradient(135deg, #FFCC00 0%, #FFB800 100%);
    color: #333;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
}

.btn-yandex:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.4);
}

/* Контейнер для кнопок поделиться */
.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}