:root {
  /* Значение по умолчанию, потом будет перезаписано JS */
  --navbar-height: 56px;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  height: 100%;
  margin: 0;
  padding-top: var(--navbar-height);
  background: #e5e5e5;
}

#map { 
  height: calc(100vh - var(--navbar-height)); 
  z-index: 0; 
  transition: margin-left 0.25s ease, width 0.25s ease;
  background: #e5e5e5;  
}

/* Правый сайдбар */
#sidebar {
  position: absolute;
  top: var(--navbar-height); 
  right: 0;
  width: 360px;
  height: calc(100vh - var(--navbar-height));
  background: #fff;
  border-left: 1px solid #ccc;
  padding: 15px;
  overflow-y: auto;
  display: none;
  z-index: 1001;
  transition: top 0.25s ease, height 0.25s ease;
}

#sidebar.visible { display: block; }

/* Левая панель слоёв */
#layersPanel {
  position: absolute;
  top: var(--navbar-height); 
  left: 0;
  width: 320px;
  height: calc(100vh - var(--navbar-height));
  background: #fff;
  border-right: 1px solid #ccc;
  padding: 15px;
  overflow-y: auto;
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}

#layersPanel.visible {
  transform: translateX(0);
}

.dragover {
  border: 2px dashed #28a745;
  background: rgba(40,167,69,0.1);
}

/* Зона drag&drop под навбаром */
#dropZone {
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  transition: top 0.25s ease, height 0.25s ease, left 0.25s ease, width 0.25s ease;
}

/* убираем синий прямоугольник при фокусе */
.leaflet-interactive:focus {
  outline: none;
}

.navbar-brand .logo-main {
  letter-spacing: 0.16em;
}
.leaflet-top {
  top: calc(var(--navbar-height) + 8px);
}
/* Колір активної базової карти — #4f5ae4 */
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item.active:hover,
.dropdown-menu .dropdown-item:active {
  background-color: #4f5ae4 !important;
  color: #fff !important;
}

/* смещение карты при открытом левом сайдбаре */
body.sidebar-left-open #map {
  margin-left: 320px;
  width: calc(100% - 320px);
}

body.sidebar-left-open #dropZone {
  left: 320px;
  width: calc(100% - 320px);
}
#btnHelp {
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#btnHelp:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.obj-color-box {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.25);
  margin-left: 6px;
  flex-shrink: 0;
}
.leaflet-control.mini-basemap-control {
  width: 34px;
  height: 34px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* чтобы полосы равномерно легли */
  background: #fff;
  border-radius: 6px;
  border: 1px solid #666;   
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
  cursor: pointer;
}

/* Полоски внутри */
.mini-basemap-layer {
  width: 100%;
  height: 8px;           /* ✔ подходит под 3 слоя внутри 34px */
  border-radius: 3px;
  opacity: 0.55;
  transition: opacity .2s;
}

.mini-basemap-layer.active {
  opacity: 1;
  outline: 1.5px solid #666;
}
/* Условные превью разных карт */
.mini-basemap-layer.osm {
  background: linear-gradient(135deg, #4caf50, #8bc34a);  /* зелёная “OSM” */
}

.mini-basemap-layer.ortho {
  background: linear-gradient(135deg, #795548, #ffeb3b);  /* “фото” */
}

.mini-basemap-layer.gray {
  background: linear-gradient(135deg, #eeeeee, #bdbdbd);  /* серый фон */
}
/* ============================ */
/*  HOVER-ПОДПИСИ ДЛЯ СЛОЁВ      */
/* ============================ */

.mini-basemap-layer {
  position: relative;
}

.mini-basemap-layer::after {
  content: attr(data-title);
  position: absolute;
  top: 50%;
  left: 115%;                  
  transform: translateY(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease-out, transform .15s ease-out;
}

/* Плавное появление */
.mini-basemap-layer:hover::after {
  opacity: 1;
  transform: translate(6px, -50%); 
}
.share-icon-btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


.obj-actions{
  display:flex;
  gap:8px;
  align-items:center;
}

.obj-icon-btn{
  width:28px;
  height:28px;
  border:1px solid rgba(0,0,0,.15);
  border-radius:8px;
  background:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  user-select:none;
}

.obj-icon-btn:hover{ background:#f2f2f2; }

.obj-icon-btn.is-off{
  opacity:.45;
}

.obj-icon{
  font-size:14px;
  line-height:1;
}

.obj-actions { display:flex; gap:6px; }
.obj-icon-btn{
  width:30px; height:30px;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid rgba(0,0,0,.15);
  background:#fff;
  border-radius:10px;
  padding:0;
  cursor:pointer;
  color:#222;
}
.obj-icon-btn:hover{ background:rgba(0,0,0,.04); }
.obj-icon-btn.is-off{ opacity:.55; }
.obj-icon-btn svg{ display:block; }


/* Стили для списка объектов с новой структурой */
#objectsList .obj-actions {
    margin-left: auto;
    flex-shrink: 0;
}

#objectsList .obj-color-box {
    width: 12px;
    height: 12px;
    margin-right: 8px;
}

/* Улучшенный внешний вид карточек объектов */
#objectsList .border.rounded {
    transition: all 0.2s ease;
    border-left: 3px solid transparent !important;
}

#objectsList .border.rounded:hover {
    border-left-color: #4f5ae4 !important;
    background-color: #f8f9fa;
}

/* Убедимся, что иконки не переносятся */
.obj-actions {
    flex-wrap: nowrap;
}

/* Пульс у halo (будет применяться к SVG path) */
@keyframes mapiosPulse {
  0%   { stroke-width: 10; opacity: 0.85; }
  50%  { stroke-width: 14; opacity: 0.25; }
  100% { stroke-width: 10; opacity: 0.85; }
}

.mapios-halo-pulse {
  animation: mapiosPulse 1s ease-in-out 2; /* 2 цикла за 1 сек * 2 = 2 сек, если хочешь ровно 1 сек — ставь 1 */
}

/* Активный объект в списке */
.obj-card.is-active{
  outline: 2px solid rgba(79, 90, 228, 0.55);
  background: rgba(79, 90, 228, 0.08);
}

#layersPanel .btn-outline-secondary {
  padding: 0.25rem 0.45rem;
  line-height: 1;
}

/* Online layers: "+" button hover in blue */
#btnAddOnlineLayer:hover {
  color: #0d6efd;               /* Bootstrap primary */
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.08);
}

/* Share project button hover in blue */
#shareProjectBtn:hover {
  color: #0d6efd;               /* Bootstrap primary */
  border-color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.08);
}
.obj-icon-btn i.bi {
  font-size: 1.1rem;
  line-height: 1;
}

/* Унификация кнопки закрытия в правом сайдбаре */
#btnCloseSidebar {
  padding: 0.25rem 0.4rem;   /* меньше кнопка */
}

#btnCloseSidebar i.bi {
  font-size: 0.9rem;         /* иконка чуть меньше */
  line-height: 1;
}

/* Auth icon button (visible on dark navbar) */
.btn-auth-icon{
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);

  color: #fff;                 /* 🔑 ключевая строка */
  cursor: pointer;

  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.btn-auth-icon i{
  color: inherit;              /* 🔑 иконка наследует цвет */
  font-size: 1.25rem;
}

.btn-auth-icon:hover{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.6);
  transform: translateY(-1px);
}

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

/* Logged-in state */
.btn-auth-icon.is-authed{
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.75);
}

.navbar .btn-auth-icon,
.navbar .btn-auth-icon i{
  color: #fff !important;
}

.mapios-loc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px; /* размер bootstrap icon */
}

.mapios-loc-btn.is-active {
  background: #ffc107; /* как bootstrap warning */
  color: #000 !important;
}

.mapios-loc-btn i {
  line-height: 1;
}

.mapios-draw-disabled {
  cursor: not-allowed !important;
}