/* Общие стили для всей страницы */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Стили для шапки (хедера) */
header {
    background-color: #4a90e2;
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    text-align: left;
}

/* Основной контейнер с плоскостью и панелью управления */
main {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Координатная плоскость */
.plane {
    flex: 1;
    background-color: #1a1a1a;
    position: relative;
    cursor: crosshair;
    overflow: hidden;
    min-height: 500px;
}

/* Центральная точка */
.center-point {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    border: 3px solid #333;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    z-index: 30;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

/* Линии */
.line {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}

.line-north {
    width: 6px;
    background-color: #00ff00;
}

.line-south {
    width: 6px;
    background-color: #ffff00;
}

.line-west {
    height: 6px;
    background-color: #808080;
}

.line-east {
    height: 6px;
    background-color: #ff0000;
}

/* Буквы сторон света */
.direction-label {
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    z-index: 20;
    pointer-events: none;
    text-shadow: 0 0 5px black;
    transform: translate(-50%, -50%);
}

.label-north { color: #00ff00; }
.label-south { color: #ffff00; }
.label-west { color: #808080; }
.label-east { color: #ff0000; }

/* Контейнер для пользовательских точек */
.points-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 40;
    pointer-events: none;
}

/* Стили для пользовательской точки */
.user-point {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid #000000;
    z-index: 50;
}

.user-point:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 60;
}

.user-point.selected {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 0 3px white, 0 0 15px currentColor;
    z-index: 70;
}

.user-point.color-north { background-color: #00ff00; }
.user-point.color-south { background-color: #ffff00; }
.user-point.color-west { background-color: #808080; }
.user-point.color-east { background-color: #ff0000; }

/* Индикатор координат мыши */
.mouse-coordinates {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.5em;
    font-weight: bold;
    border: 2px solid #4a90e2;
    z-index: 100;
    pointer-events: none;
    text-align: center;
}

/* Панель управления */
.control-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 340px;
    background-color: rgba(44, 62, 80, 0.95);
    color: white;
    border-radius: 10px;
    border: 2px solid #4a90e2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 200;
    backdrop-filter: blur(5px);
    transition: width 0.3s ease;
    overflow: hidden;
}

.control-panel.collapsed {
    width: 60px;
}

.control-panel.collapsed .panel-content {
    display: none;
}

.control-panel.collapsed .panel-header {
    padding: 15px 10px;
    justify-content: center;
}

.control-panel.collapsed .panel-header h3 {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #4a90e2;
    cursor: pointer;
    border-bottom: 2px solid #357abd;
}

.panel-header h3 {
    margin: 0;
    color: white;
    font-size: 1.2em;
    white-space: nowrap;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

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

/* Форма в панели */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ecf0f1;
    font-weight: bold;
}

.form-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #34495e;
    border-radius: 5px;
    background-color: #34495e;
    color: white;
    font-size: 1em;
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: #4a90e2;
}

/* Опции цвета */
.color-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
}

.color-option:hover {
    background-color: #34495e;
}

.color-option input[type="radio"] {
    cursor: pointer;
}

.color-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid black;
}

.color-badge.color-north { background-color: #00ff00; }
.color-badge.color-south { background-color: #ffff00; }
.color-badge.color-west { background-color: #808080; }
.color-badge.color-east { background-color: #ff0000; }

/* Кнопки */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 20px;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background-color: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.9em;
    width: auto;
    margin-bottom: 0;
}

.btn-edit {
    background-color: #f39c12;
    color: white;
    padding: 5px 10px;
    font-size: 0.8em;
    margin-right: 5px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-edit:hover {
    background-color: #e67e22;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    font-size: 0.8em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.btn-delete:hover {
    background-color: #c0392b;
}

/* Группа кнопок */
.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.button-group .btn {
    margin-bottom: 0;
}

/* Список точек */
.points-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 10px;
}

.points-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid #34495e;
    border-radius: 5px;
    padding: 10px;
}

.empty-list {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
    font-style: italic;
}

.point-item {
    background-color: #34495e;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.point-item:hover {
    background-color: #3d566e;
}

.point-item.selected {
    background-color: #4a90e2;
    border-left: 4px solid white;
}

.point-info {
    flex: 1;
}

.point-coords {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin-bottom: 5px;
}

.point-color-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
    border: 1px solid black;
}

.point-actions {
    display: flex;
    gap: 5px;
}

/* Подвал */
footer {
    background-color: #333;
    color: white;
    padding: 12px 20px;
}

.copyright {
    font-size: 1em;
    text-align: left;
}

/* Уведомления */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 1em;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.notification.success {
    background-color: #27ae60;
    color: white;
    border-left: 5px solid #2ecc71;
}

.notification.error {
    background-color: #e74c3c;
    color: white;
    border-left: 5px solid #c0392b;
}

.notification.info {
    background-color: #3498db;
    color: white;
    border-left: 5px solid #2980b9;
}

/* Индикатор загрузки */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 1.2em;
    z-index: 2000;
    border: 2px solid #4a90e2;
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.5);
}

/* Анимация */
@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Элементы управления масштабом */
.zoom-controls {
    background-color: #34495e;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}

.zoom-controls button {
    margin: 0;
}

.zoom-controls span {
    min-width: 60px;
    text-align: center;
}

.zoom-hint {
    border-top: 1px solid #4a90e2;
    margin-top: 8px;
    padding-top: 8px;
    font-size: 12px;
    color: #ecf0f1;
    width: 100%;
    text-align: center;
}

/* Контейнер для линий */
.lines-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 35;
}

/* Стили для SVG линий */
.point-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Анимация для линий (опционально) */
@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

.point-line line {
    animation: dash 20s linear infinite;
}