/* ===== editor.css - Все стили редактора ===== */

* { box-sizing: border-box; margin: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #1a1a1a;
    color: #fff;
    padding: 20px;
}

.container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 40px);
}

.canvas-area {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #2a2a2a;
    border-radius: 8px;
    cursor: crosshair;
}

.canvas-container.panning { cursor: grabbing; }

canvas {
    display: block;
    position: absolute;
    transform-origin: 0 0;
}

.controls {
    flex: 1;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
}

button {
    background: #4a6fa5;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px;
    transition: all 0.2s;
}

button:hover { background: #5f8bc9; }

button.active {
    background: #4aa56a;
    box-shadow: 0 0 10px rgba(74, 165, 106, 0.5);
}

button.danger { background: #a54a4a; }
button.danger:hover { background: #c95f5f; }
button.success { background: #4aa56a; }
button.info { background: #6a4a9a; }

input, textarea, select {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background: #333;
    border: 1px solid #555;
    color: white;
    border-radius: 6px;
}

textarea { min-height: 60px; resize: vertical; }

select { cursor: pointer; }
select option { background: #333; }

.mode-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.mode-buttons button { flex: 1; }

.status {
    background: #333;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    color: #8ab4f8;
}

.hint {
    font-size: 12px;
    color: #aaa;
    margin: 10px 0;
    line-height: 1.5;
}

.object-list {
    max-height: 300px;
    overflow-y: auto;
    background: #222;
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
}

.object-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #3a3a3a;
    border-radius: 6px;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: all 0.2s;
}

.object-item:hover { background: #4a4a4a; }

.object-item.selected {
    background: #4a6fa5;
    border-left-color: #8ab4f8;
}

.object-item.key {
    border-left-color: #ffd700;
    background: linear-gradient(90deg, #4a3a00 0%, #3a3a3a 100%);
}

.object-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.object-name {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.key-badge {
    background: #ffd700;
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
}

.object-question {
    font-size: 13px;
    color: #bbb;
    margin: 5px 0;
    font-style: italic;
}

.object-coords {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    padding: 5px;
    background: #2a2a2a;
    border-radius: 4px;
    font-family: monospace;
}

.center-coords { color: #8ab4f8; font-weight: bold; }

.points-coords {
    max-height: 60px;
    overflow-y: auto;
    margin-top: 3px;
    padding: 3px;
    background: #222;
    border-radius: 3px;
}

.delete-btn {
    background: #a54a4a;
    padding: 4px 10px;
    font-size: 12px;
}

.editing-indicator {
    background: #d4a54a;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-group input {
    width: auto;
    margin-right: 10px;
    transform: scale(1.3);
}

.zoom-info { font-family: monospace; color: #aaa; }
.coords { font-family: monospace; font-size: 12px; }

.folder-input-wrapper { margin-bottom: 10px; }

.image-selector {
    display: flex;
    gap: 5px;
    align-items: center;
    margin: 10px 0;
}

.image-selector select { flex: 1; }

.image-info {
    background: #3a3a3a;
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 12px;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #2a2a2a;
    padding: 25px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80%;
    overflow: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 { margin: 0; color: #9cb4d4; }

.modal-close {
    background: #a54a4a;
    padding: 5px 12px;
    font-size: 18px;
}

.json-viewer {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
    color: #8ab4f8;
    margin-top: 10px;
    max-height: 500px;
    overflow: auto;
}

.form-group { margin-bottom: 15px; }

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #aaa;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button { flex: 1; }

.polygon-info {
    background: #333;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #8ab4f8;
}
