/* public/css/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #f0f2f5;
  --card:     #ffffff;
  --primary:  #09f172;
  --primary-h:#4338ca;
  --danger:   #dc2626;
  --success:  #16a34a;
  --text:     #1e1e2e;
  --muted:    #6b7280;
  --border:   #e5e7eb;
  --radius:   10px;
  --shadow:   0 4px 24px rgba(0,0,0,.08);
  --glass-gradient: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  --primary-gradient: linear-gradient(135deg, var(--primary), var(--primary-h));
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--primary-gradient);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--text);
  min-height: 100vh;
}

/* ── Auth oldalak ── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 20px;
}
.auth-logo .logo-icon { font-size: 2.4rem; }
.auth-logo h1 { font-size: 1.6rem; color: var(--primary); margin-top: 4px; }

.auth-box h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--muted);
  text-align: center;
}

/* ── Form elemek ── */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group label small {
  font-weight: 400;
  color: var(--muted);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: .95rem;
  transition: border-color .2s;
  outline: none;
  background: #fafafa;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  background: #fff;
}

/* ── Gombok ── */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border: none;
  border-radius: 7px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, opacity .2s;
}
.hidden {
  display: none !important;
}
.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  margin-top: 6px;
}
.btn-primary:hover { background: var(--primary-h); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-small {
  padding: 6px 14px;
  font-size: .85rem;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
}

/* ── Üzenetek ── */
.alert {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: .9rem;
  margin-bottom: 14px;
}
.alert-error   { background: #fee2e2; color: var(--danger); border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: var(--success); border: 1px solid #86efac; }

/* ── Auth váltó link ── */
.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: .88rem;
  color: var(--muted);
}
.auth-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ── Dashboard / navbar ── */
.navbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.navbar .logo { font-size: 1.1rem; font-weight: 700; color: var(--primary); flex: 1; }

.container {
  max-width: 900px;
  margin: 36px auto;
  padding: 0 24px;
  border: 10px solid rgb(151, 240, 166);
  border-radius: 15px;
  border-style: ridge;
}

.quiz-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  margin-bottom: 22px;
  
}

.quiz-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border: 10px solid rgb(101, 115, 240);
  border-radius: 15px;
  border-style: ridge;
}

.quiz-card h3 {
  margin-bottom: 8px;
}

.quiz-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: .9rem;
}

.quiz-card-actions {
  margin-top: 14px;
}

.quiz-take-header {
  margin-bottom: 20px;
}

.quiz-take-header h2 {
  margin-bottom: 6px;
}

.quiz-questions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.question-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  border: 10px solid rgb(151, 240, 166);
  border-radius: 15px;
  border-style: ridge;
}

.question-block-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.question-num {
  font-weight: 700;
  color: var(--primary);
}

.question-points {
  font-size: .85rem;
  color: var(--muted);
}

.question-block-text {
  font-size: 1rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.question-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1.35;
}

.choice-row input {
  margin-top: 3px;
  flex-shrink: 0;
}

.question-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: .95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  background: #fafafa;
}

.question-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.quiz-take-form .btn-primary {
  max-width: 320px;
}

.quiz-submit-row {
  margin-top: 8px;
  margin-bottom: 28px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  background: #f9fafb;
  font-size: .85rem;
}

.container a.table-link {
  color: var(--primary-h);
  font-weight: 600;
  text-decoration: underline;
}

.container a.table-link:hover {
  color: var(--primary);
}

.upload-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 16px 0 20px;
}

.upload-panel h3 {
  margin-bottom: 8px;
}

.upload-panel p {
  color: var(--muted);
  margin-bottom: 12px;
}

.completed-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 16px 0 20px;
}
.completed-panel h3 {
  margin-bottom: 8px;
}

.completed-panel p {
  color: var(--muted);
  margin-bottom: 12px;
}

.quiz-frame-container {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #000;
}

.quiz-frame {
  width: 100%;
  height: 100%;
  border: 0;
}

.embedded-container {
  padding: 0;
  margin: 0;
  max-width: 100vw;
  width: 100%;
  min-height: 100vh;
  border: none;
  overflow: auto;
}

textarea#json_data {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: .95rem;
  font-family: Consolas, 'Courier New', monospace;
  background: #fafafa;
}

textarea#json_data:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--text);
}

.exam-lock-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.85);
  z-index: 1100;
}

.exam-lock-overlay.hidden {
  display: none;
}

.exam-lock-modal {
  max-width: 560px;
  width: 100%;
  padding: 24px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.exam-lock-modal h3 {
  margin-bottom: 14px;
}

.exam-lock-modal p {
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.6;
}

.exam-lock-tip {
  font-size: .95rem;
  color: var(--muted);
}

.modal-small {
  max-width: 480px;
}

.modal-error {
  padding: 10px 12px;
  margin-top: 12px;
  border-radius: 7px;
  background: #fee2e2;
  color: var(--danger);
}

.modal-error.hidden {
  display: none;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1200;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(940px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-header {
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
}

.modal-close-btn {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

.modal-body {
  overflow-y: auto;
  padding: 18px 22px 0;
  display: grid;
  gap: 16px;
}

.modal-body .modal-loading {
  color: var(--muted);
}

.modal-question {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.modal-question-header {
  margin-bottom: 10px;
}

.modal-question-body {
  display: grid;
  gap: 10px;
}

.modal-answer-text {
  color: var(--text);
}

.modal-score-label {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.modal-score-label input {
  margin-top: 6px;
  width: 120px;
  display: block;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
}

.modal-footer {
  gap: 16px;
  border-top: 1px solid var(--border);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-submission-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
}
