/* PEPP Learning Admin Dashboard Styles */
@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

:root {
  /* Updated color palette to match design brief with cyan-based professional theme */
  --background: #ffffff;
  --foreground: #475569;
  --card: #ecfeff;
  --card-foreground: #164e63;
  --popover: #ffffff;
  --popover-foreground: #475569;
  --primary: #164e63;
  --primary-foreground: #ffffff;
  --primary-hover: #0f3a47;
  --secondary: #6366f1;
  --secondary-foreground: #ffffff;
  --muted: #f9fafb;
  --muted-foreground: #475569;
  --accent: #6366f1;
  --accent-foreground: #ffffff;
  --success: #10b981;
  --success-foreground: #ffffff;
  --warning: #f59e0b;
  --warning-foreground: #ffffff;
  --info: #3b82f6;
  --info-foreground: #ffffff;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --border: #d1d5db;
  --input: #f9fafb;
  --ring: rgba(22, 78, 99, 0.5);
  --radius: 0.5rem;
  --sidebar: #ecfeff;
  --sidebar-foreground: #164e63;
  --sidebar-primary: #ffffff;
  --sidebar-primary-foreground: #164e63;
  --sidebar-accent: #6366f1;
  --sidebar-accent-foreground: #ffffff;
  --sidebar-border: #d1d5db;
  --sidebar-ring: rgba(22, 78, 99, 0.5);
}

.dark {
  --background: #1e293b;
  --foreground: #f8fafc;
  --card: #1e293b;
  --card-foreground: #f8fafc;
  --primary: #f8fafc;
  --primary-foreground: #1e293b;
  --secondary: #475569;
  --secondary-foreground: #f8fafc;
  --muted: #64748b;
  --muted-foreground: #f8fafc;
  --accent: #f8fafc;
  --accent-foreground: #1e293b;
  --success: #10b981;
  --success-foreground: #f8fafc;
  --warning: #f59e0b;
  --warning-foreground: #f8fafc;
  --info: #3b82f6;
  --info-foreground: #f8fafc;
  --destructive: #ef4444;
  --destructive-foreground: #f8fafc;
  --border: #475569;
  --input: #1e293b;
  --ring: #f8fafc;
}

@theme inline {
  /* Added font families for Work Sans and Open Sans */
  --font-heading: "Work Sans", sans-serif;
  --font-body: "Open Sans", sans-serif;
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-success: var(--success);
  --color-success-foreground: var(--success-foreground);
  --color-warning: var(--warning);
  --color-warning-foreground: var(--warning-foreground);
  --color-info: var(--info);
  --color-info-foreground: var(--info-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
}

/* Added new admin layout styles for consistent header/sidebar design */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.sidebar {
  width: 280px;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--sidebar-primary);
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo i {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.logo span {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary);
  font-size: 1.4rem;
}

.sidebar-menu {
  padding: 1rem 0;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--sidebar-foreground);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  margin: 0.25rem 0.75rem;
  border-radius: var(--radius);
}

.menu-item:hover {
  background: var(--sidebar-primary);
  color: var(--primary);
  transform: translateX(5px);
}

.menu-item.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--primary-foreground);
  box-shadow: 0 4px 15px rgba(22, 78, 99, 0.3);
}

.menu-item i {
  margin-right: 1rem;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar);
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--sidebar-primary);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  color: var(--sidebar-foreground);
  font-weight: 500;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  color: var(--destructive);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  font-weight: 500;
}

.logout-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  transform: translateX(5px);
}

.main-content {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
}

.sidebar-toggle:hover {
  background: var(--muted);
}

.page-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--foreground);
  font-size: 1.5rem;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.notification-btn:hover {
  background: var(--muted);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--destructive);
  color: var(--destructive-foreground);
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--muted);
  border-radius: var(--radius);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.profile-name {
  font-weight: 500;
  color: var(--foreground);
}

.content-wrapper {
  flex: 1;
  padding: 2rem;
  background: var(--background);
}

/* Login Page Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.login-card {
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  font-family: var(--font-heading);
  font-weight: bold;
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-header p {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--card-foreground);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input);
  color: var(--foreground);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.alert {
  padding: 0.75rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.alert-danger {
  background: #fee2e2;
  color: var(--destructive);
  border: 1px solid #fecaca;
}

.credentials-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  font-size: 0.85rem;
}

/* Dashboard Styles */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.nav-menu {
  list-style: none;
  padding: 1rem 0;
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--sidebar-foreground);
  text-decoration: none;
  transition: all 0.3s ease;
  border-radius: 0;
  position: relative;
  font-weight: 500;
}

.nav-link:hover {
  background: var(--sidebar-accent);
  color: var(--primary);
  transform: translateX(5px);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--primary-foreground);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.nav-icon {
  margin-right: 1rem;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.logout-link {
  color: var(--destructive) !important;
}

.logout-link:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: var(--destructive) !important;
}

/* Enhanced stat cards with modern design */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-card.primary::before {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.stat-card.success::before {
  background: linear-gradient(135deg, var(--success), #34d399);
}

.stat-card.warning::before {
  background: linear-gradient(135deg, var(--warning), #fbbf24);
}

.stat-card.info::before {
  background: linear-gradient(135deg, var(--info), #60a5fa);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.stat-card.primary .stat-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.stat-card.success .stat-icon {
  background: linear-gradient(135deg, var(--success), #34d399);
}

.stat-card.warning .stat-icon {
  background: linear-gradient(135deg, var(--warning), #fbbf24);
}

.stat-card.info .stat-icon {
  background: linear-gradient(135deg, var(--info), #60a5fa);
}

.stat-content {
  flex: 1;
}

.stat-content h3 {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-content .number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.stat-change {
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--destructive);
}

.stat-change.neutral {
  color: var(--muted-foreground);
}

/* Added content grid and quick actions */
.dashboard-content {
  margin-top: 2rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.content-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--secondary);
}

.card-header h3 {
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.card-header p {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  margin: 0;
}

.quick-actions {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--primary-foreground);
}

.action-btn.success {
  background: linear-gradient(135deg, var(--success), #34d399);
  color: var(--success-foreground);
}

.action-btn.info {
  background: linear-gradient(135deg, var(--info), #60a5fa);
  color: var(--info-foreground);
}

.action-btn.warning {
  background: linear-gradient(135deg, var(--warning), #fbbf24);
  color: var(--warning-foreground);
}

.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.action-btn i {
  font-size: 1.5rem;
}

.action-btn span {
  font-weight: 500;
  font-size: 0.9rem;
}

.system-info {
  padding: 2rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.info-label {
  font-weight: 500;
  color: var(--muted-foreground);
}

.info-value {
  font-weight: 600;
  color: var(--foreground);
}

.status-online {
  color: var(--success) !important;
}

.status-online i {
  font-size: 0.6rem;
  margin-right: 0.5rem;
}

/* Added footer styles as specified in requirements */
.admin-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  margin-left: 280px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.footer-left strong {
  color: var(--foreground);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.text-red-500 {
  color: #ef4444;
}

/* Responsive design improvements */
@media (max-width: 1024px) {
  .sidebar {
    width: 260px;
  }

  .main-content {
    margin-left: 260px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar-collapsed .sidebar {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .admin-footer {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .content-wrapper {
    padding: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
  }
}
