/* Admin Layout CSS - Modern Redesign */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --topbar-height: 75px;
  
  /* Modern Color Palette */
  --primary-color: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary-color: #ec4899;
  --secondary-light: #f472b6;
  --accent-color: #8b5cf6;
  
  --success-color: #10b981;
  --success-light: #34d399;
  --warning-color: #f59e0b;
  --warning-light: #fbbf24;
  --danger-color: #ef4444;
  --danger-light: #f87171;
  --info-color: #06b6d4;
  --info-light: #22d3ee;
  
  --dark: #0f172a;
  --dark-light: #1e293b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-purple: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  --gradient-orange: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --gradient-blue: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  color: var(--gray-900);
  line-height: 1.6;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(252, 70, 107, 0.3), transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.2), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Sidebar - Glassmorphism Design */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  animation: slideInLeft 0.5s ease-out;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
  pointer-events: none;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  height: var(--topbar-height);
  position: relative;
  z-index: 1;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
}

.sidebar-logo img {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.sidebar-logo:hover img {
  transform: scale(1.05) rotate(2deg);
}

.sidebar-title {
  font-size: 20px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-title {
  display: none;
}

.sidebar-toggle {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border: none;
  font-size: 18px;
  color: #ffffff;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Sidebar Navigation - Modern Style */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 12px;
  position: relative;
  z-index: 1;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
  border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-dark), var(--accent-color));
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 6px;
  animation: fadeIn 0.5s ease-out backwards;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }
.nav-item:nth-child(8) { animation-delay: 0.4s; }
.nav-item:nth-child(9) { animation-delay: 0.45s; }
.nav-item:nth-child(10) { animation-delay: 0.5s; }

.nav-link {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 14px;
  margin: 0 4px;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  transition: width 0.3s ease;
  opacity: 0;
}

.nav-link i {
  width: 22px;
  font-size: 19px;
  margin-right: 14px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.sidebar.collapsed .nav-link span {
  display: none;
}

.nav-link:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: var(--primary-color);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.nav-link:hover::before {
  width: 4px;
  opacity: 1;
}

.nav-link:hover i {
  transform: scale(1.15) rotate(5deg);
}

.nav-item.active .nav-link {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
  transform: translateX(4px);
}

.nav-item.active .nav-link::before {
  width: 4px;
  background: #ffffff;
  opacity: 1;
}

.nav-item.active .nav-link i {
  transform: scale(1.1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Submenu - Enhanced */
.submenu-arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.7;
}

.nav-item.has-submenu.open .submenu-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
  border-radius: 12px;
  margin: 6px 8px;
  opacity: 0;
}

.nav-item.has-submenu.open .submenu {
  max-height: 600px;
  opacity: 1;
  padding: 8px 0;
}

.submenu li {
  padding-left: 48px;
  position: relative;
}

.submenu li::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform 0.3s ease;
}

.submenu a {
  display: block;
  padding: 10px 16px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin: 2px 8px;
}

.submenu a:hover {
  color: var(--primary-color);
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.submenu a:hover ~ li::before,
.submenu li:hover::before {
  transform: translateY(-50%) scale(1);
}

/* Sidebar Footer - Enhanced */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.05));
  position: relative;
  z-index: 1;
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  cursor: pointer;
}

.admin-info:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.admin-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
  position: relative;
}

.admin-avatar::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--success-color);
  border: 2px solid #ffffff;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.admin-info:hover .admin-avatar {
  transform: scale(1.1) rotate(5deg);
}

.admin-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar.collapsed .admin-details {
  display: none;
}

.admin-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.2px;
}

.admin-role {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
  padding: 2px 8px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border-radius: 6px;
  display: inline-block;
  width: fit-content;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* Top Bar - Glassmorphism */
.top-bar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.5s ease-out;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-700);
  cursor: pointer;
}

.search-box {
  position: relative;
  max-width: 450px;
  flex: 1;
}

.search-box i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  font-size: 16px;
  transition: all 0.3s ease;
  z-index: 1;
}

.search-box input {
  width: 100%;
  padding: 13px 18px 13px 50px;
  border: 2px solid rgba(99, 102, 241, 0.15);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  color: var(--gray-700);
}

.search-box input::placeholder {
  color: var(--gray-400);
  font-weight: 500;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 8px 20px rgba(99, 102, 241, 0.15);
  background: #ffffff;
  transform: translateY(-1px);
}

.search-box input:focus ~ i {
  color: var(--primary-dark);
  transform: translateY(-50%) scale(1.1);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notification-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(99, 102, 241, 0.15);
  font-size: 20px;
  color: var(--primary-color);
  cursor: pointer;
  padding: 12px;
  border-radius: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-btn:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-2px) rotate(10deg);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, var(--danger-color), var(--danger-light));
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 12px;
  min-width: 22px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  animation: pulse 2s infinite;
  border: 2px solid #ffffff;
}

.view-site-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 14px;
  transition: all 0.3s ease;
  border: 2px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.view-site-btn:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #ffffff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.view-site-btn i {
  transition: transform 0.3s ease;
}

.view-site-btn:hover i {
  transform: rotate(45deg) scale(1.1);
}

.admin-dropdown {
  position: relative;
}

.admin-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(99, 102, 241, 0.15);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.admin-btn:hover {
  background: #ffffff;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

.admin-avatar-small {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.admin-btn:hover .admin-avatar-small {
  transform: scale(1.1) rotate(5deg);
}

.admin-btn span {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}

.admin-btn i.fa-chevron-down {
  font-size: 12px;
  color: var(--gray-500);
  transition: transform 0.3s ease;
}

.admin-dropdown:hover .admin-btn i.fa-chevron-down {
  transform: rotate(180deg);
}

.admin-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 220px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.admin-dropdown:hover .admin-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.admin-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.admin-dropdown-menu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--primary-color), transparent);
  transition: width 0.3s ease;
}

.admin-dropdown-menu a:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: var(--primary-color);
  transform: translateX(4px);
}

.admin-dropdown-menu a:hover::before {
  width: 4px;
}

.admin-dropdown-menu a i {
  width: 20px;
  font-size: 16px;
  transition: transform 0.3s ease;
}

.admin-dropdown-menu a:hover i {
  transform: scale(1.2) rotate(5deg);
}

.dropdown-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
  margin: 8px 12px;
}

/* Content Wrapper - Enhanced */
.content-wrapper {
  padding: 36px;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.6s ease-out;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  padding: 24px 32px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.5);
  animation: fadeIn 0.7s ease-out;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  position: relative;
  display: inline-block;
}

.page-header h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
}

.page-actions {
  display: flex;
  gap: 12px;
}

.date-filter {
  padding: 12px 20px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  color: var(--gray-700);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.date-filter:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.2);
}

.date-filter:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: block;
  }

  .search-box {
    max-width: 200px;
  }

  .view-site-btn span {
    display: none;
  }

  .content-wrapper {
    padding: 20px 15px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
}
