/* IntegraRH Sidebar CSS - Adapted from Prafrota */

:root {
  /* Light Theme Variables (Default) */
  --rhs-bg: #ffffff;
  --rhs-text: #475569;
  --rhs-text-active: #0f172a;
  --rhs-text-muted: #64748b;
  --rhs-border: #f1f5f9;
  --rhs-bg-search: #f8fafc;
  --rhs-bg-hover: rgba(0, 0, 0, 0.03);
  --rhs-tree-line: #e2e8f0;
  --rhs-footer-bg: #f8fafc;
  --rhs-user-card-bg: rgba(0, 0, 0, 0.01);
  --rhs-toggle-bg: #ffffff;
  --rhs-toggle-border: #e2e8f0;
  --rhs-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.dark .rhs-container {
  /* Dark Theme Variables */
  --rhs-bg: #1a1a1a;
  --rhs-text: #ffffff;
  --rhs-text-active: #141414;
  --rhs-text-muted: #a0a0a0;
  --rhs-border: rgba(255, 255, 255, 0.03);
  --rhs-bg-search: #252525;
  --rhs-bg-hover: rgba(255, 255, 255, 0.03);
  --rhs-tree-line: #262626;
  --rhs-footer-bg: #181818;
  --rhs-user-card-bg: rgba(255, 255, 255, 0.02);
  --rhs-toggle-bg: #262626;
  --rhs-toggle-border: #333;
  --rhs-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.rhs-container {
  width: 260px;
  height: calc(100vh - 20px);
  background: var(--rhs-bg);
  color: var(--rhs-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 40;
  border-radius: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: var(--rhs-shadow);
  border: 1px solid var(--rhs-border);
}

/* Subtle Top Glow - Emerald (Prafrota Style) */
.rhs-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  opacity: 0.3;
}

.rhs-container.collapsed {
  width: 80px;
}

/* Toggle Area */
.rhs-toggle-container {
  padding: 1rem;
  display: flex;
  justify-content: flex-end;
  min-height: 56px;
  align-items: center;
}

.collapsed .rhs-toggle-container {
  justify-content: center;
}

.rhs-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--rhs-toggle-bg);
  border: 1px solid var(--rhs-toggle-border);
  color: var(--rhs-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rhs-toggle-btn:hover {
  background: var(--rhs-bg-search);
  color: #10b981;
  border-color: #10b981;
  transform: scale(1.05);
}

/* Search Box */
.rhs-search-wrapper {
  padding: 0.5rem 1.25rem 1.5rem;
  transition: all 0.3s ease;
}

.collapsed .rhs-search-wrapper {
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding: 0;
}

.rhs-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: var(--rhs-bg-search);
  border: 1px solid var(--rhs-border);
  border-radius: 12px;
  color: var(--rhs-text);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.rhs-search-input:focus {
  border-color: #10b981;
  background: var(--rhs-bg);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Navigation Content */
.rhs-nav-content {
  flex: 1;
  padding: 0.5rem 1rem;
  overflow-y: auto;
  overflow-x: hidden;
}

.rhs-nav-content::-webkit-scrollbar {
  width: 3px;
}

.rhs-nav-content::-webkit-scrollbar-thumb {
  background: var(--rhs-border);
  border-radius: 10px;
}

/* Menu Item Wrapper */
.rhs-item-wrapper {
  margin-bottom: 6px;
}

/* Links & Tree Structure */
.rhs-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: var(--rhs-text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  gap: 14px;
}

.rhs-link:hover:not(.active) {
  background: var(--rhs-bg-hover);
  color: var(--rhs-text);
}

.rhs-link.active {
  background: #10b981 !important;
  color: var(--rhs-text-active) !important;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.rhs-icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.rhs-link:hover .rhs-icon:not(.active) {
  transform: scale(1.1);
}

.rhs-label {
  flex: 1;
  font-size: 0.9rem;
  white-space: nowrap;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.collapsed .rhs-label,
.collapsed .rhs-chevron {
  display: none;
}

.rhs-chevron {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--rhs-text-muted);
}

.rhs-chevron.expanded {
  transform: rotate(180deg);
}

/* Submenu & Tree Lines */
.rhs-submenu {
  margin-left: 0.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rhs-tree-line);
  margin-top: 4px;
  margin-bottom: 8px;
}

.rhs-sublink {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  color: var(--rhs-text-muted);
  font-size: 0.85rem;
  transition: all 0.2s ease;
  text-decoration: none;
  margin-bottom: 2px;
  position: relative;
  gap: 12px;
}

.rhs-sublink::before {
  content: '';
  position: absolute;
  left: -1.25rem;
  top: 50%;
  width: 0.75rem;
  height: 2px;
  background: var(--rhs-tree-line);
}

.rhs-sublink:hover {
  color: var(--rhs-text);
  background: var(--rhs-bg-hover);
}

.rhs-sublink.active {
  color: #10b981;
  font-weight: 700;
}

/* Icons in sublink */
.rhs-sublink .rhs-icon {
  opacity: 0.7;
}

.rhs-sublink.active .rhs-icon {
  opacity: 1;
  color: #10b981;
}

/* Footer Section */
.rhs-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--rhs-border);
  background: var(--rhs-footer-bg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.collapsed .rhs-footer {
  padding: 1.25rem 0.5rem;
  align-items: center;
}

/* Brand Area in Footer */
.rhs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rhs-brand-logo {
  width: 36px;
  height: 36px;
  background: #10b981;
  color: #141414;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}

.rhs-brand-info {
  display: flex;
  flex-direction: column;
}

.rhs-brand-name {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--rhs-text);
}

.rhs-brand-name span {
  color: #10b981;
}

.rhs-app-sub {
  font-size: 0.7rem;
  color: var(--rhs-text-muted);
  font-weight: 600;
}

/* User Card */
.rhs-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.625rem;
  background: var(--rhs-user-card-bg);
  border-radius: 12px;
  border: 1px solid var(--rhs-border);
}

.rhs-user-data {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rhs-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rhs-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rhs-logout-link {
  font-size: 0.75rem;
  color: var(--rhs-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: fit-content;
}

.rhs-logout-link:hover {
  color: #ef4444;
}

/* Locks */
.rhs-locked {
  opacity: 0.4;
  cursor: not-allowed !important;
}

.rhs-lock-icon {
  margin-left: auto;
  color: #10b981 !important;
}
