/* Sidebar styles */

.sidebar {
  width: 240px;
  background-color: #f8f9fa;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  justify-content: space-between;
  transition: transform 0.3s ease;
  z-index: 1000;
}

/* Mobile sidebar overlay - hide sidebar on mobile and landscape */
@media (max-width: 768px), (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    width: 200px; /* Slightly narrower on mobile */
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* Overlay when sidebar is open */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  
  .sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  /* Compact sidebar content on mobile */
  .sidebar-header {
    padding: 16px;
  }

  .sidebar-nav {
    padding: 8px 0;
  }

  .sidebar-link {
    padding: 8px 16px;
    font-size: 14px;
  }

  .sidebar-footer {
    padding: 16px;
  }
}

.sidebar-header {
  padding: 24px;
}

.sidebar-logo {
  height: 32px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 20px;
}

.sidebar-footer {
  margin-top: 40px;
  padding-left: 20px;
  font-size: 14px;
  color: #333;
  margin-bottom: 20px;
}

/* User profile styles */
.user-profile {
  position: relative;
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: auto;
  border-top: 1px solid #e9ecef;
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.user-info-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex: 1;
  gap: 12px;
}

.user-info-link:hover {
  color: inherit;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.user-overlay {
  position: absolute;
  bottom: 60px;
  left: 10%;
  transform: translateX(-10%) translateY(0);
  background: white;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 6px 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  min-width: 140px;
  text-align: center;
  z-index: 1000;
}

.user-profile:hover .user-overlay {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  background: #000;
}

.logout-link {
  display: block;
  padding: 8px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.logout-link:hover {
  background-color: #000;
}

/* Sidebar link styles */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  text-decoration: none;
  color: #1c1c2b;
  font-size: 15px;
  border-radius: 5px 0px 0px 5px;
  transition: background 0.2s ease;
}

.sidebar-link:hover {
  background: var(--TB-Dark-Grey, #20212D);
  color: #ffffff;
}

.sidebar-link.active {
  background: var(--TB-Dark-Grey, #20212D);
  color: #ffffff;
}

.sidebar-icon-img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

/* Sidebar Language Switcher */
.sidebar-language-switcher {
  margin-bottom: 10px;
}

.sidebar-language-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  background: white;
  font-size: 14px;
  color: #1c1c2b;
  cursor: pointer;
}

.sidebar-language-select:hover {
  border-color: #20212D;
}

.sidebar-language-select:focus {
  outline: none;
  border-color: #20212D;
  box-shadow: 0 0 0 2px rgba(32, 33, 45, 0.1);
}
