/* Error Pages - Unified Professional Theme (Teal palette from dashboard/student-info) */

:root {
  --primary: #00695C;       /* Deep Teal */
  --primary-600: #004D40;   /* Dark Teal */
  --primary-200: #E0F2F1;   /* Light Teal */
  --accent: #26A69A;        /* Teal */
  --accent-2: #80CBC4;      /* Light Aqua */
  --bg: #f9fbfa;            /* App background */
  --text: #1f2937;          /* Slate-800 */
  --muted: #6b7280;         /* Slate-500 */
  --danger: #d9534f;        /* Error red consistent with student-info toast-error */
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: linear-gradient(135deg, var(--bg), #f2fefc 60%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.error-wrap { width: 100%; }

.error-card {
  width: min(760px, 92vw);
  margin: 0 auto;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
  padding: 28px 24px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid #e6f4f3;
}

/* Accent top bar using theme gradient */
.error-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-2));
}

.error-icon {
  width: 120px;
  height: 120px;
  margin: 8px auto 6px;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.12));
  animation: float 3.5s ease-in-out infinite;
}

.error-icon img, .error-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.error-code {
  font-size: clamp(48px, 9vw, 92px);
  line-height: 1;
  margin: 2px 0 4px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--danger);
}

.error-title {
  font-size: clamp(20px, 3.4vw, 28px);
  font-weight: 700;
  margin: 2px 0 12px;
  color: #0f172a;
}

.message-main {
  font-size: 17px;
  color: var(--muted);
  margin: 0 auto 10px;
  max-width: 60ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;         /* truncate long messages (main line) */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-details {
  width: min(740px, 94%);
  margin: 10px auto 0;
  text-align: left;
}

.message-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
  outline: none;
}

.message-details summary::-webkit-details-marker { display: none; }

.message-details summary::after {
  content: " ⌄";
  color: var(--primary);
  transition: transform 0.25s ease;
}

.message-details[open] summary::after { transform: rotate(180deg); }

.details-body {
  margin-top: 8px;
  background: var(--primary-200);
  border: 1px solid var(--accent-2);
  color: #374151;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.meta {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px 16px;
}

.meta li { color: #374151; }
.meta strong { color: #111827; font-weight: 700; }

.actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  will-change: transform;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px rgba(0, 105, 92, 0.25);
}

.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(0, 105, 92, 0.28); }
.btn.primary:active { transform: translateY(0); }

.btn.secondary {
  background: #eef6f6;
  color: var(--primary);
  border: 1px solid #cfe7e5;
}

.btn.secondary:hover { background: #e7f2f1; }

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

/* Small screens */
@media (max-width: 480px) {
  .error-card { padding: 22px 16px 18px; border-radius: 16px; }
  .error-icon { width: 96px; height: 96px; }
  .message-main { font-size: 16px; }
  .btn { padding: 10px 14px; border-radius: 10px; }
}
