/* Sidebar Styles with Glass Effect */

/* Chrome Performance Optimization */
.sidebar,
.sidebar *,
.hamburger-menu,
.sidebar-overlay {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Hamburger Menu Button */
.hamburger-menu {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  will-change: transform, background;
  transform: translateZ(0);
}

.hamburger-menu:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.hamburger-menu .hamburger-icon {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-menu .hamburger-line {
  width: 100%;
  height: 2px;
  background: rgba(59, 130, 246, 1);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Hamburger Animation */
.hamburger-menu.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
  transition-delay: 0.1s;
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
  transition-delay: 0.05s;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
  transition-delay: 0.15s;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: opacity, visibility;
  transform: translateZ(0);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: -350px;
  width: 350px;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  transform: translate3d(-20px, 0, 0);
  opacity: 0;
  will-change: transform, opacity, left;
  padding-bottom: 20px;
}

.sidebar.active {
  left: 0;
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* Sidebar Header */
.sidebar-header {
  padding: 30px 25px 20px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  transform: translate3d(0, -20px, 0);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.05s;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
}

.sidebar.active .sidebar-header {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.sidebar-brand {
  color: white;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand:hover {
  color: #3DB4F2;
  text-decoration: none;
}

.sidebar-brand i {
  font-size: 1.8rem;
  color: #3DB4F2;
}

.sidebar-profile-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar-profile-icon:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: #3b82f6;
  transform: scale(1.05);
  color: white;
  text-decoration: none;
}

.sidebar-profile-icon i {
  font-size: 1.1rem;
}

/* Sidebar Navigation */
.sidebar-nav {
  padding: 20px 0;
  transform: translate3d(0, 20px, 0);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.1s;
  will-change: transform, opacity;
}

.sidebar.active .sidebar-nav {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.sidebar-nav-item {
  margin: 8px 20px;
  transform: translate3d(-20px, 0, 0);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
}

.sidebar-nav-item:nth-child(1) { transition-delay: 0.05s; }
.sidebar-nav-item:nth-child(2) { transition-delay: 0.08s; }
.sidebar-nav-item:nth-child(3) { transition-delay: 0.11s; }
.sidebar-nav-item:nth-child(4) { transition-delay: 0.14s; }
.sidebar-nav-item:nth-child(5) { transition-delay: 0.17s; }
.sidebar-nav-item:nth-child(6) { transition-delay: 0.2s; }

.sidebar.active .sidebar-nav-item {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.sidebar-nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.sidebar-nav-link:hover::before {
  left: 100%;
}

.sidebar-nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translate3d(5px, 0, 0);
  text-decoration: none;
}

.sidebar-nav-link.active {
  color: white;
  background: rgba(100, 181, 246, 0.2);
  border-left: 4px solid #64b5f6;
}

.sidebar-nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Theme Toggle in Sidebar */
.sidebar-theme-toggle {
  margin: 20px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 500;
  transform: translate3d(0, 20px, 0);
  opacity: 0;
  will-change: transform, opacity;
}

.sidebar.active .sidebar-theme-toggle {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.sidebar-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
}

.sidebar-theme-toggle i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .hamburger-menu {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .hamburger-menu:hover {
  background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .sidebar {
  background: rgba(0, 0, 0, 0.4);
  border-right-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .sidebar-header {
  background: rgba(0, 0, 0, 0.2);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-theme-toggle {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar-theme-toggle:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    width: 300px;
    left: -300px;
    padding-bottom: 30px;
  }

  .hamburger-menu {
    top: 15px;
    left: 15px;
    padding: 10px;
  }

  .sidebar-logout-btn {
    margin-bottom: 25px;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 280px;
    left: -280px;
    padding-bottom: 35px;
  }

  .sidebar-logout-btn {
    margin-bottom: 30px;
  }
}

/* Smooth scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Animation for content when sidebar opens */
.main-content {
  transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, filter;
}

.sidebar-open .main-content {
  transform: translate3d(20px, 0, 0);
  filter: blur(1px);
}

@media (max-width: 768px) {
  .sidebar-open .main-content {
    transform: translate3d(0, 0, 0);
  }
}

/* NSFW Toggle Button */
.nsfw-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 25px;
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 14px;
  transform: translate3d(0, 20px, 0);
  opacity: 0;
  will-change: transform, opacity;
}

.sidebar.active .nsfw-toggle {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* Only apply hover effect on devices that support hover (not touch) */
@media (hover: hover) and (pointer: fine) {
  .nsfw-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translate3d(0, -1px, 0);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
}

.nsfw-toggle .toggle-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nsfw-toggle .toggle-icon {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.nsfw-toggle .toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.nsfw-toggle .toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nsfw-toggle.active .toggle-switch {
  background: rgba(59, 130, 246, 0.8);
}

.nsfw-toggle.active .toggle-switch::after {
  transform: translateX(20px);
  background: rgba(255, 255, 255, 1);
}

/* Dark theme adjustments */
[data-theme="dark"] .nsfw-toggle {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

@media (hover: hover) and (pointer: fine) {
  [data-theme="dark"] .nsfw-toggle:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

/* Logout Form */
#logoutForm {
  margin: 0;
  padding: 0;
  transform: translate3d(0, 20px, 0);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.4s;
  will-change: transform, opacity;
}

.sidebar.active #logoutForm {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

/* Logout Button */
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 25px;
  margin: 10px 20px 20px;
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  font-size: 13px;
  width: calc(100% - 40px);
  opacity: 0.7;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform, opacity;
}

.sidebar-logout-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.3);
  color: rgba(255, 100, 100, 0.9);
  opacity: 1;
  transform: translate3d(0, -1px, 0);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.sidebar-logout-btn i {
  font-size: 1rem;
  width: 16px;
  text-align: center;
  opacity: 0.8;
}

/* Dark theme adjustments */
[data-theme="dark"] .sidebar-logout-btn {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .sidebar-logout-btn:hover {
  background: rgba(127, 29, 29, 0.3);
  border-color: rgba(220, 38, 38, 0.4);
  color: rgba(248, 113, 113, 0.9);
}
/* Title Language Selector */
.title-language-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  margin: 0 5px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  transform: translate3d(0, 20px, 0);
  opacity: 0;
  will-change: transform, opacity;
}

.sidebar.active .title-language-selector {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  transition-delay: 0.05s;
}

.title-lang-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.title-lang-label i {
  font-size: 1rem;
  opacity: 0.8;
  width: 18px;
  text-align: center;
}

.title-lang-options {
  display: flex;
  gap: 4px;
}

.title-lang-btn {
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
  letter-spacing: 0.5px;
}

.title-lang-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.title-lang-btn.active {
  background: rgba(59, 180, 242, 0.7);
  border-color: rgba(59, 180, 242, 0.9);
  color: white;
  box-shadow: 0 2px 10px rgba(59, 180, 242, 0.35);
}

[data-theme="dark"] .title-language-selector {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .title-lang-btn {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .title-lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .title-lang-btn.active {
  background: rgba(59, 180, 242, 0.6);
  border-color: rgba(59, 180, 242, 0.8);
}
