.icon-bar {
  position: fixed;      /* фиксируем блок */
  top: 50px;            /* отступ от navbar */
  left: 0;              /* прижимаем к левому краю */
  width: 60px;          /* ширина боковой панели */
  height: calc(100vh - 50px);
  background-color: #333;
  transition: transform 0.3s ease;
  transform: translateX(-100%);
  z-index: 10;
}

.icon-bar.show {
  transform: translateX(0);
}

.icon-bar.hidden {
  transform: translateX(-100%);
}

.icon-bar a {
  display: block;
  text-align: center;
  padding: 16px;
  transition: all 0.3s ease;
  color: #888;
  font-size: 16px;
}

.icon-bar a:hover {
  background-color: #000;
  color: #fff;
}

.icon-bar.active {
  background-color: #000;
}

/* Dynamic action buttons container */
#iconBarActions {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #555;
  border-bottom: 1px solid #555;
}

#iconBarActions:empty {
  border: none;
}

#iconBarActions a.icon-bar-action {
  display: block;
  text-align: center;
  padding: 16px;
  transition: all 0.15s ease;
  color: #aaa;
  font-size: 16px;
  text-decoration: none;
}

#iconBarActions a.icon-bar-action:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

#iconBarActions a.icon-bar-action:active {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(0.93);
}

#iconBarActions a.icon-bar-action.disabled {
  color: #aaa;
  pointer-events: none;
  opacity: 0.3;
}

#iconBarActions a.icon-bar-action.active {
  color: #4CAF50;
  background: rgba(76, 175, 80, 0.2);
  box-shadow: inset 0 0 0 1px rgba(76, 175, 80, 0.4);
}

#iconBarActions a.icon-bar-action.active:hover {
  background: rgba(76, 175, 80, 0.35);
  color: #fff;
}




.icon-bar-bottom:hover {
  background-color: #000;
  color: #fff;
}

/* Toggle button hover */
.icon-bar-toggle {
  transition: all 0.3s ease;
}

.icon-bar-toggle:hover i {
  color: #fff !important;
}

/* Make icon-bar a flex column so margin-top auto works */
.icon-bar {
  display: flex;
  flex-direction: column;
}

/* ============================================
   МОБІЛЬНА ВЕРСІЯ БОКОВОЇ ПАНЕЛІ
   ============================================ */

@media screen and (max-width: 768px) {
    .icon-bar {
        width: 50px;
    }
    
    .icon-bar a {
        padding: 12px;
        font-size: 14px;
    }

    #iconBarActions a.icon-bar-action {
        padding: 12px;
        font-size: 14px;
    }
    
    .icon-bar-toggle {
        padding: 8px 0 !important;
    }
    
    .icon-bar-toggle i {
        font-size: 20px !important;
    }
}

/* Ландшафтний режим на мобільних - компактніші кнопки */
@media screen and (max-height: 500px) {
    .icon-bar {
        top: 32px; /* менший navbar */
        height: calc(100vh - 32px);
        width: 45px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .icon-bar a {
        padding: 10px;
        font-size: 13px;
    }

    #iconBarActions a.icon-bar-action {
        padding: 10px;
        font-size: 13px;
    }
    
    .icon-bar-bottom {
        padding: 10px;
        font-size: 13px;
        margin-top: 0; /* Скидаємо auto щоб кнопка була в потоці */
    }
    
    .icon-bar-toggle {
        padding: 6px 0 !important;
    }
    
    .icon-bar-toggle i {
        font-size: 18px !important;
    }
    
    /* Тонкий скролбар */
    .icon-bar::-webkit-scrollbar {
        width: 3px;
    }
    
    .icon-bar::-webkit-scrollbar-thumb {
        background: #666;
        border-radius: 2px;
    }
}