/**
 * sidebar.css - Společné styly pro levé menu (Interlacto Intranet)
 *
 * Tento soubor obsahuje všechny styly potřebné pro správné fungování sidebaru
 * na všech zařízeních (desktop, tablet, mobil).
 */

:root {
  --il-sidebar-w: 270px;
  --il-sidebar-mini-w: 80px;
  --il-sidebar-transition: 0.3s ease;
}

/* =========================================================
   DESKTOP (>= 1200px) - Sidebar fixně vlevo
   ========================================================= */
@media (min-width: 1200px) {
  .left-sidebar.with-vertical {
    width: var(--il-sidebar-w);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    transition: width var(--il-sidebar-transition);
  }

  .left-sidebar.with-vertical::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
  }

  .left-sidebar.with-vertical .brand-logo {
    width: var(--il-sidebar-w);
    padding: 15px 20px;
  }

  .body-wrapper {
    margin-left: var(--il-sidebar-w);
    min-height: 100vh;
    transition: margin-left var(--il-sidebar-transition);
  }

  .body-wrapper .container-fluid {
    max-width: none;
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Mini-sidebar na desktopu */
  .left-sidebar.with-vertical.mini-sidebar {
    width: var(--il-sidebar-mini-w);
  }

  .left-sidebar.with-vertical.mini-sidebar .brand-logo {
    width: var(--il-sidebar-mini-w);
    padding: 15px 10px;
  }

  .left-sidebar.with-vertical.mini-sidebar .hide-menu,
  .left-sidebar.with-vertical.mini-sidebar .nav-small-cap-icon,
  .left-sidebar.with-vertical.mini-sidebar .nav-small-cap {
    display: none;
  }

  .left-sidebar.with-vertical.mini-sidebar ~ .body-wrapper {
    margin-left: var(--il-sidebar-mini-w);
  }

  /* Hover efekt pro mini-sidebar */
  .left-sidebar.with-vertical.mini-sidebar:hover {
    width: var(--il-sidebar-w);
  }

  .left-sidebar.with-vertical.mini-sidebar:hover .hide-menu,
  .left-sidebar.with-vertical.mini-sidebar:hover .nav-small-cap-icon,
  .left-sidebar.with-vertical.mini-sidebar:hover .nav-small-cap {
    display: inline;
  }

  /* Skrýt mobilní zavírací tlačítko na desktopu */
  .left-sidebar.with-vertical [data-il="close-sidebar"] {
    display: none !important;
  }
}

/* =========================================================
   TABLET A MOBIL (< 1200px) - Sidebar jako overlay
   ========================================================= */
@media (max-width: 1199.98px) {
  .left-sidebar.with-vertical {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--il-sidebar-w);
    height: 100vh;
    z-index: 1050;
    background: #fff;
    transform: translateX(-100%);
    transition: transform var(--il-sidebar-transition);
    overflow-y: auto;
    box-shadow: none;
  }

  .left-sidebar.with-vertical.show {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
  }

  .left-sidebar.with-vertical .brand-logo {
    padding: 15px 20px;
  }

  .body-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .body-wrapper .container-fluid {
    max-width: none;
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Overlay pozadí při otevřeném menu */
  body.show-sidebar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 1;
    transition: opacity var(--il-sidebar-transition);
  }

  /* Zobrazit mobilní zavírací tlačítko */
  .left-sidebar.with-vertical [data-il="close-sidebar"] {
    display: block !important;
  }
}

/* =========================================================
   MALÉ TELEFONY (< 576px)
   ========================================================= */
@media (max-width: 575.98px) {
  .left-sidebar.with-vertical {
    width: 280px;
    max-width: 85vw;
  }

  .topbar h3 {
    font-size: 1rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-subtitle {
    font-size: 0.85rem;
  }
}

/* =========================================================
   STYLY MENU POLOŽEK
   ========================================================= */
.left-sidebar.with-vertical .sidebar-nav {
  padding: 0 15px;
}

.left-sidebar.with-vertical #sidebarnav {
  padding-left: 0;
  list-style: none;
  margin: 0;
}

.left-sidebar.with-vertical .sidebar-item {
  list-style: none;
  margin-bottom: 2px;
}

.left-sidebar.with-vertical .sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 8px;
  color: #2a3547;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.left-sidebar.with-vertical .sidebar-link:hover {
  background: rgba(93, 135, 255, 0.1);
  color: #5d87ff;
}

.left-sidebar.with-vertical .sidebar-link.active {
  background: #5d87ff;
  color: #fff;
}

.left-sidebar.with-vertical .sidebar-link > i {
  margin-right: 10px;
  font-size: 20px;
  width: 20px;
  flex-shrink: 0;
}

.left-sidebar.with-vertical .nav-small-cap {
  padding: 15px 15px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #98a6ad;
}

.left-sidebar.with-vertical .nav-small-cap-icon {
  margin-right: 8px;
}

/* =========================================================
   BRAND LOGO
   ========================================================= */
.left-sidebar.with-vertical .brand-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 10px;
}

.left-sidebar.with-vertical .brand-logo img {
  max-height: 40px;
  width: auto;
}

.left-sidebar.with-vertical .brand-logo [data-il="close-sidebar"] {
  font-size: 20px;
  color: #5a6a85;
  padding: 5px;
}

.left-sidebar.with-vertical .brand-logo [data-il="close-sidebar"]:hover {
  color: #5d87ff;
}
