/* src/components/admin/AdminLayout.css */

/* Grain Texture Animation */
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  30% { transform: translate(3%, -15%); }
  50% { transform: translate(12%, 9%); }
  70% { transform: translate(9%, 4%); }
  90% { transform: translate(-1%, 7%); }
}

.modern-admin-layout {
  display: flex;
  min-height: 100vh;
  background: #0a0a0a;
  position: relative;
  overflow: hidden;
}

/* Grain texture overlay */
.modern-admin-layout::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  width: 200%;
  height: 200%;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  animation: grain 8s steps(10) infinite;
  z-index: 1;
}

/* Modern Sidebar */
.modern-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 80px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  overflow-x: hidden;
  overflow-y: auto;
}

.modern-sidebar.expanded {
  width: 280px;
}

/* Sidebar Header */
.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white;
}

.modern-sidebar.expanded .sidebar-logo {
  justify-content: flex-start;
}

.logo-icon {
  font-size: 32px;
  filter: drop-shadow(0 0 20px rgba(147, 51, 234, 0.5));
  flex-shrink: 0;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: none;
}

.modern-sidebar.expanded .logo-text {
  display: block;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  border-radius: 16px;
  transition: all 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.modern-sidebar.expanded .nav-item {
  justify-content: flex-start;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.3) 0%, rgba(126, 34, 206, 0.2) 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.3);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  width: 4px;
  background: linear-gradient(180deg, #a855f7 0%, #7e22ce 100%);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.8);
}

.nav-icon-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.nav-item.active .nav-icon-wrapper {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.4) 0%, rgba(126, 34, 206, 0.3) 100%);
  box-shadow: inset 0 0 20px rgba(147, 51, 234, 0.3);
}

.nav-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.nav-label {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  display: none;
}

.modern-sidebar.expanded .nav-label {
  display: block;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.5);
  z-index: 10;
}

.active-indicator {
  position: absolute;
  right: 12px;
  width: 6px;
  height: 6px;
  background: #a855f7;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.8);
  display: none;
}

.modern-sidebar.expanded .active-indicator {
  display: block;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
}

.modern-sidebar.expanded .user-profile {
  justify-content: flex-start;
}

.user-profile:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.user-info {
  display: none;
  flex-direction: column;
  align-items: flex-start;
}

.modern-sidebar.expanded .user-info {
  display: flex;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.user-action {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
}

/* Toggle Button */
.sidebar-toggle {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 8px 8px 0;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.3s ease;
  z-index: 101;
}

.sidebar-toggle:hover {
  background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Main Content */
.modern-main-content {
  flex: 1;
  margin-left: 80px;
  padding: 32px;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.9) 0%, rgba(5, 5, 5, 0.95) 100%);
  min-height: 100vh;
}

.modern-main-content.sidebar-expanded {
  margin-left: 280px;
}

/* Custom Scrollbar */
.modern-sidebar::-webkit-scrollbar {
  width: 4px;
}

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

.modern-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

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

/* Responsive */
@media (max-width: 768px) {
  .modern-sidebar {
    transform: translateX(-100%);
  }

  .modern-sidebar.expanded {
    transform: translateX(0);
    width: 280px;
  }

  .modern-main-content,
  .modern-main-content.sidebar-expanded {
    margin-left: 0;
  }

  .sidebar-toggle {
    right: -40px;
    width: 40px;
    border-radius: 0 12px 12px 0;
  }
}
