/* ═══════════════════════════════════════════════
   AHC Steel Weight Calculator — Stylesheet
   Plugin: ahc-steel-calculator
   Version: 1.0.0
═══════════════════════════════════════════════ */

.ahc-wrapper {
  --pc: #003B49; --pl: #005E6E; --pd: #00232F;
  --ac: #007A8A; --ad: #005A66;
  --sup: #CDA767; --sup-light: rgba(205,167,103,0.15);
  --bg: #FFFFFF; --tc: #111; --muted: #64748b;
  --border: #e2eaed; --field-bg: #f4f8fa;
  --glass: rgba(255,255,255,0.06);
  --shadow: 0 20px 60px rgba(0,35,47,0.18), 0 4px 16px rgba(0,35,47,0.08);

  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 16px 60px;
  box-sizing: border-box;
}

.ahc-wrapper *, .ahc-wrapper *::before, .ahc-wrapper *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Header ── */
.ahc-page-header { text-align: center; margin-bottom: 36px; }
.ahc-page-header .ahc-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sup-light); border: 1px solid rgba(205,167,103,0.35);
  color: #8a6a2a; border-radius: 100px; padding: 5px 14px;
  font-size: 12px; font-weight: 600; margin-bottom: 14px; letter-spacing: 0.3px;
}
.ahc-page-header span { font-size: 28px; font-weight: 800; color: var(--pd); margin-bottom: 8px; letter-spacing: -0.5px;display: block; }
.ahc-page-header p { font-size: 14.5px; color: var(--muted); }

/* ── Shell ── */
.ahc-calculator {
  display: flex; background: var(--bg); border-radius: 24px;
  box-shadow: var(--shadow); overflow: hidden; min-height: 560px;
  border: 1px solid rgba(255,255,255,0.7);
}

/* ══════════════════════════════════════
   DESKTOP SIDEBAR
══════════════════════════════════════ */
.ahc-tab-sidebar {
  background: linear-gradient(180deg, var(--pd) 0%, #001820 100%);
  width: 200px; flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 28px 0 24px; gap: 2px; position: relative;
}
.ahc-tab-sidebar::after {
  content: ''; position: absolute; inset: 0 0 0 auto; width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(0,122,138,0.3) 30%, rgba(0,122,138,0.3) 70%, transparent);
}
.ahc-sidebar-label {
  font-size: 9.5px; color: rgba(168,210,216,0.4);
  letter-spacing: 0.12em; padding: 0 20px 12px; font-weight: 700; text-transform: uppercase;
}
.ahc-tab-btn {
  background: none; border: none; color: rgba(168,210,216,0.65); cursor: pointer;
  padding: 10px 12px 10px 14px; text-align: right; font-size: 13px;
  font-family: 'Vazirmatn', sans-serif; border-radius: 10px; margin: 1px 10px;
  display: flex; align-items: center; gap: 9px;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1); white-space: nowrap; line-height: 1;
}
.ahc-tab-btn i { font-size: 16px; flex-shrink: 0; transition: color 0.2s; }
.ahc-tab-btn:hover { background: var(--glass); color: rgba(255,255,255,0.85); }
.ahc-tab-btn.ahc-active {
  background: linear-gradient(135deg, var(--ac), var(--ad));
  color: #fff; box-shadow: 0 4px 14px rgba(0,122,138,0.35);
}
.ahc-tab-btn.ahc-active i { color: var(--sup); }

/* ══════════════════════════════════════
   MOBILE CAROUSEL TABS
══════════════════════════════════════ */
.ahc-carousel-sidebar { display: none; }

/* ── Content ── */
.ahc-content-area {
  flex: 1; padding: 36px 36px 32px; overflow-y: auto;
  background: linear-gradient(160deg, #ffffff 0%, #f8fcfd 100%);
}
.ahc-pane { display: none; animation: ahcFadeIn 0.22s ease; }
.ahc-pane.ahc-visible { display: block; }
@keyframes ahcFadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ── Pane Header ── */
.ahc-pane-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.ahc-pane-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--pc), var(--ac));
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,59,73,0.25);
}
.ahc-pane-icon i { font-size: 22px; color: #fff; }
.ahc-pane-title-text h2 { font-size: 22px; font-weight: 700; color: var(--pd); line-height: 1.2; }
.ahc-pane-title-text p { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* ── Density ── */
.ahc-density-row {
  background: linear-gradient(135deg, #f0f7f9, #e8f4f6);
  border: 1px solid #c8dfe4; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ahc-density-row label {
  font-size: 12.5px; font-weight: 600; color: var(--pd);
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.ahc-density-row label i { color: var(--ac); font-size: 15px; }
.ahc-density-row select {
  flex: 1; min-width: 140px; border: 1.5px solid #b8d5db; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; font-family: 'Vazirmatn', sans-serif;
  color: var(--tc); background: #fff; cursor: pointer; direction: rtl;
}
.ahc-density-row select:focus { outline: none; border-color: var(--ac); }
.ahc-density-val {
  font-size: 12px; color: var(--ac); font-weight: 600; white-space: nowrap;
  background: rgba(0,122,138,0.08); padding: 4px 10px; border-radius: 6px;
}

/* ── Fields ── */
.ahc-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.ahc-field-wrap { display: flex; flex-direction: column; gap: 6px; }
.ahc-field-wrap.ahc-full { grid-column: 1 / -1; }
.ahc-field-wrap label {
  font-size: 16px!important; color: #4a5568; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.ahc-field-label-badge {
  display: inline-block; background: var(--sup-light); color: #7a5520;
  border-radius: 4px; font-size: 10px; padding: 1px 5px; font-weight: 700;
}
.ahc-field-wrap input {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 11px 13px;
  font-size: 14px; font-family: 'Vazirmatn', sans-serif; color: var(--tc);
  background: var(--field-bg); transition: all 0.18s; direction: ltr; text-align: right; width: 100%;
}
.ahc-field-wrap input:focus {
  outline: none; border-color: var(--ac); background: #fff;
  box-shadow: 0 0 0 3px rgba(0,122,138,0.1);
}
.ahc-field-wrap input::placeholder { color: #b0bec5; }

/* ── Price row ── */
.ahc-price-row {
  background: linear-gradient(135deg, #fdf8f0, #faf3e4);
  border: 1px solid rgba(205,167,103,0.3); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.ahc-price-row label {
  font-size: 12.5px; font-weight: 600; color: #6b4c14;
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.ahc-price-row label i { color: var(--sup); font-size: 15px; }
.ahc-price-row input {
  flex: 1; min-width: 120px; border: 1.5px solid rgba(205,167,103,0.4);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
  font-family: 'Vazirmatn', sans-serif; color: var(--tc); background: #fff;
  direction: ltr; text-align: right;
}
.ahc-price-row input:focus { outline: none; border-color: var(--sup); box-shadow: 0 0 0 3px rgba(205,167,103,0.15); }
.ahc-price-row input::placeholder { color: #c9a96a; }
.ahc-price-row .ahc-cur-badge {
  font-size: 11.5px; color: #8a6520; font-weight: 600; background: rgba(205,167,103,0.15);
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
}

/* ── Actions ── */
.ahc-actions-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.ahc-calc-btn {
  background: linear-gradient(135deg, var(--pc), var(--pl)); color: #fff;
  border: none; border-radius: 10px; padding: 12px 26px; font-size: 14px;
  font-family: 'Vazirmatn', sans-serif; cursor: pointer; font-weight: 700;
  transition: all 0.18s; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(0,59,73,0.25);
}
.ahc-calc-btn:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,59,73,0.3); }
.ahc-calc-btn:active { transform: scale(0.97); }
.ahc-calc-btn i { font-size: 18px; }
.ahc-reset-btn {
  background: none; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 16px; font-size: 13px; font-family: 'Vazirmatn', sans-serif;
  color: var(--muted); cursor: pointer; transition: all 0.18s;
  display: inline-flex; align-items: center; gap: 6px;
}
.ahc-reset-btn:hover { border-color: #aaa; color: #444; }
.ahc-reset-btn i { font-size: 15px; }

/* ══════════════════════════════════════
   RESULTS GRID
══════════════════════════════════════ */
.ahc-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.ahc-result-card {
  border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 5px;
  position: relative; overflow: hidden;
  transition: box-shadow 0.2s;
}
.ahc-result-card.ahc-rc-unit-card {
  background: linear-gradient(135deg, var(--pd) 0%, var(--pc) 60%, var(--pl) 100%);
  box-shadow: 0 4px 16px rgba(0,35,47,0.22);
}
.ahc-result-card.ahc-rc-total-card {
  background: linear-gradient(135deg, var(--ac) 0%, var(--ad) 100%);
  box-shadow: 0 4px 16px rgba(0,122,138,0.2);
}
.ahc-result-card.ahc-rc-price-card {
  background: linear-gradient(135deg, #7a5520 0%, #a07030 50%, #c4913d 100%);
  box-shadow: 0 4px 16px rgba(122,85,32,0.25);
}
.ahc-result-card::before {
  content: ''; position: absolute; top: -18px; left: -18px;
  width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,0.05);
}
.ahc-rc-label {
  font-size: 11px; color: rgba(255,255,255,0.6); font-weight: 500;
  display: flex; align-items: center; gap: 5px;
}
.ahc-rc-label i { font-size: 13px; }
.ahc-rc-value {
  font-size: 24px; font-weight: 800; color: #fff;
  line-height: 1.1; letter-spacing: -0.5px;
  transition: all 0.3s;
}
.ahc-rc-value.ahc-empty { font-size: 20px; color: rgba(255,255,255,0.25); font-weight: 400; }
.ahc-rc-unit-text { font-size: 12px; color: var(--sup); font-weight: 600; margin-top: 1px; }
.ahc-rc-price-card .ahc-rc-unit-text { color: rgba(255,230,170,0.85); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 700px) {
  .ahc-tab-sidebar { display: none; }
  .ahc-calculator { flex-direction: column; border-radius: 18px; overflow: visible; }

  .ahc-carousel-sidebar {
    display: block;
    background: linear-gradient(90deg, var(--pd), #001820);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    position: relative;
  }
  .ahc-carousel-track-wrap {
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding: 12px 14px; display: flex; gap: 7px;
  }
  .ahc-carousel-track-wrap::-webkit-scrollbar { display: none; }

  .ahc-tab-btn-m {
    flex-shrink: 0; scroll-snap-align: start;
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; color: rgba(168,210,216,0.75);
    padding: 9px 14px; font-size: 12.5px; font-family: 'Vazirmatn', sans-serif;
    cursor: pointer; display: flex; align-items: center; gap: 7px;
    white-space: nowrap; transition: all 0.18s;
  }
  .ahc-tab-btn-m i { font-size: 15px; }
  .ahc-tab-btn-m.ahc-active {
    background: linear-gradient(135deg, var(--ac), var(--ad));
    color: #fff; border-color: transparent;
    box-shadow: 0 3px 10px rgba(0,122,138,0.4);
  }
  .ahc-tab-btn-m.ahc-active i { color: var(--sup); }

  .ahc-carousel-sidebar::before,
  .ahc-carousel-sidebar::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 28px; pointer-events: none; z-index: 2;
  }
  .ahc-carousel-sidebar::before { right: 0; background: linear-gradient(to right, transparent, #001820cc); }
  .ahc-carousel-sidebar::after  { left: 0;  background: linear-gradient(to left,  transparent, #001820cc); }

  .ahc-content-area { padding: 20px 16px; }
  .ahc-fields-grid { grid-template-columns: 1fr; }
  .ahc-field-wrap.ahc-full { grid-column: 1; }
  .ahc-results-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
  .ahc-results-grid { grid-template-columns: 1fr 1fr; }
  .ahc-result-card.ahc-rc-price-card { grid-column: 1 / -1; }
}
