/* COD Profit Calculator Plugin - v1.0.0 */
/* Scoped under .cod-calc-wrap to prevent theme conflicts */

:root {
    --ink: #0f0f0f;
    --ink-soft: #3d3d3d;
    --ink-muted: #888;
    --surface: #ffffff;
    --surface-2: #f8f8f6;
    --surface-3: #f1f1ee;
    --border: #e5e5e2;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --green: #059669;
    --green-light: #d1fae5;
    --amber: #d97706;
    --amber-light: #fef3c7;
    --red: #dc2626;
    --red-light: #fee2e2;
    --purple: #7c3aed;
    --purple-light: #ede9fe;
    --radius: 14px;
    --radius-sm: 8px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  .cod-calc-wrap {
    font-family: 'DM Sans', sans-serif;
    background: var(--surface);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  h1, h2, h3, h4, h5 { font-family: 'Syne', sans-serif; }

  

  /* HERO */
  .hero {
    background: linear-gradient(135deg, #f0f7ff 0%, #fafafa 50%, #f0fdf4 100%);
    border-bottom: 1px solid var(--border);
    padding: 64px 24px 48px;
    text-align: center;
    position: relative; overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 800px 400px at 50% -100px, rgba(37,99,235,0.08), transparent);
    pointer-events: none;
  }
  .hero-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent-light); color: var(--accent);
    font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 20px;
    margin-bottom: 20px; letter-spacing: 0.5px;
  }
  .hero h1 {
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 800; line-height: 1.15;
    max-width: 760px; margin: 0 auto 16px;
    letter-spacing: -1px;
  }
  .hero h1 em { font-style: normal; color: var(--accent); }
  .hero-sub {
    font-size: clamp(15px, 2vw, 18px);
    color: var(--ink-soft); max-width: 580px; margin: 0 auto 32px;
    font-weight: 400;
  }
  .hero-stats {
    display: flex; justify-content: center; gap: 40px; flex-wrap: wrap;
  }
  .hero-stat { text-align: center; }
  .hero-stat-num { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; color: var(--ink); }
  .hero-stat-label { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

  /* MAIN LAYOUT */
  .main { max-width: 1200px; margin: 0 auto; padding: 32px 16px 80px; }

  /* MARKETPLACE TABS */
  .marketplace-tabs {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 28px;
  }
  .mp-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: 40px; font-size: 13px; font-weight: 600;
    border: 1.5px solid var(--border); background: var(--surface);
    cursor: pointer; transition: all 0.18s ease;
    font-family: 'DM Sans', sans-serif;
  }
  .mp-tab:hover { border-color: var(--accent); color: var(--accent); }
  .mp-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .mp-tab .mp-icon { font-size: 15px; }

  /* CALCULATOR GRID */
  .calc-grid {
    display: grid; grid-template-columns: 1fr 380px; gap: 24px;
    align-items: start;
  }
  @media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }

  /* CARD */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 22px; border-bottom: 1px solid var(--border);
    background: var(--surface-2);
  }
  .card-header-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
  }
  .card-header h3 { font-size: 15px; font-weight: 700; }
  .card-header p { font-size: 12px; color: var(--ink-muted); }
  .card-body { padding: 22px; }

  /* FORM ELEMENTS */
  .field { margin-bottom: 16px; }
  .field:last-child { margin-bottom: 0; }
  .field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  @media (max-width: 600px) { .field-row, .field-row-3 { grid-template-columns: 1fr; } }

  .input-wrap { position: relative; }
  .input-prefix {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 14px; font-weight: 600; color: var(--ink-muted);
    pointer-events: none; z-index: 1;
  }
  .input-suffix {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: 13px; color: var(--ink-muted); pointer-events: none;
  }

  input[type="number"], input[type="text"], select {
    width: 100%; height: 44px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    transition: all 0.15s ease;
    appearance: none;
    outline: none;
  }
  input[type="number"] { padding: 0 36px 0 32px; }
  input[type="number"]:focus, select:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  }
  input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
  select { padding: 0 12px; cursor: pointer; }

  /* RANGE SLIDER */
  .range-field label { display: flex; justify-content: space-between; align-items: center; }
  .range-val { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: var(--accent); }
  input[type="range"] {
    width: 100%; height: 6px;
    -webkit-appearance: none; appearance: none;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--val, 20%), var(--border) var(--val, 20%));
    border-radius: 3px; outline: none; cursor: pointer; margin-top: 8px;
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px;
    border-radius: 50%; background: var(--accent);
    border: 3px solid white; box-shadow: 0 2px 8px rgba(37,99,235,0.35);
    cursor: pointer;
  }

  /* CALCULATE BUTTON */
  .btn-calculate {
    width: 100%; height: 52px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: white; border: none; border-radius: var(--radius-sm);
    font-size: 16px; font-weight: 700; font-family: 'Syne', sans-serif;
    cursor: pointer; letter-spacing: 0.3px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(37,99,235,0.35);
    position: relative; overflow: hidden;
    margin-top: 8px;
  }
  .btn-calculate:hover { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(37,99,235,0.45); }
  .btn-calculate:active { transform: translateY(0); }

  /* RESULTS PANEL */
  .results-panel { position: sticky; top: 16px; }

  /* HEALTH SCORE */
  .health-score {
    padding: 22px; text-align: center;
    border-bottom: 1px solid var(--border);
  }
  .health-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 10px; }
  .health-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 24px; border-radius: 40px;
    font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800;
  }
  .health-badge.excellent { background: var(--green-light); color: var(--green); }
  .health-badge.healthy { background: #dcfce7; color: #16a34a; }
  .health-badge.risky { background: var(--amber-light); color: var(--amber); }
  .health-badge.loss { background: var(--red-light); color: var(--red); }
  .health-margin { font-size: 13px; color: var(--ink-muted); margin-top: 8px; }

  /* METRIC ROW */
  .metric { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .metric:last-child { border-bottom: none; }
  .metric-label { font-size: 13px; color: var(--ink-soft); }
  .metric-val { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; }
  .metric-val.positive { color: var(--green); }
  .metric-val.negative { color: var(--red); }
  .metric-val.neutral { color: var(--ink); }
  .metric-val.accent { color: var(--accent); }

  .metric-section-title {
    font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    color: var(--ink-muted); margin: 14px 0 4px;
  }

  /* HIGHLIGHT BOX */
  .highlight-box {
    border-radius: var(--radius-sm); padding: 14px 16px; margin: 12px 0;
  }
  .highlight-box.green { background: var(--green-light); }
  .highlight-box.red { background: var(--red-light); }
  .highlight-box.blue { background: var(--accent-light); }
  .highlight-box.amber { background: var(--amber-light); }
  .highlight-box .hb-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
  .highlight-box.green .hb-label { color: var(--green); }
  .highlight-box.red .hb-label { color: var(--red); }
  .highlight-box.blue .hb-label { color: var(--accent); }
  .highlight-box.amber .hb-label { color: var(--amber); }
  .highlight-box .hb-val { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; }
  .highlight-box .hb-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

  /* TABS (Scenario/Bulk) */
  .tab-pills { display: flex; gap: 4px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 20px; }
  .tab-pill { flex: 1; text-align: center; padding: 8px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: 'DM Sans', sans-serif; }
  .tab-pill.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
  .tab-content { display: none; }
  .tab-content.active { display: block; }

  /* INSIGHTS */
  .insight-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px; border-radius: var(--radius-sm);
    background: var(--surface-2); margin-bottom: 8px;
    border-left: 3px solid var(--accent);
  }
  .insight-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
  .insight-text { font-size: 13px; color: var(--ink-soft); line-height: 1.5; }
  .insight-text strong { color: var(--ink); }

  /* CHARTS */
  .charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
  @media (max-width: 700px) { .charts-grid { grid-template-columns: 1fr; } }
  .chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
  .chart-title { font-size: 14px; font-weight: 700; margin-bottom: 16px; }
  .chart-wrap { position: relative; height: 200px; }

  /* PROJECTION TABLE */
  .proj-table { width: 100%; border-collapse: collapse; font-size: 14px; }
  .proj-table th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-muted); background: var(--surface-2); }
  .proj-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .proj-table tr:last-child td { border-bottom: none; }
  .proj-table td:not(:first-child) { font-family: 'Syne', sans-serif; font-weight: 600; text-align: right; }

  /* REVERSE CALCULATOR */
  .reverse-calc {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 24px; margin: 24px 0;
  }
  .reverse-calc h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
  .reverse-result { margin-top: 16px; padding: 16px; background: white; border-radius: var(--radius-sm); border: 1px solid var(--border); text-align: center; }
  .reverse-result .rr-label { font-size: 12px; color: var(--ink-muted); margin-bottom: 4px; }
  .reverse-result .rr-val { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; color: var(--accent); }

  /* SCENARIO COMPARISON */
  .scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 600px) { .scenario-grid { grid-template-columns: 1fr; } }
  .scenario-box { background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
  .scenario-box.active-scenario { border-color: var(--accent); background: var(--accent-light); }
  .scenario-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-muted); margin-bottom: 10px; }
  .scenario-diff {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); margin-top: 12px; font-size: 14px; color: var(--ink-soft);
  }
  .diff-arrow { font-size: 20px; }

  /* DOWNLOAD BUTTONS */
  .download-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
  .btn-download {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
    border: 1.5px solid var(--border); background: var(--surface); cursor: pointer;
    transition: all 0.15s ease; font-family: 'DM Sans', sans-serif;
    text-decoration: none; color: var(--ink);
  }
  .btn-download:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

  /* BREAKEVEN BANNER */
  .breakeven-banner {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    color: white; border-radius: var(--radius); padding: 20px 24px;
    margin: 16px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  }
  .breakeven-banner .bb-label { font-size: 12px; opacity: 0.8; margin-bottom: 4px; }
  .breakeven-banner .bb-val { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; }
  .breakeven-banner .bb-note { font-size: 12px; opacity: 0.75; margin-top: 4px; }

  /* SEO CONTENT */
  .seo-section { max-width: 860px; margin: 64px auto 0; padding: 0 16px; }
  .seo-section h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; margin-bottom: 16px; letter-spacing: -0.5px; }
  .seo-section h3 { font-size: 20px; font-weight: 700; margin: 32px 0 12px; }
  .seo-section p { font-size: 16px; color: var(--ink-soft); line-height: 1.75; margin-bottom: 16px; }
  .seo-section ul, .seo-section ol { margin: 0 0 16px 20px; }
  .seo-section li { font-size: 15px; color: var(--ink-soft); line-height: 1.75; margin-bottom: 6px; }
  .seo-section strong { color: var(--ink); }
  .divider { border: none; border-top: 1px solid var(--border); margin: 48px 0; }

  /* COMPARISON TABLE */
  .compare-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
  .compare-table th { padding: 12px 16px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; color: var(--ink-muted); background: var(--surface-2); }
  .compare-table th:not(:first-child) { text-align: center; }
  .compare-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .compare-table td:not(:first-child) { text-align: center; }
  .compare-table .yes { color: var(--green); font-size: 17px; }
  .compare-table .no { color: var(--red); font-size: 17px; }
  .compare-table .col-this { background: #f0f7ff; }

  /* FAQ */
  .faq-item { border-bottom: 1px solid var(--border); }
  .faq-q { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; cursor: pointer; }
  .faq-q h4 { font-size: 15px; font-weight: 600; padding-right: 16px; }
  .faq-toggle { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; transition: transform 0.2s; }
  .faq-item.open .faq-toggle { transform: rotate(45deg); }
  .faq-a { display: none; padding: 0 0 18px; font-size: 15px; color: var(--ink-soft); line-height: 1.7; }
  .faq-item.open .faq-a { display: block; }

  /* TRUST BADGES */
  .trust-row { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin: 40px 0; }
  .trust-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); font-weight: 500; }
  .trust-icon { font-size: 18px; }

  

  /* SECTION DIVIDER */
  .section-tag {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
    margin-bottom: 14px; color: var(--ink-soft); letter-spacing: 0.5px;
  }

  .section-divider-full {
    border: none; border-top: 2px solid var(--border);
    margin: 48px 0;
  }

  /* RESULTS PLACEHOLDER */
  .results-empty {
    text-align: center; padding: 40px 20px; color: var(--ink-muted);
  }
  .results-empty .re-icon { font-size: 48px; margin-bottom: 12px; }
  .results-empty p { font-size: 14px; line-height: 1.6; }

  /* INPUT ALL NUMBERS */
  input.has-prefix { padding-left: 32px !important; }
  input.has-suffix { padding-right: 36px !important; }

  .cards-section { margin-top: 24px; }
  .section-title { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; margin-bottom: 16px; }

  /* ANIMATE IN */
  @keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .animate-in { animation: slideUp 0.35s ease forwards; }

  

  /* PRINT */
   }