@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #f8f9fa; --card-bg: #f3f3f3; --text-color: #212529; --text-muted: #6c757d;
    --border-color: #dee2e6; --primary-color-start: #6ea8de; --primary-color-end: #5b98d1;
    --primary-text: #ffffff; --danger-color: #d97a7a; --success-color-start: #7ac59b;
    --success-color-end: #63b49b; --add-point-start: #d4c2f2; --add-point-end: #c4b3e6;
    --font-family: 'Inter', sans-serif;
}

/* ... Vizuālā punkta stils paliek nemainīgs ... */
@keyframes pulse { 0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(217, 122, 122, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(217, 122, 122, 0); } 100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(217, 122, 122, 0); } }
.preview-dot { width: 20px; height: 20px; background-color: var(--danger-color); border-radius: 50%; border: 2px solid white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); animation: pulse 1.5s infinite; }

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font-family); background-color: var(--bg-color); margin: 0; color: var(--text-color); display: flex; flex-direction: column; }

.header {
    padding: 20px 30px;
    background-color: #1f1f1f;
    color: #ffffff;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
}

/* === LOGO STILS HEADER === */
.header h1 {
    display: flex;
    align-items: center; /* Centrē ikonu vertikāli ar tekstu */
}

.header h1 .fa-cube {
    font-size: 1.3em; /* Padara ikonu nedaudz lielāku par tekstu */
    margin-right: 15px; /* Atstarpe starp ikonu un tekstu */
    opacity: 0.8; /* Nedaudz maigāks tonis, lai nelektu acīs */
    padding-bottom: 2px; /* Vizuāla korekcija perfektai centrēšanai */
}

/* === JAUNA ANIMĀCIJA LOGO IKONAI === */
@keyframes slow-spin {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

.header h1 .fa-cube {
    animation: slow-spin 15s linear infinite; /* Animācija ilgst 15 sekundes un atkārtojas bezgalīgi */
    transform-style: preserve-3d; /* Nodrošina plūdenāku 3D rotāciju */
}

.header h1 { margin: 0; font-size: 1.5em; font-weight: 600; }
.main-container { display: flex; gap: 30px; padding: 30px; height: 100%; overflow: hidden; }
.content-column { background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 3px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.column-header { padding: 20px 25px; border-bottom: 1px solid var(--border-color); flex-shrink: 0; display: flex; align-items: center; gap: 12px; }
.column-header h2 { margin: 0; font-size: 1.2em; font-weight: 500; }
.column-content { padding: 25px; overflow-y: auto; }
.editor-column { flex: 3; min-width: 450px; }
.list-column { flex: 2; min-width: 350px; }
input[type="text"], input[type="number"], select { width: 100%; padding: 12px; margin-bottom: 15px; border-radius: 3px; border: 1px solid var(--border-color); font-size: 16px; background-color: #ffffff; color: var(--text-color); font-family: var(--font-family); }
select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236c757d%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E'); background-repeat: no-repeat; background-position: right 12px center; background-size: 8px 10px; }
label { display: block; margin-bottom: 5px; font-weight: 500; color: var(--text-muted); }
input[type="text"]:focus, input[type="number"]:focus, select:focus { outline: none; border-color: var(--primary-color-end); box-shadow: 0 0 0 3px rgba(91, 152, 209, 0.2); }
input[type="file"] { margin-bottom: 15px; }
.btn { padding: 12px 20px; border: 1px solid rgba(0, 0, 0, 0.1); border-radius: 3px; cursor: pointer; font-weight: 500; font-size: 16px; transition: all 0.2s ease-in-out; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn:hover { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); transform: scale(1.02); filter: brightness(1.05); }
.btn:active { transform: scale(0.98); box-shadow: none; }
.btn-primary { background-image: linear-gradient(to top, var(--primary-color-end), var(--primary-color-start)); color: var(--primary-text); width: auto; }
.editor-column .column-content > .btn-add { background-image: linear-gradient(to top, var(--success-color-end), var(--success-color-start)); color: var(--primary-text); }
.card .btn-add { background-image: linear-gradient(to top, var(--add-point-end), var(--add-point-start)); color: var(--text-color); }
.btn-icon { background: none; border: none; padding: 5px; width: auto; font-size: 18px; color: var(--text-muted); transition: color 0.2s ease; }
.btn-icon:hover { color: var(--text-color); }
.btn-icon.danger:hover { color: var(--danger-color); }
.card { background: #fdfdfd; border-radius: 3px; padding: 25px; margin-bottom: 20px; border: 1px solid var(--border-color); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header h3 { margin: 0; }
.hotspot { border-left: 3px solid #b3cde4; padding-left: 20px; margin: 25px 0; }
.tour-item-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; }
.tour-item-actions .btn-primary { width: auto; }

.code-header { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; margin-bottom: -5px; }
.code-header p { margin: 0; }
code { background-color: #e9ecef; color: #333; padding: 12px; display: block; white-space: pre-wrap; word-break: break-all; border-radius: 3px; margin-top: 10px; font-family: monospace; }
.copy-btn-small { padding: 6px 12px; border-radius: 3px; background-color: #f0f2f5; border: 1px solid #d9dbde; color: var(--text-muted); font-size: 14px; font-weight: 500; cursor: pointer; overflow: hidden; transition: all 0.3s ease-in-out; position: relative; width: 110px; height: 32px; }
.copy-btn-small:hover { background-color: #e4e6eb; border-color: #c9cdd1; }
.copy-btn-small > span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); transition: all 0.3s ease-in-out; display: flex; align-items: center; gap: 6px; }
.copy-btn-small .copy-icon { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
.copy-btn-small .copied-feedback { opacity: 0; transform: translate(-50%, -50%) translateY(20px); color: var(--success-color-end); }
.copy-btn-small.copied { background-color: #e6f7ec; border-color: var(--success-color-start); }
.copy-btn-small.copied .copy-icon { opacity: 0; transform: translate(-50%, -50%) translateY(-20px); }
.copy-btn-small.copied .copied-feedback { opacity: 1; transform: translate(-50%, -50%) translateY(0); }

hr { margin: 30px 0; border: none; border-top: 1px solid var(--border-color); }
.coord-group { display: flex; gap: 10px; align-items: center; }
.coord-group input { flex-grow: 1; margin-bottom: 0; }
.coord-group .btn-icon { flex-shrink: 0; height: 48px; width: 48px; border: 1px solid var(--border-color); border-radius: 3px; }
.coord-group .btn-icon:hover { background-color: #e9ecef; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fadeIn 0.3s ease-out; }
.modal-content { background-color: rgba(255, 255, 255, 0.95); margin: 5% auto; padding: 20px; border-radius: 3px; width: 80%; height: 70vh; position: relative; border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 10px 30px rgba(0,0,0,0.2); animation: fadeInScaleUp 0.3s ease-out forwards; }
.modal-content p { color: var(--text-color); font-weight: 500; }
.close-btn { color: #555; position: absolute; top: 10px; right: 20px; font-size: 38px; font-weight: bold; cursor: pointer; transition: color 0.2s ease; }
.close-btn:hover { color: #000; }
#panorama-preview { width: 100%; height: calc(100% - 40px); margin-top: 10px; border-radius: 3px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInScaleUp { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* === JAUNĀ SADAĻA: ADAPTĪVAIS DIZAINS (ar labojumu) === */
@media (max-width: 1200px) {
    /* !! SVARĪGAIS LABOJUMS: atļaujam skrollēt arī galveno logu !! */
    html, body {
        height: auto;
        overflow: auto;
    }
    .main-container {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
        height: auto;
        overflow: visible;
    }
    .header {
        padding: 15px 20px;
    }
    .header h1 {
        font-size: 1.25em;
    }
    .content-column {
        min-width: 0;
        /* Atceļam augstuma ierobežojumus, lai saturs varētu stiepties */
        height: auto;
        overflow: visible;
    }
    .column-content {
        overflow-y: visible;
    }
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
}

/* === НОВЫЕ СТИЛИ ДЛЯ КАСТОМНОЙ КНОПКИ ЗАГРУЗКИ ФАЙЛА === */
.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* Скрываем настоящую, уродливую кнопку */
.file-upload-wrapper input[type="file"] {
    display: none;
}

/* Стилизуем наш <label> как кнопку */
.file-upload-wrapper .btn-file {
    background-color: var(--secondary-bg);
    color: var(--secondary-text);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
    flex-shrink: 0; /* Чтобы кнопка не сжималась */
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.file-upload-wrapper .btn-file:hover {
    background-color: var(--secondary-bg-hover);
}

/* Стили для отображения имени файла */
.file-name-display {
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Добавляет "..." если имя файла слишком длинное */
}

/* === НОВЫЕ СТИЛИ ДЛЯ СТАТИЧНОЙ МИНИАТЮРЫ И LAZY LOADING === */
.scene-thumbnail-wrapper {
    margin: 25px 0;
    cursor: pointer;
    position: relative;
    width: 100%;
    height: 150px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: #f0f2f5; /* Фон на время загрузки */
}
.scene-thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* В начале картинка невидима */
    transition: opacity 0.4s ease-in-out, transform 0.3s ease;
}
.scene-thumbnail-wrapper img.loaded {
    opacity: 1; /* Когда картинка загрузилась, плавно ее проявляем */
}
.scene-thumbnail-wrapper:hover img {
    transform: scale(1.05);
}
.scene-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.scene-thumbnail-wrapper:hover .scene-thumbnail-overlay {
    opacity: 1;
}
.scene-thumbnail-placeholder {
    width: 100%;
    height: 150px;
    background-color: #f0f2f5;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    margin: 25px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
#panorama-full-preview {
    width: 100%;
    height: 100%;
}