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

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131a26;
  --bg-tertiary: #1c2536;
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #a855f7; /* Purple */
  --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-error: #f87171;
  --text-success: #34d399;
  --border-color: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(20, 27, 41, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --font-sans: 'Inter', sans-serif;
  --border-radius: 12px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Gradient Background Highlights */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}
.bg-glow-1 {
  top: -100px;
  left: -100px;
  background: var(--accent-primary);
}
.bg-glow-2 {
  bottom: -150px;
  right: -150px;
  background: var(--accent-secondary);
}

/* Containers & Layouts */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-user span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Main Dashboard Layout */
main {
  flex: 1;
  padding: 30px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.dashboard-title-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.dashboard-title-section h1 {
  font-size: 1.8rem;
  font-weight: 600;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 30px;
}

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

/* Cards & Sections */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.input-wrapper {
  position: relative;
}

input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  width: 100%;
}

.btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--text-error);
  color: var(--text-error);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  width: auto;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(52, 211, 153, 0.1);
  color: var(--text-success);
}

.badge-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--text-error);
}

/* Student Dashboard Custom UI */
.profile-card {
  text-align: center;
  padding: 40px;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--accent-gradient);
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.profile-email {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 25px;
}

.session-info {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-top: 20px;
  border: 1px solid var(--border-color);
}

.session-info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.session-info-item:last-child {
  margin-bottom: 0;
}

.session-info-label {
  color: var(--text-muted);
}

.session-info-value {
  font-weight: 500;
}

/* Toast Messages */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-primary);
  border-radius: 6px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-error {
  border-left-color: var(--text-error);
}

.toast-success {
  border-left-color: var(--text-success);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.4s ease-out forwards;
}

.role-switcher {
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.role-switcher a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.role-switcher a:hover {
  text-decoration: underline;
}

.generated-pass-container {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.generated-pass {
  flex: 1;
  font-family: monospace;
  font-size: 1.1rem;
  color: var(--text-success);
  letter-spacing: 1px;
}

.btn-copy {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--accent-primary);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-copy:hover {
  background: rgba(99, 102, 241, 0.3);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 30px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow);
  transform: translateY(-50px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.show .modal-content {
  transform: translateY(0);
}

.status-alert-info {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
}
.status-alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--text-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
}
.status-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
}
.status-alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
}

/* Stepper CSS */
.stepper-step {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.stepper-bullet {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  font-size: 0.8rem;
  z-index: 2;
  transition: all 0.3s ease;
}
.stepper-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.3s ease;
}
/* Stepper states */
.stepper-step.active .stepper-bullet {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}
.stepper-step.active .stepper-label {
  color: var(--text-main);
  font-weight: 600;
}
.stepper-step.completed .stepper-bullet {
  border-color: var(--text-success);
  background: var(--text-success);
  color: white;
}
.stepper-step.completed .stepper-label {
  color: var(--text-success);
}
.stepper-step.failed .stepper-bullet {
  border-color: #ef4444;
  background: #ef4444;
  color: white;
}
.stepper-step.failed .stepper-label {
  color: #ef4444;
}
