/* Core Variables and Resets */
:root {
  --bg: #fff;
  --text: #111;
  --muted: #666;
  --line: #e6e6e6;
  --panel: #fafafa;
  --primary: #111;
  --accent-blue: #4299e1;
  --accent-orange: #ed8936;
  --accent-purple: #9f7aea;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 14px; }

/* Header and Navigation */
.top { border-bottom: 1px solid var(--line); background: #fff; }
.top__row { 
  display: flex; 
  gap: 16px; 
  align-items: center; 
  justify-content: space-between; 
  padding: 14px; 
}
.brand { font-weight: 800; font-size: 18px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.role { display: flex; gap: 10px; flex-wrap: wrap; }

/* Layout Panels */
.panel { 
  border: 1px solid var(--line); 
  background: var(--panel); 
  border-radius: 10px; 
  padding: 14px; 
  margin: 14px 0; 
}
.h2 { margin: 0 0 10px; font-size: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }

/* Form Elements */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 170px; flex: 1; }
label { font-size: 12px; color: var(--muted); }
input, select { 
  padding: 10px; 
  border: 1px solid var(--line); 
  border-radius: 8px; 
  background: #fff; 
  font-size: 14px;
}

/* Buttons */
.btn { 
  display: inline-block; 
  padding: 10px 12px; 
  border-radius: 8px; 
  border: 1px solid var(--primary); 
  background: var(--primary); 
  color: #fff; 
  text-decoration: none; 
  font-weight: 700; 
  cursor: pointer; 
  text-align: center;
}
.btn--ghost { background: #fff; color: var(--primary); border: 1px solid var(--line); }
.btn--disabled { opacity: 0.5; pointer-events: none; }

.smallbtn { 
  padding: 8px 10px; 
  border-radius: 8px; 
  border: 1px solid var(--line); 
  background: #fff; 
  cursor: pointer; 
  font-weight: 700; 
  font-size: 13px;
}
.smallbtn--primary { border: 1px solid var(--primary); background: var(--primary); color: #fff; }

/* Grid and Cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { 
  .grid { grid-template-columns: 1fr; } 
  .field { min-width: 140px; }
}

.card { 
  border: 1px solid var(--line); 
  background: #fff; 
  border-radius: 10px; 
  padding: 12px; 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.card__title { font-weight: 800; }
.card__meta { color: var(--muted); font-size: 12px; }

/* New: Card Icons (Calculator & Skills) */
.card__icons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0;
}
.card__icons i { color: #4a5568; font-size: 14px; }

/* New: Skill Badges */
.skill-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #edf2f7;
  color: #2d3748;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  border: 1px solid var(--line);
}

/* Metadata and Badges */
.meta { color: var(--muted); margin-top: 10px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { 
  border: 1px solid var(--line); 
  border-radius: 999px; 
  padding: 3px 8px; 
  font-size: 12px; 
  color: var(--muted); 
}

/* Practice Interface Specifics */
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.dp-diagram { margin-bottom: 12px; text-align: center; }
.dp-diagram svg { max-width: 100%; height: auto; border-radius: 8px; }

#hintBox {
  max-height: 280px;
  overflow: auto;
  scroll-behavior: smooth;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

#solutionBox {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
}

/* Utilities */
.empty { color: var(--muted); padding: 20px 0; text-align: center; }
.footer { padding: 18px 14px 30px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 40px; }
.fine { font-size: 12px; color: var(--muted); }
.link { color: inherit; }

/* Zoom Modal */
.zoom-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 9999;
    display: none; align-items: center; justify-content: center;
    cursor: zoom-out;
}
.zoom-modal.active { display: flex; animation: fadeIn 0.2s; }
.zoom-modal svg {
    background: #fff; max-width: 95%; max-height: 95%;
    border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(1.5); /* Initial magnification */
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

