* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Оверлейная панель */
.sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 360px;
    max-height: calc(100vh - 40px);
    /*background: rgba(255, 255, 255, 0.95);*/
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-340px);
}

.sidebar-header {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    color: #333;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-content {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

/* Карточка точки */
.point-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

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

.point-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.point-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding-right: 30px;
}

.point-number {
    background: #007AFF;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex; 
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 10px;
}

.point-address {
    font-weight: 500;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.point-content {
    display: flex;
}

.point-city {
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
}

.point-street {
    font-size: 0.95em;
    color: #666;
    margin-top: 2px;
}

.point-place {
    font-size: 0.9em;
    color: #888;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #eee;
}

.point-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #999;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.point-delete:hover {
    background: #ff3b30;
    color: white;
}

.point-info {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #666;
}

.point-info-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.point-info-item span:first-child {
    color: #999;
}

/* Итоговая информация */
.summary {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item span:first-child {
    color: #666;
}

.summary-item span:last-child {
    font-weight: 600;
    color: #007AFF;
}

/* Кнопка очистки */
.clear-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 30px;
    color: #ff3b30;
    font-weight: 500;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.clear-btn:hover {
    background: #ff3b30;
    color: white;
    border-color: #ff3b30;
}

/* Индикатор загрузки */
.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #ccc;
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        width: 300px;
    }
    
    .sidebar.collapsed {
        transform: translateX(-280px);
    }
}

/* Контекстное меню */
.context-menu {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 220px;
    z-index: 10000;
    display: none;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    font-size: 14px;
    color: #333;
}

.context-menu-item:hover {
    background: rgba(0, 102, 204, 0.1);
}

.context-menu-item:active {
    background: rgba(0, 102, 204, 0.2);
}

.context-menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.context-menu-text {
    flex: 1;
}

/* Темная тема (если будет) */
.dark-theme .context-menu {
    background: rgba(40, 40, 45, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dark-theme .context-menu-item {
    color: #eee;
}

.dark-theme .context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}