﻿/* ===== SIDEBAR USUARIO - Estilo Oceanstock ===== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  background-color: #111113;
  display: flex;
  flex-direction: column;
  z-index: 999;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.2s ease;
}

.sidebar.open {
  width: 280px;
}

.sidebar.closed {
  width: 70px;
}

/* Overlay para dispositivos moviles */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 998;
  backdrop-filter: blur(4px);
}

/* Cabecera del sidebar */
.sidebarHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.appBrand {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  text-decoration: none;
}

.brandLogo {
  height: 28px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.closed .brandLogo {
  height: 24px;
}

.toggleBtn {
  border: none;
  background: transparent;
  color: #9ca3af;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggleBtn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
}

.toggleBtn ion-icon {
  font-size: 16px;
}

/* Navegacion */
.navigation {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.navigation::-webkit-scrollbar {
  width: 4px;
}

.navigation::-webkit-scrollbar-track {
  background: transparent;
}

.navigation::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.navMenu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.navItem {
  margin: 2px 0;
}

.navLink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.navLink:hover {
  color: #e5e7eb;
  background-color: rgba(255, 255, 255, 0.04);
}

.navLink.active {
  color: #5b9aff;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  font-weight: 500;
}

.linkIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  font-size: 18px;
  transition: color 0.15s ease;
}

.navLink:hover .linkIcon {
  color: #e5e7eb;
}

.navLink.active .linkIcon {
  color: #5b9aff;
}

.closed .linkIcon {
  margin: 0 auto;
}

.linkText {
  font-weight: inherit;
  white-space: nowrap;
  flex: 1;
  transition: opacity 0.2s ease;
}

.closed .linkText {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* Footer / Logout */
.sidebarFooter {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.logoutButton {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s ease;
}

.logoutButton:hover {
  background-color: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.logoutButton ion-icon {
  font-size: 18px;
}

.logoutButton span {
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.closed .logoutButton span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.closed .logoutButton {
  justify-content: center;
}

/* ===== MEDIA QUERIES ===== */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
    width: 280px;
    z-index: 1000;
  }

  .sidebar.closed {
    transform: translateX(-100%);
    width: 280px;
  }
}

@media (max-width: 480px) {
  .sidebar.open {
    width: 85%;
  }
}

@media (max-width: 320px) {
  .sidebar.open {
    width: 95%;
  }
}
