/* ═══════════════════════════════════════════════════════════════════════════
   EXPERTS CALCULATORS — Calculator tools page
   ═══════════════════════════════════════════════════════════════════════════ */

/* Import shared calculator styles from experts/grades.css */
@import url('./experts/grades.css');

#experts-calculators {
  position: fixed;
  inset: 0;
  background: #F9F8F6;
  z-index: 10000;
  overflow: hidden;
  animation: calcFadeIn 0.2s ease;
}

@keyframes calcFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#experts-calculators.fade-out {
  animation: calcFadeOut 0.2s ease forwards;
}

@keyframes calcFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.calculators-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */

.calculators-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: #fff;
  border-bottom: 1px solid #E8E7E3;
}

.calculators-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid #E8E7E3;
  border-radius: 8px;
  cursor: pointer;
  color: #5C5A54;
  transition: all 0.15s;
}

.calculators-back-btn:hover {
  background: #F4F3EE;
  border-color: #ff005c;
  color: #1A1918;
}

.calculators-title-area {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calculators-subtitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ff005c;
}

.calculators-title {
  font-size: 20px;
  font-weight: 600;
  color: #1A1918;
  margin: 0;
}

/* ─── Content ───────────────────────────────────────────────────────────────── */

.calculators-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ─── Navigation ────────────────────────────────────────────────────────────── */

.calculators-nav {
  flex-shrink: 0;
  width: 220px;
  background: #fff;
  border-right: 1px solid #E8E7E3;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calculators-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #5C5A54;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.calculators-nav-btn:hover {
  background: #F4F3EE;
  color: #1A1918;
}

.calculators-nav-btn.active {
  background: linear-gradient(135deg, #ff005c 0%, #ff3d7f 100%);
  color: #fff;
}

.calculators-nav-btn svg {
  flex-shrink: 0;
}

/* ─── Panel ─────────────────────────────────────────────────────────────────── */

.calculators-panel {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

.calculator-view {
  display: none;
  max-width: 800px;
  margin: 0 auto;
}

.calculator-view.active {
  display: block;
}

/* GRADES calculator sizes to fit content (widest row determines width) */
#calc-view-grades {
  max-width: none;
  width: fit-content;
}

.calculator-view-header {
  margin-bottom: 24px;
}

.calculator-view-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1A1918;
  margin: 0 0 8px;
}

.calculator-view-header p {
  font-size: 14px;
  color: #5C5A54;
  margin: 0;
  line-height: 1.5;
}

.calculator-view-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ─── Fees Redirect ─────────────────────────────────────────────────────────── */

.fees-redirect {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.fees-redirect-card {
  text-align: center;
  max-width: 400px;
}

.fees-redirect-card svg {
  color: #CDCBC4;
  margin-bottom: 16px;
}

.fees-redirect-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1A1918;
  margin: 0 0 8px;
}

.fees-redirect-card p {
  font-size: 14px;
  color: #5C5A54;
  margin: 0 0 20px;
  line-height: 1.5;
}

.fees-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #ff005c;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
}

.fees-open-btn:hover {
  background: #e00050;
}

/* ─── GRADES Standalone Styles ──────────────────────────────────────────────── */

.grades-calculator.standalone {
  max-width: 100%;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.grades-calculator.standalone .grades-main {
  flex: 0 0 auto;
}

.grades-calculator.standalone .grades-header {
  margin-bottom: 24px;
}

.grades-calculator.standalone .grades-title {
  font-size: 18px;
  font-weight: 600;
  color: #1A1918;
  margin: 0 0 8px;
}

.grades-calculator.standalone .grades-formula-display {
  background: #F4F3EE;
  padding: 8px 14px;
  border-radius: 6px;
  display: inline-block;
}

.grades-calculator.standalone .grades-formula {
  font-family: 'SF Mono', 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: #5C5A54;
}

.grades-calculator.standalone .grades-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.grades-input-group-inline {
  background: #F9F8F6;
  border-radius: 10px;
  padding: 16px;
}

.grades-calculator.standalone .grades-input-options {
  display: flex;
  gap: 8px;
}

.grades-calculator.standalone .grades-option {
  flex: 1;
  white-space: nowrap;
  padding: 10px 16px;
}

.grades-input-header-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.grades-input-desc-inline {
  font-size: 12px;
  color: #8A8880;
  margin: 0 0 12px;
  line-height: 1.4;
}

.grades-calculator.standalone .grades-result-inline {
  position: sticky;
  top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(135deg, #F9F8F6 0%, #F4F3EE 100%);
  border-radius: 12px;
  min-width: 200px;
  text-align: center;
}

.grades-result-inline {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, #F9F8F6 0%, #F4F3EE 100%);
  border-radius: 12px;
}

.grades-result-card-inline {
  flex: 1;
}

.grades-result-card-inline .grades-result-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8A8880;
  margin-bottom: 4px;
}

.grades-result-card-inline .grades-result-value {
  font-size: 32px;
  font-weight: 700;
  color: #1A1918;
}

.grades-priority-inline {
  flex: 1;
}

.grades-priority-inline .grades-priority-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8A8880;
  margin-bottom: 4px;
}

.grades-priority-inline .grades-priority-value {
  font-size: 18px;
  font-weight: 600;
  color: #5C5A54;
}

.grades-priority-inline .grades-priority-value.priority-critical {
  color: #0F6E56;
}

.grades-priority-inline .grades-priority-value.priority-high {
  color: #185FA5;
}

.grades-priority-inline .grades-priority-value.priority-medium {
  color: #EA580C;
}

.grades-priority-inline .grades-priority-value.priority-low {
  color: #8A8880;
}

.grades-reset-btn-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #E8E7E3;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #5C5A54;
  cursor: pointer;
  transition: all 0.15s;
}

.grades-reset-btn-inline:hover {
  background: #F4F3EE;
  border-color: #ff005c;
  color: #ff005c;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .calculators-content {
    flex-direction: column;
  }

  .calculators-nav {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid #E8E7E3;
  }

  .calculators-nav-btn {
    white-space: nowrap;
  }

  .calculators-panel {
    padding: 24px 20px;
  }

  .grades-calculator.standalone {
    flex-direction: column;
  }

  .grades-calculator.standalone .grades-result-inline {
    position: static;
    flex-direction: row;
    min-width: auto;
    width: 100%;
  }
}
