/* 
 * Exam Cell Vault - Premium Stylesheet
 * Custom designed with a modern dark theme, smooth micro-animations, and glassmorphism.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #121826;
  --bg-card: #172033;
  --border-color: #242f49;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #6366f1;
  --accent-secondary: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);
  
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-error: #ef4444;
  --color-error-bg: rgba(239, 68, 68, 0.1);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Typography */
h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

p {
  color: var(--text-secondary);
}

/* Topbar Navigation */
.topbar {
  background-color: rgba(18, 24, 38, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #fff 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: var(--transition);
}

.brand:hover {
  opacity: 0.9;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-actions span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.nav-actions a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-actions a:hover {
  color: var(--accent-primary);
}

.nav-actions form {
  display: inline;
}

/* Buttons & Interactive Elements */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 14px 0 var(--accent-glow);
}

button:hover, .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--accent-glow);
  opacity: 0.95;
}

button:active, .button:active {
  transform: translateY(0);
}

button.secondary, .button.secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: none;
}

button.secondary:hover, .button.secondary:hover {
  background: var(--bg-card);
  border-color: var(--accent-primary);
}

button.ghost {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 6px 12px;
}

button.ghost:hover {
  color: var(--color-error);
  transform: none;
  box-shadow: none;
}

/* Forms & Inputs */
form.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input, textarea, select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 16px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  transition: var(--transition);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input[type="file"] {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  padding: 20px;
  cursor: pointer;
  text-align: center;
}

input[type="file"]:hover {
  border-color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.02);
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  background: radial-gradient(circle at top, var(--accent-glow) 0%, transparent 60%);
}

.hero > div {
  max-width: 720px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-primary);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 24px;
}

.hero p {
  font-size: 1.15rem;
  margin-bottom: 40px;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* Panel Containers */
.panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.panel.narrow {
  max-width: 480px;
  margin: 40px auto;
}

/* Layout Columns */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .columns {
    grid-template-columns: 1fr;
  }
}

/* Grid Dashboard */
.page-title {
  margin-bottom: 32px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

/* Dashboard Items/Cards */
.item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: var(--transition);
}

.item:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.item-head h2 {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.item-head p {
  font-size: 0.9rem;
}

/* Status Badges */
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.open {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge.closed {
  background-color: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Description Lists (Metadata on Cards) */
dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 0.88rem;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

dt {
  color: var(--text-muted);
  font-weight: 500;
}

dd {
  color: var(--text-primary);
  text-align: right;
}

/* Notifications & Messages */
.notice, .error, .success {
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
}

.notice {
  background-color: var(--color-warning-bg);
  color: var(--color-warning);
  border-left: 4px solid var(--color-warning);
}

.error {
  background-color: var(--color-error-bg);
  color: var(--color-error);
  border-left: 4px solid var(--color-error);
}

.error.soft {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 12px;
  justify-content: center;
  margin-bottom: 0;
}

.success {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  border-left: 4px solid var(--color-success);
}

.hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Upload Form Alignment inside Cards */
.upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upload input[type="file"] {
  padding: 12px;
  font-size: 0.85rem;
}

/* Empty State */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

/* Custom Table View in Admin Panels */
.table {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.table .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background-color: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: var(--transition);
}

.table .row:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--text-muted);
}

.table .row strong {
  color: #fff;
  flex: 1;
}

.table .row span {
  color: var(--text-secondary);
  margin: 0 16px;
}

.table .row a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.table .row a:hover {
  color: #fff;
}

/* BEFORE - targets ALL links including dropdown */
.nav-actions a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-actions a:hover {
  color: var(--accent-primary);
}

/* AFTER - only targets direct child links, not dropdown links */
.nav-actions > a,
.nav-actions > form > button {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-actions > a:hover {
  color: var(--accent-primary);
}

.dropdown {
  position: relative;
  display: inline-block;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--accent-primary);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  padding: 6px 0;
}

/* ✅ This works now because .nav-actions > a no longer targets these */
.dropdown-content a {
  display: block;
  padding: 10px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.dropdown-content a:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
}

.dropdown:hover .dropdown-content {
  display: block;
}

