/* ============================================================
   IT Waste Carbon Calculator — Shortcode Stylesheet
   All classes are prefixed with "csc-" (Carbon Shortcode)
   to avoid collisions with theme styles.

   EDIT GUIDE:
   - Colors & fonts  → #calc-sc variables at the top
   - Form layout     → .csc-card, .csc-device-grid sections
   - Results panel   → .csc-results, .csc-total-card sections
============================================================ */

/* ============================================================
   CSS VARIABLES — scoped to our root element only
============================================================ */
#calc-sc {
  --csc-primary-light: #7CD0D7;
  --csc-primary-dark:  #3d7da5;
  --csc-primary-mid:   #4fb8c0;
  --csc-text-heading:  #0e0e0e;
  --csc-text-body:     #374151;
  --csc-text-muted:    #6b7280;
  --csc-text-label:    #9ca3af;
  --csc-border-light:  #e5e7eb;
  --csc-border-card:   #f3f4f6;
  --csc-shadow-card:   0 8px 24px rgba(0,0,0,0.07), 0 2px 8px rgba(0,0,0,0.04);
  --csc-radius-card:   14px;
  --csc-radius-btn:    10px;
  --csc-font-sans:     "Inter", Sans-serif;
  --csc-font-heading:  "Plus Jakarta Sans", Sans-serif;

  font-family: var(--csc-font-sans);
  color: var(--csc-text-body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hard reset scoped inside our element only */
#calc-sc *, #calc-sc *::before, #calc-sc *::after {
  box-sizing: border-box;
}

/* ============================================================
   CARD
============================================================ */
.csc-card {
  background: #fff;
  border-radius: var(--csc-radius-card);
  box-shadow: var(--csc-shadow-card);
  border: 1px solid var(--csc-border-card);
  overflow: hidden;
}
.csc-card-header {
  background: #fafafa;
  border-bottom: 1px solid var(--csc-border-card);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.csc-card-header svg { color: var(--csc-primary-mid); flex-shrink: 0; }
.csc-card-title {
  font-family: var(--csc-font-heading);
  /*font-size: 1.1rem;*/
  font-weight: 600;
  color: var(--csc-text-heading);
  line-height: 1.2;
}
.csc-card-sub {
  /*font-size: 0.82rem;*/
  color: var(--csc-text-muted);
  margin-top: 2px;
}
.csc-card-body { padding: 24px; }

/* ============================================================
   DEVICE GRID
============================================================ */
.csc-device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  min-width: 0;
}

@media (max-width: 520px) {
  .csc-device-grid { 
    grid-template-columns: 1fr;
  }

  .csc-device-icon {
    width: 20px;
    height: 20px;
  }

}

.csc-device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid rgba(229,231,235,0.6);
  transition: background 0.15s;
  min-width: 0;
}
.csc-device-row:hover { background: #f3f4f6; }

@media (max-width: 960px) {
  .csc-device-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
  }
}

/* stack icon above info on smaller phones */
@media (max-width: 760px) {
  .csc-device-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .csc-device-icon {
    margin-bottom: 0px;
  }
}

.csc-device-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--csc-border-card);
  border-radius: 9px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--csc-primary-mid);
}

.csc-device-info {
  flex: 1;
  min-width: 0;
}

/* constrain label width to prevent it from pushing the stepper off-center */
.csc-device-label {
  display: block;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--csc-text-label);
  margin-bottom: 0px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;  
}

@media (max-width: 760px) {
  .csc-device-info {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .csc-device-label {
    max-width: 90%;
    white-space: normal;
    word-break: break-word;
  }
}

@media (max-width: 960px) {
  .csc-device-label { font-size: 1.2rem; margin-bottom: 0; }
}

/* ============================================================
   STEPPER  (–  0  +)
============================================================ */
.csc-stepper {
  display: flex;
  align-items: center;
  gap: 7px;
}
.csc-stepper-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: 1px solid var(--csc-border-light);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.12s, transform 0.1s;
  color: var(--csc-text-body);
  padding: 0;
}
.csc-stepper-btn:hover:not(:disabled) { box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.csc-stepper-btn:active:not(:disabled) { transform: scale(0.95); }
.csc-stepper-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.csc-stepper-input {
  width: 55px;
  height: 30px;
  text-align: center;
  border: 1px solid var(--csc-border-light);
  border-radius: 7px;
  /*font-size: 1rem;*/
  font-weight: 700;
  font-family: var(--csc-font-sans);
  color: var(--csc-text-heading);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.csc-stepper-input:focus {
  border-color: var(--csc-primary-mid);
  box-shadow: 0 0 0 3px rgba(79,184,192,0.15);
}
.csc-stepper-input::-webkit-inner-spin-button,
.csc-stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.csc-stepper-input[type=number] { -moz-appearance: textfield; }

/* ============================================================
   DIVIDER + ACTIONS
============================================================ */
.csc-divider {
  height: 1px;
  background: var(--csc-border-card);
  margin: 0 0 18px;
}
.csc-actions { display: flex; gap: 10px; }

.csc-btn-calculate {
  flex: 1;
  padding: 13px 24px;
  /*font-size: 1rem;*/
  font-weight: 600;
  font-family: var(--csc-font-heading);
  color: #fff;
  background: linear-gradient(90deg, var(--csc-primary-light) 0%, var(--csc-primary-dark) 100%);
  border: none;
  border-radius: var(--csc-radius-btn);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(60,126,165,0.28);
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}
.csc-btn-calculate:hover { opacity: 0.92; box-shadow: 0 8px 24px rgba(60,126,165,0.35); }
.csc-btn-calculate:active { transform: scale(0.98); }

.csc-btn-reset {
  padding: 13px 16px;
  /*font-size: 0.9rem;*/
  font-weight: 500;
  color: var(--csc-text-muted);
  background: #fff;
  border: 1px solid var(--csc-border-light);
  border-radius: var(--csc-radius-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, box-shadow 0.12s;
}
.csc-btn-reset:hover { background: #f9fafb; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }

/* ============================================================
   RESULTS VIEW
============================================================ */
.csc-results { display: none; flex-direction: column; gap: 18px; }
.csc-results.visible { display: flex; animation: cscFadeUp 0.35s ease both; }

/* Breakdown list */
.csc-breakdown-card {
  background: #fff;
  border: 1px solid var(--csc-border-light);
  border-radius: var(--csc-radius-card);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.csc-breakdown-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--csc-border-card);
  /*font-size: 0.9rem;*/
  font-weight: 600;
  color: var(--csc-text-body);
  display: flex;
  align-items: center;
  gap: 8px;
}
.csc-breakdown-header svg { color: var(--csc-primary-mid); }
.csc-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 20px;
  border-bottom: 1px solid var(--csc-border-card);
}
.csc-breakdown-row:last-child { border-bottom: none; }
.csc-breakdown-left  { display: flex; align-items: center; gap: 10px; /*font-size: 0.88rem;*/ color: var(--csc-text-body); }
.csc-breakdown-left svg { color: var(--csc-text-label); flex-shrink: 0; }
.csc-breakdown-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.csc-breakdown-qty   { /*font-size: 0.85rem;*/ font-weight: 700; font-family: monospace; color: var(--csc-text-heading); }
.csc-breakdown-lbs   { /*font-size: 0.76rem;*/ color: var(--csc-text-label); }

/* Total card */
.csc-total-card {
  border-radius: var(--csc-radius-card);
  background: linear-gradient(135deg, var(--csc-primary-light) 0%, var(--csc-primary-dark) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 44px 28px;
  box-shadow: 0 16px 48px rgba(60,126,165,0.3);
}
.csc-total-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
}
.csc-total-card::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 160px; height: 160px;
  background: rgba(0,0,0,0.08);
  border-radius: 50%;
  filter: blur(30px);
  pointer-events: none;
}
.csc-total-label {
  /*font-size: 0.72rem;*/
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 10px;
}
.csc-total-number {
  font-family: var(--csc-font-heading);
  font-size: clamp(3rem, 9vw, 5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}
.csc-total-unit {
  /*font-size: clamp(1.1rem, 2.5vw, 1.8rem);*/
  font-weight: 500;
  opacity: 0.75;
  margin-left: 6px;
}
.csc-total-desc {
  /*font-size: 0.97rem;*/
  opacity: 0.9;
  max-width: 420px;
  margin: 14px auto 24px;
  line-height: 1.6;
}
.csc-btn-another {
  display: inline-block;
  padding: 12px 28px;
  background: #fff;
  color: var(--csc-primary-dark);
  font-weight: 700;
  /*font-size: 0.92rem;*/
  font-family: var(--csc-font-heading);
  border: none;
  border-radius: var(--csc-radius-btn);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.14);
  transition: opacity 0.15s, box-shadow 0.15s;
  position: relative;
  z-index: 1;
}
.csc-btn-another:hover { opacity: 0.93; box-shadow: 0 6px 18px rgba(0,0,0,0.2); }

/* Equivalents grid */
.csc-equiv-label {
  text-align: center;
  /*font-size: 0.68rem;*/
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--csc-text-label);
  margin: 2px 0 8px;
}
.csc-equiv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 560px) {
  .csc-equiv-grid { grid-template-columns: 1fr 1fr; }
}
.csc-equiv-card {
  border-radius: 11px;
  border: 1px solid;
  padding: 16px 12px;
  text-align: center;
  animation: cscFadeUp 0.4s ease both;
}
.csc-equiv-card.amber   { background: #fffbeb; border-color: #fde68a; }
.csc-equiv-card.slate   { background: #f8fafc; border-color: #e2e8f0; }
.csc-equiv-card.cyan    { background: #ecfeff; border-color: #a5f3fc; }
.csc-equiv-card.emerald { background: #ecfdf5; border-color: #6ee7b7; }

.csc-equiv-icon  { font-size: 5.5rem; margin-bottom: 6px; display: block; }
.csc-equiv-value {
  font-family: var(--csc-font-heading);
  font-size: 4.3rem;
  font-weight: 700;
  line-height: 1.2;
  display: block;
}
.csc-equiv-card.amber   .csc-equiv-value { color: #b45309; }
.csc-equiv-card.slate   .csc-equiv-value { color: #334155; }
.csc-equiv-card.cyan    .csc-equiv-value { color: #0e7490; }
.csc-equiv-card.emerald .csc-equiv-value { color: #065f46; }
.csc-equiv-unit {
  /*font-size: 0.66rem;*/
  font-weight: 600;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.csc-equiv-desc {
  /*font-size: 0.68rem;*/
  margin-top: 3px;
  opacity: 0.6;
  line-height: 1.3;
}

.csc-disclaimer {
  text-align: center;
  /*font-size: 0.73rem;*/
  color: var(--csc-text-label);
  font-style: italic;
}

/* ============================================================
   ANIMATION
============================================================ */
@keyframes cscFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
