/* Easy Function - Custom Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #0f172a;
  --accent: #f59e0b;
  --bg-light: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Prompt', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

code, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Header & Navigation */
header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: #ffffff;
}

.brand-icon {
  background: var(--accent);
  color: #0f172a;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  font-size: 1.15rem;
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-text span {
  font-size: 0.78rem;
  color: #cbd5e1;
  display: block;
}

.nav-tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-radius: 10px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
  border-color: #ffffff;
  font-weight: 600;
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.25rem 3rem;
}

.section-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.section-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 1.25rem;
}

.section-header h2 {
  font-size: 1.55rem;
  color: var(--secondary);
  margin-bottom: 0.25rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Cards & Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.35rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.card h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--primary-dark);
  font-weight: 600;
}

.formula-box {
  background: #f1f5f9;
  border-left: 4px solid var(--primary);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
  margin: 0.75rem 0;
  color: #0f172a;
  overflow-x: auto;
}

/* Forms & Touch Controls */
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--secondary);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

.input-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.btn {
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border: none;
  border-radius: 10px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: #ffffff;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: #eff6ff;
}

.btn-sm {
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

/* Result & Step Box */
.result-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.status-ok {
  color: #065f46;
  background: #d1fae5;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.status-no {
  color: #991b1b;
  background: #fee2e2;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 0.5rem;
}

/* Canvas Wrappers */
.canvas-wrapper {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
}

.graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Quiz Section */
.quiz-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.quiz-option {
  width: 100%;
  min-height: 48px;
  text-align: left;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  background: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.98rem;
  cursor: pointer;
  transition: all 0.15s;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--primary);
  background: #eff6ff;
}

.quiz-option.selected {
  border-color: var(--primary);
  background: #dbeafe;
  font-weight: 600;
}

.quiz-option.correct {
  border-color: var(--success);
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
}

.quiz-option.wrong {
  border-color: var(--danger);
  background: #fee2e2;
  color: #991b1b;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

footer {
  text-align: center;
  padding: 1.75rem 1rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.88rem;
  background: #ffffff;
}

@media (max-width: 640px) {
  .brand-text h1 { font-size: 1.15rem; }
  .card { padding: 1rem; }
  .section-header h2 { font-size: 1.3rem; }
}
