/* ═══════════════════════════════════════════════════════
   NeoCalculator.net — Modern Triangle Calculator Styling
   ═══════════════════════════════════════════════════════ */

.tri-calc-card {
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

.tri-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.tri-input-panel h3,
.tri-diagram-panel h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-light, #0f172a);
  margin-bottom: 6px;
}

.tri-subtext {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 18px;
}

.tri-field-group {
  background: var(--bg-input, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.tri-section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent, #2563eb);
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.tri-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.tri-input-row:last-child {
  margin-bottom: 0;
}

.tri-input-row label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-light, #1e293b);
  min-width: 100px;
}

.tri-input-row input {
  width: 100%;
  max-width: 160px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border, #cbd5e1);
  background: var(--bg-card, #ffffff);
  color: var(--text-light, #0f172a);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tri-input-row input:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.tri-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.btn-primary {
  background: var(--accent, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-input, #e2e8f0) !important;
  color: var(--text-light, #334155) !important;
  border: 1px solid var(--border, #cbd5e1) !important;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

/* Diagram Panel */
.tri-diagram-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-input, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 20px;
}

.tri-svg-wrapper {
  width: 100%;
  max-width: 360px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px;
  margin: 14px 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

#triangleSvg {
  width: 100%;
  height: 100%;
}

.tri-badges-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.tri-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
}

/* Modern Card Grid Results View */
.tri-results-container {
  margin-top: 32px;
  border-top: 2px dashed var(--border, #e2e8f0);
  padding-top: 24px;
}

.tri-results-container h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-light, #0f172a);
  margin-bottom: 18px;
}

.tri-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}

.tri-result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-input, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
}

.tri-result-card.highlight {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.tri-result-card.highlight .tri-res-val {
  color: #15803d;
}

.tri-res-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted, #475569);
}

.tri-res-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light, #0f172a);
  font-family: inherit;
}

.error-box {
  margin-top: 14px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
}

/* Accordion FAQ Styling */
.faq-section {
  margin-top: 44px;
}

.faq-section h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-light, #0f172a);
  margin-bottom: 20px;
}

.faq-item {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--bg-card, #ffffff);
  transition: border-color 0.2s ease;
}

.faq-item.active {
  border-color: var(--accent, #2563eb);
}

.faq-question {
  width: 100%;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-light, #1e293b);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: var(--bg-input, #f8fafc);
}

.faq-icon {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
  color: var(--text-muted, #64748b);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--accent, #2563eb);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 22px;
  color: var(--text-muted, #475569);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 10px 22px 20px 22px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .tri-calc-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tri-results-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tri-input-row label {
    min-width: 80px;
  }

  .tri-input-row input {
    max-width: 100%;
  }

  .tri-calc-card {
    padding: 18px;
  }
}