/* ═══════════════════════════════════════════════════════
   NeoCalculator.net — Pythagorean Theorem Calculator CSS
   (Supports Light & Dark Modes + Full Responsiveness)
   ═══════════════════════════════════════════════════════ */

/* --- Container & Card Panel --- */
.pyth-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 16px 60px;
}

.pct-card-panel {
  background: var(--bg-card, #ffffff);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border, #e2e8f0);
  margin-bottom: 30px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.pct-card-panel h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark, #0f172a);
  margin-bottom: 6px;
}

.pyth-inst {
  margin-bottom: 24px;
  color: var(--text-light, #64748b);
  font-size: 0.95rem;
}

/* --- Form Layout & Input Styling --- */
.pyth-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  background: var(--bg-input, #f8fafc);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
}

.pyth-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pyth-input-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark, #0f172a);
}

.pyth-input {
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border, #cbd5e1);
  background-color: var(--bg-card, #ffffff);
  color: var(--text-dark, #0f172a);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

.pyth-input::placeholder {
  color: var(--text-light, #94a3b8);
  opacity: 0.7;
}

.pyth-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* --- Action Buttons --- */
.pct-action-btns {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn {
  height: 44px;
  padding: 0 24px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: #2563eb;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: var(--bg-input, #e2e8f0);
  color: var(--text-dark, #334155);
  border: 1px solid var(--border, #cbd5e1);
}

.btn-secondary:hover {
  filter: brightness(0.9);
}

/* --- Responsive Result Section --- */
.pct-result-box {
  margin-top: 28px;
  padding: 24px;
  background: var(--bg-card, #ffffff);
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.pct-result-box h3 {
  font-size: 1.25rem;
  color: var(--text-dark, #0f172a);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border, #e2e8f0);
}

.pyth-result-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: center;
}

.pyth-diagram-card {
  background-color: var(--bg-input, #f8fafc);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  display: flex;
  justify-content: center;
  align-items: center;
}

.pyth-diagram-card svg {
  width: 100%;
  height: auto;
  max-width: 240px;
}

.pyth-results-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.pyth-results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
}

.pyth-results-table th,
.pyth-results-table td {
  padding: 12px 16px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.pyth-results-table tr:last-child th,
.pyth-results-table tr:last-child td {
  border-bottom: none;
}

.pyth-results-table th {
  background: var(--bg-input, #f1f5f9);
  color: var(--text-light, #64748b);
  font-weight: 600;
  text-align: left;
  width: 45%;
}

.pyth-results-table td {
  color: var(--text-dark, #0f172a);
  font-weight: 500;
}

/* Steps Box with High Contrast for Dark Mode */
.pyth-steps-box {
  margin-top: 20px;
  background-color: var(--bg-input, #f0fdf4);
  border: 1px solid var(--border, #bbf7d0);
  border-radius: 8px;
  padding: 16px;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-dark, #166534);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════
   DARK MODE OVERRIDES ([data-theme="dark"] or .dark-theme)
   ═══════════════════════════════════════════════════════ */

[data-theme="dark"] .pyth-diagram-card svg text,
.dark-theme .pyth-diagram-card svg text {
  fill: #f1f5f9 !important;
}

/* Pythagorean Result Table - Dark Mode Text Fix */
[data-theme="dark"] .pyth-results-table td,
[data-theme="dark"] .pyth-results-table td strong,
.dark-theme .pyth-results-table td,
.dark-theme .pyth-results-table td strong {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .pyth-steps-box,
.dark-theme .pyth-steps-box {
  background-color: #0f291e;
  border-color: #166534;
  color: #4ade80;
}

[data-theme="dark"] .btn-secondary,
.dark-theme .btn-secondary {
  background-color: #334155;
  color: #f8fafc;
  border-color: #475569;
}

[data-theme="dark"] .btn-secondary:hover,
.dark-theme .btn-secondary:hover {
  background-color: #475569;
}

/* Mobile Screen Responsiveness */
@media (max-width: 768px) {
  .pyth-result-grid {
    grid-template-columns: 1fr;
  }
  .pct-action-btns {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
}