/* ═══════════════════════════════════════════════
   CT Calculators Plugin — style.css
   Chhapra Today Brand: Red #c0392b / White / Black
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=Poppins:wght@400;500;600;700;800&display=swap');

/* ── Reset & Variables ── */
.ctc-widget *,
.ctc-page-wrap * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ctc-red:       #c0392b;
  --ctc-red-dark:  #922b21;
  --ctc-red-light: #e74c3c;
  --ctc-black:     #1a1a1a;
  --ctc-gray:      #6b7280;
  --ctc-gray-lt:   #f9fafb;
  --ctc-border:    #e5e7eb;
  --ctc-white:     #ffffff;
  --ctc-shadow:    0 2px 16px rgba(0,0,0,0.08);
  --ctc-radius:    16px;
  --ctc-font:      'Poppins', 'Noto Sans Devanagari', sans-serif;
}

/* ════════════════════════════════════════════
   WIDGET — Card Grid (shortcode output)
════════════════════════════════════════════ */
.ctc-widget {
  font-family: var(--ctc-font);
  background: #fff8f0;
  border-radius: var(--ctc-radius);
  padding: 20px;
  max-width: 480px;
  box-shadow: var(--ctc-shadow);
  border: 1px solid #f0e0d0;
}

.ctc-widget-header {
  margin-bottom: 16px;
}

.ctc-widget-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ctc-black);
  letter-spacing: -0.3px;
}

/* Grid */
.ctc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Individual card */
.ctc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  background: var(--card-bg, #f5f5f5);
  border-radius: 14px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.ctc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 2px solid transparent;
  transition: border-color 0.18s;
}

.ctc-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  text-decoration: none;
}

.ctc-card:hover::before {
  border-color: var(--card-color, #ccc);
}

/* Hidden cards (shown after "More" click) */
.ctc-card.ctc-hidden {
  display: none;
}

/* Icon circle */
.ctc-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  flex-shrink: 0;
}

.ctc-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ctc-black);
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.1px;
}

/* "More" button special dots icon */
.ctc-more-btn {
  cursor: pointer;
  font-family: var(--ctc-font);
}

.ctc-dots-icon {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  padding: 8px;
}

.ctc-dots-icon span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ctc-red);
  display: block;
}

/* Expand animation */
.ctc-card.ctc-reveal {
  animation: ctcReveal 0.25s ease forwards;
}

@keyframes ctcReveal {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}


/* ════════════════════════════════════════════
   CALCULATOR PAGE
════════════════════════════════════════════ */
.ctc-page-wrap {
  font-family: var(--ctc-font);
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

/* Breadcrumb */
.ctc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ctc-gray);
  margin-bottom: 20px;
}
.ctc-breadcrumb a {
  color: var(--ctc-red);
  text-decoration: none;
  font-weight: 600;
}
.ctc-breadcrumb a:hover { text-decoration: underline; }

/* Hero */
.ctc-page-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, var(--page-color, #c0392b) 0%, color-mix(in srgb, var(--page-color, #c0392b) 70%, #fff) 100%);
  color: #fff;
  border-radius: var(--ctc-radius);
  padding: 24px 28px;
  margin-bottom: 24px;
}

.ctc-page-hero-icon {
  font-size: 3rem;
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ctc-page-title {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
  color: #fff;
}

.ctc-page-subtitle {
  font-size: 0.88rem;
  opacity: 0.9;
  line-height: 1.5;
  color: #fff;
}

/* Layout: sidebar */
.ctc-page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 860px) {
  .ctc-page-layout { grid-template-columns: 1fr; }
}

/* ── Calculator Card ── */
.ctc-calc-card {
  background: var(--ctc-white);
  border-radius: var(--ctc-radius);
  box-shadow: var(--ctc-shadow);
  overflow: hidden;
  border: 1px solid var(--ctc-border);
}

.ctc-calc-card-head {
  background: linear-gradient(135deg,
    var(--page-color, #c0392b),
    color-mix(in srgb, var(--page-color, #c0392b) 60%, #fff));
  color: #fff;
  padding: 18px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ctc-calc-body {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: end;
}

/* Fields that should span full width */
.ctc-calc-body .ctc-field:only-child,
.ctc-calc-body select {
  width: 100%;
}

/* Force button to span full width */
.ctc-calc-btn {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--page-color, #c0392b), var(--ctc-red-light));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--ctc-font);
  cursor: pointer;
  width: 100%;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.ctc-calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Form fields */
.ctc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Single-field forms — full width */
.ctc-calc-body > .ctc-field:nth-child(1):nth-last-child(2),
.ctc-calc-body > .ctc-field:nth-child(1):nth-last-child(2) ~ .ctc-calc-btn {
  grid-column: 1 / -1;
}

.ctc-field label {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--ctc-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ctc-field input,
.ctc-field select {
  border: 2px solid var(--ctc-border);
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: var(--ctc-font);
  outline: none;
  transition: border-color 0.2s;
  background: #fafafa;
  width: 100%;
  color: var(--ctc-black);
}

.ctc-field input:focus,
.ctc-field select:focus {
  border-color: var(--page-color, var(--ctc-red));
  background: #fff;
}

/* ── Result Panel ── */
.ctc-result {
  margin: 0 24px 24px;
  background: var(--page-bg, #fff5f5);
  border: 2px solid var(--page-color, var(--ctc-red));
  border-radius: 12px;
  overflow: hidden;
  animation: ctcFadeUp 0.3s ease;
}

@keyframes ctcFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ctc-result-head {
  background: var(--page-color, var(--ctc-red));
  color: #fff;
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.ctc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--ctc-border);
  border-top: 1px solid var(--ctc-border);
}

.ctc-result-item {
  background: var(--ctc-white);
  padding: 16px 18px;
}

.ctc-result-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ctc-gray);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.ctc-result-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--page-color, var(--ctc-red));
  word-break: break-word;
}

/* Donut chart */
.ctc-donut-wrap {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: #fff;
}

.ctc-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ctc-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.ctc-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* BMI Scale */
.ctc-bmi-scale {
  margin: 16px 18px;
}
.ctc-bmi-bar {
  height: 18px;
  border-radius: 9px;
  background: linear-gradient(to right, #3498db, #2ecc71, #f39c12, #e74c3c, #922b21);
  position: relative;
}
.ctc-bmi-needle {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 28px;
  background: #1a1a1a;
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.6s cubic-bezier(.34,1.56,.64,1);
}
.ctc-bmi-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: var(--ctc-gray);
  margin-top: 4px;
}
.ctc-bmi-cat {
  margin: 10px 18px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
}

/* ── Sidebar ── */
.ctc-page-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ctc-about-box,
.ctc-other-box {
  background: var(--ctc-white);
  border-radius: var(--ctc-radius);
  box-shadow: var(--ctc-shadow);
  overflow: hidden;
  border: 1px solid var(--ctc-border);
}

.ctc-about-head,
.ctc-other-head {
  background: var(--ctc-black);
  color: #fff;
  padding: 12px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ctc-about-body {
  padding: 16px 18px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #374151;
}

.ctc-about-body p { margin-bottom: 10px; }
.ctc-about-body p:last-child { margin-bottom: 0; }
.ctc-about-body strong { color: var(--ctc-black); }

/* Other calcs mini-grid */
.ctc-other-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
}

.ctc-other-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--card-bg, #f5f5f5);
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1.5px solid transparent;
}

.ctc-other-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  border-color: var(--card-color);
  text-decoration: none;
}

.ctc-other-icon { font-size: 1.2rem; flex-shrink: 0; }

.ctc-other-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ctc-black);
  line-height: 1.3;
}

/* ── SEO Article ── */
.ctc-seo-article {
  background: var(--ctc-white);
  border-radius: var(--ctc-radius);
  box-shadow: var(--ctc-shadow);
  border: 1px solid var(--ctc-border);
  padding: 28px 32px;
  margin-top: 28px;
  line-height: 1.8;
  color: #374151;
  font-size: 0.9rem;
}

.ctc-seo-article h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ctc-black);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--page-color, var(--ctc-red));
}

.ctc-seo-article h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ctc-black);
  margin: 20px 0 10px;
}

.ctc-seo-article p { margin-bottom: 12px; }

.ctc-seo-article ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.ctc-seo-article li {
  margin-bottom: 6px;
}

.ctc-seo-article li::marker {
  color: var(--page-color, var(--ctc-red));
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .ctc-page-hero { flex-direction: column; text-align: center; padding: 20px; }
  .ctc-calc-body { grid-template-columns: 1fr; }
  .ctc-calc-body .ctc-field { grid-column: 1; }
  .ctc-result-grid { grid-template-columns: 1fr 1fr; }
  .ctc-seo-article { padding: 20px; }
  .ctc-donut-wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .ctc-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .ctc-card { padding: 10px 4px 8px; }
  .ctc-card-icon { width: 42px; height: 42px; font-size: 1.2rem; }
  .ctc-card-label { font-size: 0.63rem; }
}

/* Loading spinner */
.ctc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  grid-column: 1 / -1;
}
.ctc-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--ctc-border);
  border-top-color: var(--page-color, var(--ctc-red));
  border-radius: 50%;
  animation: ctcSpin 0.7s linear infinite;
}
@keyframes ctcSpin { to { transform: rotate(360deg); } }
