﻿/* 3alamtaney Resin Calculator (T4.4) — Explicit px ONLY (zero rem), Tajawal, Mobile 360px & Bricks Dark/Light Safe */
#atResinApp, #atResinApp *, #atResinApp *::before, #atResinApp *::after {
  box-sizing: border-box;
  min-width: 0;
}
#brx-content #atResinApp, #atResinApp {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-hover: #0d5e58;
  --primary-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: rgba(217,119,6,0.12);
  --danger: #dc2626;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  font-family: 'Tajawal', sans-serif !important;
  font-size: 16px !important;
  line-height: 1.65;
  direction: rtl;
  text-align: right;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: clip !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  border-radius: 20px;
  padding: 20px 16px 44px;
}
#brx-content #atResinApp.at-dark, #atResinApp.at-dark,
html[data-at-theme="dark"] #atResinApp:not(.at-light) {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #263348;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #14b8a6;
  --primary-hover: #0d9488;
  --primary-soft: rgba(20,184,166,0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245,158,11,0.14);
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}
html[data-at-theme="light"] #atResinApp:not(.at-dark) {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-hover: #0d5e58;
  --primary-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: rgba(217,119,6,0.12);
}
#atResinApp button, #atResinApp input, #atResinApp select {
  font-family: 'Tajawal', sans-serif !important;
  font-size: 16px !important;
  letter-spacing: 0;
  text-transform: none;
}
.at-rs-wrap { max-width: 1160px; margin: 0 auto; }

/* HERO */
.at-rs-hero {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 240px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #06231e;
  background-image:
    linear-gradient(270deg, rgba(6, 35, 30, 0.92) 0%, rgba(6, 35, 30, 0.68) 52%, rgba(6, 35, 30, 0.14) 100%),
    url('/wp-content/uploads/at-tools/resin-hero.webp?v=1');
  background-size: cover;
  background-position: left center;
  color: #ffffff !important;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.at-rs-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.at-rs-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700; color: #fef3c7 !important;
}
.at-rs-theme-btn {
  background: rgba(15, 23, 42, 0.58) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 12px; padding: 8px 14px; min-height: 42px;
  font-size: 14px !important; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.at-rs-hero-body { max-width: 600px; margin-top: 16px; }
#brx-content #atResinApp .at-rs-hero h1, #atResinApp .at-rs-hero h1 {
  margin: 0 0 8px !important; font-size: 30px !important; font-weight: 800 !important;
  line-height: 1.28 !important; color: #ffffff !important;
}
#brx-content #atResinApp .at-rs-hero p, #atResinApp .at-rs-hero p {
  margin: 0 !important; font-size: 16px !important; color: rgba(241, 245, 249, 0.94) !important; line-height: 1.65;
}

/* GRID */
.at-rs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(320px, 0.92fr);
  gap: 22px;
  align-items: start;
}
#brx-content #atResinApp .at-rs-card, #atResinApp .at-rs-card {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.at-rs-col { display: flex; flex-direction: column; gap: 16px; }

/* SECTION HEADERS */
.at-rs-sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.at-rs-sec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px !important; font-weight: 700 !important; color: var(--text) !important; margin: 0;
}
.at-rs-sec-title svg { color: var(--primary); flex-shrink: 0; }

/* FORM ELEMENTS */
#brx-content #atResinApp label.at-rs-label, #atResinApp label.at-rs-label {
  display: block; font-size: 14px !important; font-weight: 600 !important;
  color: var(--muted) !important; margin-bottom: 5px;
}
#brx-content #atResinApp input[type=number],
#brx-content #atResinApp input[type=text],
#brx-content #atResinApp select,
#atResinApp input[type=number],
#atResinApp input[type=text],
#atResinApp select {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--surface-2) !important; color: var(--text) !important;
  border: 1.5px solid var(--border) !important; border-radius: 12px;
  font-size: 16px !important; font-weight: 600 !important;
  transition: border-color 0.15s;
  font-variant-numeric: tabular-nums;
}
#brx-content #atResinApp input:focus,
#brx-content #atResinApp select:focus,
#atResinApp input:focus,
#atResinApp select:focus {
  outline: none; border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.at-rs-field { margin-bottom: 12px; }
.at-rs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.at-rs-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* SEGMENTED TABS */
.at-rs-seg {
  display: flex; gap: 0; background: var(--surface-2);
  border-radius: 12px; padding: 3px; border: 1px solid var(--border);
  overflow-x: auto;
}
.at-rs-seg-btn {
  flex: 1; padding: 10px 8px; border: none; background: transparent;
  border-radius: 10px; cursor: pointer; font-size: 14px !important;
  font-weight: 600 !important; color: var(--muted) !important;
  min-height: 44px; white-space: nowrap; transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.at-rs-seg-btn.active {
  background: var(--primary) !important; color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
}
.at-rs-seg-btn:hover:not(.active) { background: var(--border); }

/* SHAPE BUTTONS */
.at-rs-shapes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.at-rs-shape-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border: 2px solid var(--border); border-radius: 14px;
  background: var(--surface-2) !important; cursor: pointer;
  font-size: 13px !important; font-weight: 600 !important; color: var(--text) !important;
  transition: all 0.15s; min-height: 80px;
}
.at-rs-shape-btn.active {
  border-color: var(--primary) !important; background: var(--primary-soft) !important;
  color: var(--primary) !important;
}
.at-rs-shape-btn:hover:not(.active) { border-color: var(--muted); }
.at-rs-shape-btn svg { width: 24px; height: 24px; }

/* PRESET BUTTONS */
.at-rs-presets {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.at-rs-preset {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2) !important; cursor: pointer;
  font-size: 13px !important; font-weight: 600 !important; color: var(--text) !important;
  transition: all 0.15s; white-space: nowrap;
}
.at-rs-preset:hover { border-color: var(--primary); color: var(--primary) !important; }

/* RATIO BUTTONS */
.at-rs-ratios {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.at-rs-ratio-btn {
  padding: 9px 16px; border: 2px solid var(--border); border-radius: 12px;
  background: var(--surface) !important; cursor: pointer;
  font-size: 15px !important; font-weight: 700 !important; color: var(--text) !important;
  transition: all 0.15s; min-height: 44px;
}
.at-rs-ratio-btn.active {
  border-color: var(--primary) !important; background: var(--primary-soft) !important;
  color: var(--primary) !important;
}
.at-rs-ratio-btn:hover:not(.active) { border-color: var(--muted); }

/* WASTE BUTTONS */
.at-rs-waste-group {
  display: flex; gap: 0; background: var(--surface-2);
  border-radius: 10px; padding: 2px; border: 1px solid var(--border);
}
.at-rs-waste-btn {
  flex: 1; padding: 8px 6px; border: none; background: transparent;
  border-radius: 8px; cursor: pointer; font-size: 13px !important;
  font-weight: 600 !important; color: var(--muted) !important;
  min-height: 38px; transition: all 0.15s;
}
.at-rs-waste-btn.active {
  background: var(--amber) !important; color: #ffffff !important;
}

/* WARNING BOX */
.at-rs-warn {
  display: none; padding: 12px 14px; background: var(--amber-soft);
  border: 1px solid var(--amber); border-radius: 12px;
  font-size: 14px !important; font-weight: 600 !important;
  color: var(--amber) !important; margin-top: 10px;
  line-height: 1.5;
}
.at-rs-warn.show { display: flex; align-items: flex-start; gap: 8px; }
.at-rs-warn svg { flex-shrink: 0; margin-top: 2px; }

/* RESULTS SIDEBAR */
.at-rs-sidebar { position: sticky; top: 20px; }
.at-rs-result-main {
  background: var(--primary-soft); border: 1px solid var(--primary);
  border-radius: 16px; padding: 16px; margin-bottom: 14px; text-align: center;
}
.at-rs-result-val {
  font-size: 28px !important; font-weight: 800 !important;
  color: var(--primary) !important; font-variant-numeric: tabular-nums;
}
.at-rs-result-label {
  font-size: 13px !important; color: var(--muted) !important; font-weight: 600 !important;
}
.at-rs-split-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.at-rs-split-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; text-align: center;
}
.at-rs-split-box h4 {
  margin: 0 0 6px; font-size: 14px !important; font-weight: 700 !important;
  color: var(--text) !important;
}
.at-rs-split-val {
  font-size: 20px !important; font-weight: 800 !important;
  font-variant-numeric: tabular-nums; color: var(--text) !important;
}
.at-rs-split-sub {
  font-size: 13px !important; color: var(--muted) !important; font-variant-numeric: tabular-nums;
}

/* VISUAL BAR */
.at-rs-bar-wrap { margin-bottom: 14px; }
.at-rs-bar {
  height: 14px; border-radius: 7px; overflow: hidden;
  display: flex; background: var(--surface-2); border: 1px solid var(--border);
}
.at-rs-bar-a { background: var(--primary); transition: width 0.3s; height: 100%; }
.at-rs-bar-b { background: var(--amber); transition: width 0.3s; height: 100%; }
.at-rs-bar-labels {
  display: flex; justify-content: space-between; margin-top: 4px;
  font-size: 12px !important; font-weight: 600 !important; color: var(--muted) !important;
}

/* COST BOX */
#atRsCostBox { display: none; }
#atRsCostBox.show { display: block; }
.at-rs-cost-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 14px !important;
}
.at-rs-cost-row:last-child { border-bottom: none; }
.at-rs-cost-label { color: var(--muted) !important; font-weight: 600 !important; }
.at-rs-cost-val { font-weight: 700 !important; color: var(--text) !important; font-variant-numeric: tabular-nums; }
.at-rs-sell-price {
  background: var(--primary-soft); border-radius: 12px; padding: 12px;
  text-align: center; margin-top: 10px;
}
.at-rs-sell-price .at-rs-result-val { font-size: 24px !important; }
.at-rs-profit {
  text-align: center; padding: 8px; font-size: 15px !important;
  font-weight: 700 !important; color: var(--primary) !important;
}
.at-rs-cost-hint {
  text-align: center; font-size: 13px !important; color: var(--muted) !important;
  padding: 8px; font-style: italic;
}

/* ACTION BUTTONS */
.at-rs-actions { display: flex; gap: 8px; margin-top: 14px; }
.at-rs-btn-primary {
  flex: 1; min-height: 48px; padding: 12px 16px;
  background: var(--primary) !important; color: #ffffff !important;
  border: none; border-radius: 12px; cursor: pointer;
  font-size: 15px !important; font-weight: 700 !important;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.15s;
}
.at-rs-btn-primary:hover { background: var(--primary-hover) !important; }
.at-rs-btn-outline {
  min-height: 48px; padding: 12px 16px;
  background: var(--surface-2) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: 12px; cursor: pointer;
  font-size: 15px !important; font-weight: 700 !important;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s;
}
.at-rs-btn-outline:hover { border-color: var(--primary) !important; color: var(--primary) !important; }

/* TOAST */
.at-rs-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 24px;
  border-radius: 12px; font-size: 14px !important; font-weight: 600 !important;
  z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.at-rs-toast.show { opacity: 1; }

/* SEO GUIDE & FAQ */
.at-rs-seo-section {
  margin-top: 32px; padding: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow);
}
.at-rs-seo-section h2 {
  font-size: 22px !important; font-weight: 800 !important;
  color: var(--text) !important; margin: 0 0 12px;
}
.at-rs-seo-section p {
  font-size: 15px !important; color: var(--muted) !important; line-height: 1.7; margin: 0 0 10px;
}
.at-rs-faq details {
  border: 1px solid var(--border); border-radius: 12px;
  margin-bottom: 8px; overflow: hidden;
}
.at-rs-faq summary {
  padding: 14px 16px; cursor: pointer; font-size: 15px !important;
  font-weight: 700 !important; color: var(--text) !important;
  background: var(--surface-2); list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.at-rs-faq summary::-webkit-details-marker { display: none; }
.at-rs-faq details[open] summary { border-bottom: 1px solid var(--border); }
.at-rs-faq .at-rs-faq-body {
  padding: 14px 16px; font-size: 14px !important;
  color: var(--muted) !important; line-height: 1.7;
}

/* CROSS LINKS */
.at-rs-cross {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; margin-top: 20px;
}
.at-rs-cross-card {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 14px;
  text-decoration: none !important; color: var(--text) !important;
  font-size: 14px !important; font-weight: 600 !important;
  transition: all 0.15s;
}
.at-rs-cross-card:hover {
  border-color: var(--primary) !important; background: var(--primary-soft) !important;
}
.at-rs-cross-card svg { flex-shrink: 0; color: var(--primary); }

/* HIDDEN HELPER */
.at-rs-hidden { display: none !important; }

/* RESPONSIVE */
@media (max-width: 860px) {
  .at-rs-grid { grid-template-columns: 1fr; }
  .at-rs-sidebar { position: static; }
  #brx-content #atResinApp .at-rs-hero h1, #atResinApp .at-rs-hero h1 {
    font-size: 24px !important;
  }
  .at-rs-shapes { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .at-rs-hero { padding: 20px 16px; min-height: 200px; }
  #brx-content #atResinApp .at-rs-hero h1, #atResinApp .at-rs-hero h1 {
    font-size: 21px !important;
  }
  .at-rs-card { padding: 14px !important; }
  .at-rs-row { grid-template-columns: 1fr; }
  .at-rs-row-3 { grid-template-columns: 1fr; }
  .at-rs-split-boxes { grid-template-columns: 1fr; }
  .at-rs-shapes { grid-template-columns: 1fr; }
  .at-rs-seg-btn { font-size: 12px !important; padding: 8px 4px; }
}
