:root {
  --primary: #8a2be2;
  --primary-hover: #9c4dcc;
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --success: #10b981;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

.container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Glassmorphism Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  transition: transform 0.2s ease;
}

h1, h2, h3 {
  margin-bottom: 1rem;
  font-weight: 700;
  background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  background: linear-gradient(90deg, #c084fc 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
}

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

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

/* Inputs & Buttons */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

input[type="text"], 
textarea, 
select {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus, 
textarea:focus, 
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Auth Overlay for Admin */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-overlay.hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

/* Flex utilities */
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }

/* Test builder specific */
.question-builder {
  border-left: 4px solid var(--primary);
  position: relative;
}

.remove-q-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.remove-q-btn:hover {
  color: var(--danger);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Viewer Test */
.viewer-question {
  margin-bottom: 2rem;
}

.radio-option {
  display: block;
  margin-bottom: 0.5rem;
  padding: 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.radio-option:hover {
  background: rgba(255,255,255,0.1);
}

.radio-option input[type="radio"] {
  margin-right: 0.8rem;
  accent-color: var(--primary);
}

/* Beautiful Answers Styling */
.answer-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.5rem;
}

.answer-question {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.answer-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
}

/* Print Styles */
@media print {
  body, html {
    background: #fff;
    color: #000;
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
  }
  .no-print, .btn, header, footer {
    display: none !important;
  }
  .container {
    padding: 0;
    max-width: 100%;
  }
  .card {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 2rem !important;
  }
  #submissionsList > div {
    background: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
    margin-bottom: 1rem !important;
  }
  .answer-item {
    border: 1px solid #eee !important;
    background: none !important;
  }
  .answer-value {
    color: #000 !important;
    font-weight: bold;
  }
  h1, h2, h3 {
    background: none;
    -webkit-text-fill-color: #000;
    color: #000;
  }
  .question-builder {
    border-left: none;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1rem;
  }
  input[type="text"] {
    border: none;
    border-bottom: 1px dotted #000;
    border-radius: 0;
    background: transparent;
    color: #000;
  }
  select {
    display: none;
  }
}
