/* ===== GLOBAL ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 30px;
  font-family: "Inter", system-ui;
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  color: #1e293b;
  transition: background 0.3s, color 0.3s;
}

/* ===== DARK MODE ===== */
body.dark {
  background: linear-gradient(135deg, #0f172a, #020617);
  color: #e5e7eb;
}

/* ===== HEADER ===== */
h1 {
  text-align: center;
  font-size: 2.6rem;
  margin-bottom: 35px;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== CARDS ===== */
.card {
  background: rgba(255,255,255,0.9);
  border-radius: 18px;
  padding: 25px 30px;
  margin-bottom: 30px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

body.dark .card {
  background: rgba(15,23,42,0.9);
}

/* ===== TEXTAREA ===== */
textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #c7d2fe;
}

/* ===== FILE UPLOAD ===== */
.file-upload span {
  display: inline-block;
  padding: 12px 18px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.file-name {
  margin-left: 12px;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ===== BUTTONS ===== */
button {
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  margin-right: 10px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(79,70,229,0.5);
}

/* ===== TABLE ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px;
}

thead {
  background: #eef2ff;
}

tbody tr:hover {
  background: #e0e7ff;
}

/* ===== BADGES ===== */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.easy { background: #bbf7d0; color: #065f46; }
.medium { background: #fde68a; color: #92400e; }
.hard { background: #fecaca; color: #7f1d1d; }

/* ===== INSIGHTS ===== */
#insightsList li {
  margin-bottom: 8px;
}
.mcq {
  background: #f1f5f9;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 15px;
}

body.dark .mcq {
  background: #020617;
}

.mcq ul {
  list-style: none;
  padding-left: 0;
}
.mcq-box {
  background: #f9f9ff;
  border-left: 4px solid #6c63ff;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 6px;
}

.mcq-box ul {
  margin-left: 20px;
}

.answer {
  color: green;
  font-weight: bold;
}

/* dropdown toggles */

.toggle{
cursor:pointer;
display:flex;
justify-content:space-between;
align-items:center;
user-select:none;
}

.toggle span{
transition:0.3s;
}

.card.collapsed > *:not(h2){
display:none;
}

.card.collapsed h2 span{
transform:rotate(-90deg);
}

/* Loader Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: white;
  font-weight: 600;
}

.hidden {
  display: none;
}

/* Spinner */
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #6c63ff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.card.collapsed > *:not(h2) {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.empty-msg {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 15px;
}
/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 14px 20px;
  border-radius: 8px;
  font-weight: 600;
  color: white;
  z-index: 9999;
  min-width: 250px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: #2ecc71;
}

.toast.error {
  background: #e74c3c;
}

.toast.warning {
  background: #f39c12;
}

.hidden {
  display: none;
}

@keyframes slideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}