/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f4f8;
  color: #333;
  min-height: 100vh;
}

/* ─── Navigation ────────────────────────────────────────────── */
nav {
  background: #4f46e5;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav .brand {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
}

nav a {
  color: #c7d2fe;
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav a:hover {
  color: #fff;
}

/* ─── Page wrapper ──────────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  color: #1e1b4b;
}

.subtitle {
  color: #6b7280;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ─── Card ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ─── Form ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.4rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #374151;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background: #fafafa;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #4f46e5;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ─── Star Rating ───────────────────────────────────────────── */
.star-rating {
  display: flex;
  flex-direction: row-reverse;
  gap: 0.25rem;
}

.star-rating input {
  display: none;
}

.star-rating label {
  font-size: 2rem;
  color: #d1d5db;
  cursor: pointer;
  transition: color 0.15s;
  margin: 0;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: #f59e0b;
}

/* ─── Button ────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-primary {
  background: #4f46e5;
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: #4338ca;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background: #a5b4fc;
  cursor: not-allowed;
}

/* ─── Alert messages ────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  display: none;
}

.alert.show {
  display: block;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ─── Feedback list ─────────────────────────────────────────── */
.feedback-grid {
  display: grid;
  gap: 1rem;
}

.feedback-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  border-left: 4px solid #4f46e5;
}

.feedback-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.feedback-card .student {
  font-weight: 700;
  font-size: 1rem;
  color: #1e1b4b;
}

.feedback-card .course {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.feedback-card .stars {
  color: #f59e0b;
  font-size: 1.1rem;
}

.feedback-card .comments {
  font-size: 0.9rem;
  color: #4b5563;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.feedback-card .date {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.75rem;
}

/* ─── Empty state ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}

.empty-state p {
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* ─── Loading spinner ───────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-size: 0.95rem;
}

.spinner::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 1rem;
  border: 3px solid #e5e7eb;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ─── Nav link active ───────────────────────────────────────── */
nav a.active {
  color: #fff;
  font-weight: 600;
}

/* ─── Sentiment Badge ───────────────────────────────────────── */
.sentiment-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-positive {
  background: #d1fae5;
  color: #065f46;
}

.badge-neutral {
  background: #fef9c3;
  color: #713f12;
}

.badge-negative {
  background: #fee2e2;
  color: #991b1b;
}

/* ─── AI Summary ─────────────────────────────────────────────── */
.ai-summary {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 0.5rem;
  font-style: italic;
  border-left: 3px solid #e5e7eb;
  padding-left: 0.6rem;
}
