/* ============================================
   ОБЩИЕ СТИЛИ
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* ============================================
   ЭКРАНЫ (SCREENS)
   ============================================ */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

.screen.d-none {
    display: none !important;
}

/* Плавные переходы между экранами */
.screen {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   ЭКРАН АВТОРИЗАЦИИ
   ============================================ */
.auth-background {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.auth-form {
    transition: opacity 0.3s ease-in-out;
}

.auth-form.d-none {
    display: none !important;
}

.auth-form.active {
    display: block;
}

/* ============================================
   НАВИГАЦИЯ
   ============================================ */
.navbar {
    z-index: 1000;
}

.navbar-nav .nav-link {
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ============================================
   ПОЛНОЭКРАННАЯ КАРТА (MapLibre GL JS)
   ============================================ */
.map-container-fullscreen {
    position: relative;
    width: 100%;
    height: calc(100vh - 56px); /* 100vh минус высота навбара */
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Стили для маркеров MapLibre */
.custom-marker {
    background-image: url('https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 40px;
    cursor: pointer;
    transition: transform 0.2s;
}

.custom-marker:hover {
    transform: scale(1.1);
}

/* Стили для элементов управления MapLibre */
.maplibregl-ctrl-group {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.maplibregl-popup-content {
    border-radius: 8px;
    padding: 10px;
}

/* ============================================
   КАРТОЧКА МЕСТА
   ============================================ */
.place-card {
    position: absolute;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    border-radius: 12px !important;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.place-card .card-header {
    border-radius: 12px 12px 0 0 !important;
}

/* Адаптивность карточки */
@media (max-width: 768px) {
    .place-card {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ============================================
   СТРАНИЦЫ (PAGES)
   ============================================ */
.page {
    display: none;
    min-height: calc(100vh - 56px);
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.page.d-none {
    display: none !important;
}

/* ============================================
   СПИСОК МАРШРУТА
   ============================================ */
.route-item {
    background: #f8f9fa;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInUp 0.3s ease-out;
    transition: transform 0.2s;
}

.route-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.route-item-info h4 {
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.route-item-info p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* ============================================
   КНОПКИ И ИНТЕРФЕЙС
   ============================================ */
.btn {
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
@media (max-width: 768px) {
    .map-container-fullscreen {
        height: calc(100vh - 56px);
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    #username-display {
        font-size: 0.9rem;
    }
}

/* ============================================
   УТИЛИТЫ
   ============================================ */
.shadow-lg {
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
}

/* Плавная прокрутка */
html {
    scroll-behavior: smooth;
}

/* Скрытие скроллбара для карты */
.map-container-fullscreen::-webkit-scrollbar {
    display: none;
}

.map-container-fullscreen {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
