/* Ultra Modern Admin Dashboard - 2025 Design */
:root {
  /* Modern Color Palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #1a1f2e;
  --bg-tertiary: #252b3d;
  --surface: #ffffff;
  --surface-secondary: #fafbfc;
  --surface-tertiary: #f1f4f9;
  
  /* Sidebar - Enhanced Modern Look */
  --sidebar-bg: linear-gradient(145deg, #1e293b 0%, #0f172a 50%, #1a202c 100%);
  --sidebar-text: #e2e8f0;
  --sidebar-text-muted: #94a3b8;
  --sidebar-active: #6366f1;
  --sidebar-active-bg: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.1));
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  
  /* Modern Color System */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #8b5cf6;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --warning: #f97316;
  --error: #ef4444;
  --info: #0ea5e9;
  
  /* Text */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  /* Modern Borders & Shadows */
  --border: #e1e7ef;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 24px 48px -8px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 32px 64px -12px rgba(0, 0, 0, 0.12), 0 12px 24px -6px rgba(0, 0, 0, 0.05);
  
  /* Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.025em;
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.875rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }

p { color: var(--text-secondary); }
.muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--surface-secondary);
}

/* Sidebar */
.admin-nav {
  width: 280px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: var(--space-lg) 0;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.admin-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.06) 50%, rgba(6, 182, 212, 0.04) 100%),
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.admin-brand {
  padding: 0 var(--space-lg) var(--space-xl);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: var(--space-lg);
}

.admin-brand h2 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space);
}

.admin-brand h2::before {
  content: '✨';
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--primary-light), var(--accent), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { 
    background: linear-gradient(135deg, var(--primary-light), var(--accent), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  50% { 
    background: linear-gradient(135deg, var(--accent), var(--secondary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

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

.admin-menu li {
  margin: var(--space-xs) 0;
}

.admin-menu a {
  display: flex;
  align-items: center;
  gap: var(--space);
  padding: var(--space) var(--space-lg);
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 500;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-right: var(--space);
  transition: var(--transition);
  position: relative;
}

.admin-menu a::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: var(--transition);
}

.admin-menu a:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
  transform: translateX(4px);
}

.admin-menu a.active {
  background: var(--sidebar-active-bg);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25), 0 2px 8px rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.admin-menu a.active::before {
  background: var(--primary-light);
  box-shadow: 0 0 8px var(--primary-light);
}

.admin-menu a.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: linear-gradient(180deg, var(--primary-light), var(--accent));
  border-radius: 3px 0 0 3px;
}

.separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: var(--space-lg) var(--space-lg) var(--space);
}

/* Main Content */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-header {
  background: var(--surface);
  padding: var(--space-xl) var(--space-2xl);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 5;
}

.admin-header h1 {
  margin: 0 0 var(--space-xs);
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-content {
  flex: 1;
  padding: var(--space-2xl);
  max-width: 100%;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.dashboard-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.dashboard-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(50%, -50%);
  pointer-events: none;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.dashboard-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
  border-color: rgba(99, 102, 241, 0.2);
}

.dashboard-card h3 {
  margin: 0 0 var(--space-lg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space);
  font-size: 1.25rem;
}

.dashboard-card h3::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  content: '';
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.stat-item {
  text-align: center;
  padding: var(--space-lg);
  background: var(--surface-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.stat-item:hover {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: var(--space-xs);
}

.stat-label {
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* Dashboard Actions */
.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space);
}

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

.dashboard-list li {
  margin-bottom: var(--space);
}

.dashboard-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space) var(--space-lg);
  background: var(--surface-tertiary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid var(--border-light);
}

.dashboard-list a:hover {
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.dashboard-list a::after {
  content: '→';
  color: var(--text-muted);
  transition: var(--transition);
}

.dashboard-list a:hover::after {
  color: var(--primary);
  transform: translateX(4px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space) var(--space-lg);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--primary-light) 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3), 0 2px 8px rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4), 0 4px 12px rgba(99, 102, 241, 0.3);
  filter: brightness(1.1);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--surface-tertiary);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-small {
  padding: var(--space-sm) var(--space);
  font-size: 0.75rem;
}

/* Forms */
.admin-form {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.admin-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
}

.form-section {
  margin-bottom: var(--space-2xl);
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section h3 {
  margin: 0 0 var(--space-lg);
  padding-bottom: var(--space);
  border-bottom: 2px solid var(--border-light);
  color: var(--text-primary);
  position: relative;
}

.form-section h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.form-full {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: var(--space) var(--space-lg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--text-primary);
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  gap: var(--space);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-xl);
}

/* Modern Alerts */
.alert {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid;
  font-weight: 500;
  position: relative;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: var(--space);
}

.alert::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  border-color: rgba(16, 185, 129, 0.3);
  color: #065f46;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.alert-success::before {
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.alert-error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
  border-color: rgba(239, 68, 68, 0.3);
  color: #991b1b;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.alert-error::before {
  background: var(--error);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

/* Activity */
.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: var(--space);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
}

.activity-item:hover {
  background: var(--surface-tertiary);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* Tables */
.table-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.admin-table th {
  background: var(--surface-tertiary);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tr:hover {
  background: var(--surface-secondary);
}

/* Media Components */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
}

.media-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.media-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Responsive */
@media (max-width: 1024px) {
  .admin-nav {
    width: 240px;
  }
  
  .admin-content {
    padding: var(--space-lg);
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  
  .admin-nav {
    width: 100%;
    padding: var(--space-lg);
  }
  
  .admin-menu {
    display: flex;
    overflow-x: auto;
    gap: var(--space);
  }
  
  .admin-menu li {
    margin: 0;
    flex-shrink: 0;
  }
  
  .admin-menu a {
    margin: 0;
    border-radius: var(--radius);
    white-space: nowrap;
  }
  
  .admin-header {
    padding: var(--space-lg);
  }
  
  .admin-content {
    padding: var(--space-lg);
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .dashboard-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .admin-header h1 {
    font-size: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .media-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Utilities */
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }
.mt-6 { margin-top: var(--space-2xl); }

.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }
.mb-6 { margin-bottom: var(--space-2xl); }

.text-center { text-align: center; }
.text-right { text-align: right; }

.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Dark mode support for future */
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #1e293b;
    --surface-secondary: #0f172a;
    --surface-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-light: #475569;
  }
}

/* Print styles */
@media print {
  .admin-nav {
    display: none;
  }
  
  .admin-main {
    width: 100%;
  }
  
  .admin-header {
    position: static;
    box-shadow: none;
    border-bottom: 1px solid #000;
  }
}