@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  /* Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --accent: #8b5cf6;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-blur: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 280px;
}

.dark {
  --bg: #020617;
  --surface: #0f172a;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1e293b;

  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg:
    0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}

/* Layout Structure */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
aside {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  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: 20px;
  box-shadow: var(--shadow-md);
}

.logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.sidebar-footer {
  margin-top: auto;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Main Content */
main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  max-width: 1400px;
  min-width: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
}

.header-title h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -1.5px;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Action Dropdown */
.action-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  z-index: 50;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-dropdown.active .dropdown-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.dropdown-menu button:hover {
  background: var(--bg);
  color: var(--primary);
}

/* View Control */
.content-view {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.content-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-tag {
  background: #10b981;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.recent-students-card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.compact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bg);
  transition: var(--transition);
}

.compact-item:hover {
  background: var(--border);
  transform: translateX(4px);
}

.compact-item .avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Stats Widgets */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

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

.stat-info .value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 2px;
}

/* Analytics Layout */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.chart-container {
  background: var(--surface);
  padding: 28px;
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: 380px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.chart-container.large {
  height: 480px;
}

.chart-container h2 {
  font-size: 1.25rem;
  margin-bottom: 24px;
  font-weight: 700;
}

/* Filters & Search */
.controls-bar {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-box i {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

select {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 44px;
  transition: var(--transition);
}

select:hover {
  border-color: var(--primary);
  background: var(--bg);
}

select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Student Grid */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.student-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 24px;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.student-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.student-card h3 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-info {
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.student-tag {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 14px;
  border: none;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.btn-text {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.btn-text:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Security Password Overlay */
.security-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
}

.security-card {
  background: var(--surface);
  padding: 40px;
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.security-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.security-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.security-card input {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
}

.security-card .btn {
  width: 100%;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--surface);
  width: 95%;
  max-width: 500px;
  border-radius: 32px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  font-weight: 700;
}

.modal-body {
  margin-bottom: 32px;
}

.modal-info-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: 16px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.modal-info-item:hover {
  background: var(--surface);
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.modal-info-item .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 700;
}

.modal-info-item .value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.modal-footer {
  display: flex;
  gap: 12px;
}

/* Responsive */
.mobile-only {
  display: none;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex;
  }

  aside {
    transform: translateX(-100%);
  }

  aside.active {
    transform: translateX(0);
  }

  main {
    margin-left: 0;
    padding: 20px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .controls-bar {
    flex-direction: column;
    gap: 12px;
  }

  .header-title h1 {
    font-size: 1.75rem;
  }
}

/* Print Styles */
@media print {

  aside,
  .header-actions,
  .controls-bar {
    display: none !important;
  }

  main {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .stat-card,
  .chart-container,
  .student-card {
    break-inside: avoid;
    border: 1px solid #eee !important;
    box-shadow: none !important;
  }
}

/* Utils */
.skeleton {
  background: linear-gradient(90deg,
      var(--bg) 25%,
      var(--border) 50%,
      var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite linear;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}