/* ═══════════════════════════════════════════════════════════
   Gratuity Calculator — CSS
   ID root:  #gratuity-calculator  (getElementById — hardcoded)
   JS-refs direct:
     #gc-salary     querySelector — reads .value
                    setInputError → classList.add/remove('gc-input-error')
     #gc-years      querySelector — reads .value
                    setInputError → classList.add/remove('gc-input-error')
     #resultText    style.display = 'none'|'block' (inline override)
                    style.borderLeftColor = '#d63638' (error) | green (success) (inline)
                    writes .innerHTML with <strong>, <br>, <small>
     .gc-calculate-btn  e.target.classList.contains() click trigger
     .gc-input          class on both inputs
                        e.target.classList.contains('gc-input') on Enter key
     .gc-input-error    classList.add/remove on both inputs
     .gc-result         display:none — JS sets style.display='block'
                        border-left must exist so JS inline override works
   Structural (no JS):
     .gc-form-group  .gc-label  .gc-help-text
   Design System: Dark #0A0F1C | Green #10B981 | Font: DM Sans
   ═══════════════════════════════════════════════════════════ */
/* Rank Math Breadcrumb Styling */
.rank-math-breadcrumb {
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}
.rank-math-breadcrumb a {
  color: #5A7090;
  text-decoration: none;
}
.rank-math-breadcrumb a:hover {
  color: #10B981;
}
.rank-math-breadcrumb .separator {
  color: #374B64;
  margin: 0 8px;
}
.rank-math-breadcrumb .last {
  color: #8899AA;
}

/* ── HERO ── */
.gc-hero {
  text-align: center;
  padding: 48px 20px 28px;
  max-width: 1100px;
  margin: 0 auto;
}

.gc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  color: #10B981;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.gc-hero-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 14px;
  line-height: 1.2;
}

.gc-hero-title span { color: #10B981; }

.gc-hero-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #8899AA;
  max-width: 620px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.gc-hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.gc-htag {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #10B981;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 8px;
  padding: 6px 14px;
}

/* ── CALCULATOR SECTION WRAPPER ── */
.gc-calc-section {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

/* ═══════════════════════════════════════════════════════════
   #gratuity-calculator
   JS root: document.getElementById('gratuity-calculator')
   ═══════════════════════════════════════════════════════════ */
#gratuity-calculator {
  font-family: 'DM Sans', sans-serif;
  background: #111B2E;
  border: 1px solid rgba(55,75,100,0.3);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

#gratuity-calculator * {
  box-sizing: border-box;
}

/* Green top accent bar */
#gratuity-calculator::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10B981, #34D399, #059669);
  z-index: 1;
}

/* ── CARD HEADER ── */
.gc-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(55,75,100,0.2);
}

.gc-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(16,185,129,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.gc-card-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.gc-card-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #5A7090;
}

/* ── FORM BODY ── */
.gc-form-body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 540px) {
  .gc-card-header { padding: 20px 18px 16px; }
  .gc-form-body   { padding: 20px 18px 24px; }
}

/* ── FORM GROUP — .gc-form-group (JS: no interaction) ── */
#gratuity-calculator .gc-form-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
}

/* ── LABEL — .gc-label (JS: no interaction) ── */
#gratuity-calculator .gc-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #C8D8E8;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

/* ── INPUT WRAP (prefix icon container) ── */
.gc-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.gc-input-prefix {
  position: absolute;
  left: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #5A7090;
  pointer-events: none;
  z-index: 1;
  font-family: 'DM Sans', sans-serif;
}

.gc-input-suffix {
  position: absolute;
  right: 14px;
  font-size: 13px;
  font-weight: 500;
  color: #5A7090;
  pointer-events: none;
  z-index: 1;
  font-family: 'DM Sans', sans-serif;
}

/* ── INPUT — .gc-input  (#gc-salary, #gc-years)
   JS: reads .value on both
   JS: e.target.classList.contains('gc-input') — Enter key trigger on both
   JS: classList.add/remove('gc-input-error') on both via setInputError()
── */
#gratuity-calculator .gc-input {
  display: block;
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(10,15,28,0.6);
  border: 1px solid rgba(55,75,100,0.4);
  border-radius: 10px;
  color: #FFFFFF;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  outline: none;
  -moz-appearance: textfield;
}

/* Years input — no prefix, no padding-left override */
#gratuity-calculator .gc-input.gc-years-input {
  padding-left: 14px;
  padding-right: 54px;
}

#gratuity-calculator .gc-input::placeholder {
  color: #374B64;
}

#gratuity-calculator .gc-input:focus {
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
  background: rgba(16,185,129,0.04);
}

/* Spin button hide */
#gratuity-calculator .gc-input::-webkit-outer-spin-button,
#gratuity-calculator .gc-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── INPUT ERROR — .gc-input-error
   JS: classList.add/remove('gc-input-error') via setInputError()
── */
#gratuity-calculator .gc-input.gc-input-error {
  border-color: #F87171;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
  background: rgba(248,113,113,0.05);
}

#gratuity-calculator .gc-input.gc-input-error:focus {
  border-color: #F87171;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
}

/* ── HELP TEXT — .gc-help-text  (<small> under #gc-years)
   JS: no interaction — structural hint text
── */
#gratuity-calculator .gc-help-text {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #5A7090;
  margin-top: 7px;
  line-height: 1.55;
}

/* ── CALCULATE BUTTON — .gc-calculate-btn
   JS: e.target.classList.contains('gc-calculate-btn') click trigger
── */
#gratuity-calculator .gc-calculate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: #10B981;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.25s, box-shadow 0.25s, transform 0.1s;
  letter-spacing: 0.2px;
  margin-top: 4px;
}

#gratuity-calculator .gc-calculate-btn:hover {
  background-color: #0EA573;
  box-shadow: 0 8px 24px rgba(16,185,129,0.3);
  transform: translateY(-1px);
}

#gratuity-calculator .gc-calculate-btn:active {
  transform: scale(0.98);
  box-shadow: none;
}

#gratuity-calculator .gc-calculate-btn:focus-visible {
  outline: 2px solid #10B981;
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   RESULT — #resultText / .gc-result  (<p> tag — preserve)
   JS: style.display = 'none' | 'block'  (inline override)
   JS: style.borderLeftColor = '#d63638' (error) | green value (success)
       ↑ inline override — CSS border-left MUST exist for this to work
   JS: writes .innerHTML with <strong>, <br>, <small>
   CSS: display:none by default — JS overrides with style.display
   ═══════════════════════════════════════════════════════════ */
#gratuity-calculator .gc-result {
  display: none; /* JS sets style.display='block' to reveal */
  margin-top: 20px;
  padding: 20px 22px;
  /* Border-left MUST be defined — JS overrides borderLeftColor inline */
  border-left: 4px solid #10B981;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16,185,129,0.10) 0%, rgba(16,185,129,0.04) 100%);
  border: 1px solid rgba(16,185,129,0.2);
  border-left: 4px solid #10B981; /* explicit left — JS overrides this inline */
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #C8D8E8;
  line-height: 1.85;
  animation: gc-fade-up 0.4s ease-out;
}

@keyframes gc-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* <strong> written by JS innerHTML */
#gratuity-calculator .gc-result strong {
  color: #10B981;
  font-weight: 700;
}

/* <small> written by JS innerHTML (cap notice) */
#gratuity-calculator .gc-result small {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #5A7090;
  font-style: italic;
  line-height: 1.5;
}

/* ── SHARED SECTION STYLES ── */
.gc-section-header {
  text-align: center;
  margin-bottom: 36px;
}

.gc-section-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #10B981;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 8px;
}

.gc-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 10px;
}

.gc-section-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #8899AA;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── HOW IT WORKS ── */
.gc-hiw-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 20px 20px;
}

.gc-hiw-card {
  background: #111B2E;
  border: 1px solid rgba(55,75,100,0.3);
  border-radius: 16px;
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
}

.gc-hiw-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10B981, #3B82F6, #8B5CF6, #F59E0B);
}

.gc-hiw-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}

@media (max-width: 600px) {
  .gc-hiw-steps { grid-template-columns: 1fr; gap: 20px; }
  .gc-hiw-card  { padding: 28px 20px; }
}

.gc-hiw-num {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 14px;
}

.gc-s1 { background: rgba(16,185,129,0.15);  color: #10B981; }
.gc-s2 { background: rgba(59,130,246,0.15);  color: #3B82F6; }
.gc-s3 { background: rgba(139,92,246,0.15);  color: #8B5CF6; }

.gc-hiw-stepname {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 8px;
}

.gc-hiw-stepdesc {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #8899AA;
  line-height: 1.6;
}

/* ── INFO SECTIONS ── */
.gc-info-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.gc-info-block {
  background: #111B2E;
  border: 1px solid rgba(55,75,100,0.3);
  border-radius: 16px;
  padding: 32px;
}

@media (max-width: 540px) {
  .gc-info-block { padding: 24px 20px; }
}

.gc-info-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #10B981;
  margin: 0 0 16px;
}

.gc-info-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: #8899AA;
  line-height: 1.8;
  margin: 0 0 12px;
}

.gc-info-text:last-child { margin-bottom: 0; }

.gc-info-note {
  color: #5A7090;
  font-style: italic;
  margin-top: 14px;
}

/* Formula highlight block */
.gc-formula-block {
  background: rgba(10,15,28,0.6);
  border: 1px solid rgba(16,185,129,0.2);
  border-left: 3px solid #10B981;
  border-radius: 12px;
  padding: 18px 22px;
  margin: 16px 0;
  font-family: 'DM Sans', sans-serif;
}

.gc-formula-text {
  font-size: 15px;
  font-weight: 700;
  color: #10B981;
  letter-spacing: 0.3px;
}

.gc-formula-note {
  font-size: 13px;
  color: #5A7090;
  margin-top: 6px;
  line-height: 1.5;
}

/* Example table */
.gc-example-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  margin-top: 4px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(55,75,100,0.3);
}

.gc-example-table th {
  background: rgba(10,15,28,0.6);
  color: #8899AA;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(55,75,100,0.3);
}

.gc-example-table td {
  padding: 11px 14px;
  color: #C8D8E8;
  border-bottom: 1px solid rgba(55,75,100,0.12);
}

.gc-example-table tbody tr:last-child td { border-bottom: none; }
.gc-example-table tbody tr:hover td { background: rgba(55,75,100,0.08); }
.gc-td-green { color: #10B981; font-weight: 700; }
.gc-td-muted { color: #5A7090; font-size: 13px; }

/* Rounding rule cards */
.gc-rule-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}

@media (max-width: 520px) {
  .gc-rule-cards { grid-template-columns: 1fr; }
}

.gc-rule-card {
  background: rgba(10,15,28,0.5);
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(55,75,100,0.2);
}

.gc-rule-card-green  { border-color: rgba(16,185,129,0.25); }
.gc-rule-card-amber  { border-color: rgba(245,158,11,0.25); }

.gc-rule-icon {
  font-size: 22px;
  margin-bottom: 10px;
  line-height: 1;
}

.gc-rule-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.gc-rule-card-green .gc-rule-title { color: #10B981; }
.gc-rule-card-amber .gc-rule-title { color: #FCD34D; }

.gc-rule-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #5A7090;
  line-height: 1.6;
}

/* ── RELATED GRID ── */
.gc-related-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 20px;
}

.gc-related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 680px) {
  .gc-related-grid { grid-template-columns: 1fr; }
}

.gc-related-block {
  background: #111B2E;
  border: 1px solid rgba(55,75,100,0.3);
  border-radius: 16px;
  overflow: hidden;
}

.gc-related-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  background: rgba(16,185,129,0.1);
  border-bottom: 1px solid rgba(16,185,129,0.2);
}

.gc-related-tools {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.gc-rtool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  border-bottom: 1px solid rgba(55,75,100,0.12);
  transition: background 0.2s;
}

.gc-rtool-item:last-child { border-bottom: none; }
.gc-rtool-item:hover { background: rgba(16,185,129,0.05); }
.gc-rtool-item:hover .gc-rtool-arrow { color: #10B981; transform: translateX(3px); }

.gc-rtool-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}

.gc-rtool-text { flex: 1; min-width: 0; }

.gc-rtool-text strong {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 600;
  color: #C8D8E8; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.gc-rtool-text small {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: #5A7090; line-height: 1.5;
}

.gc-rtool-arrow {
  font-size: 14px; color: #374B64;
  flex-shrink: 0; transition: color 0.2s, transform 0.2s;
}

.gc-rtool-viewall { background: rgba(16,185,129,0.04); }
.gc-rtool-viewall .gc-rtool-text strong { color: #10B981; }

/* ── QUICK FACTS ── */
.gc-facts-list {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
}

.gc-fact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(55,75,100,0.12);
  transition: background 0.2s;
}

.gc-fact-item:last-child { border-bottom: none; }
.gc-fact-item:hover { background: rgba(55,75,100,0.08); }

.gc-fact-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; line-height: 1; }
.gc-fact-body { flex: 1; }

.gc-fact-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 700;
  color: #C8D8E8; margin-bottom: 3px; line-height: 1.3;
}

.gc-fact-desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; color: #5A7090; line-height: 1.65;
}

/* ── FAQ ── */
.gc-faq-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 20px;
}

.gc-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gc-faq-item {
  background: #111B2E;
  border: 1px solid rgba(55,75,100,0.3);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.gc-faq-item:hover { border-color: rgba(16,185,129,0.3); }
.gc-faq-item.gc-faq-open { border-color: rgba(16,185,129,0.4); }

.gc-faq-q {
  width: 100%;
  background: transparent;
  border: none;
  padding: 18px 20px;
  color: #FFFFFF;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; font-weight: 600;
  text-align: left; cursor: pointer;
  display: flex; justify-content: space-between;
  align-items: center; gap: 12px; line-height: 1.4;
}

.gc-faq-q::after {
  content: '+';
  font-size: 22px; color: #10B981;
  flex-shrink: 0; font-weight: 400;
  transition: transform 0.3s; line-height: 1;
}

.gc-faq-item.gc-faq-open .gc-faq-q::after { transform: rotate(45deg); }

.gc-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  padding: 0 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; color: #8899AA; line-height: 1.7;
}

.gc-faq-item.gc-faq-open .gc-faq-a { padding: 0 20px 18px; }

/* ── CTA ── */
.gc-cta-section {
  text-align: center;
  padding: 60px 20px 80px;
  background: linear-gradient(180deg, transparent 0%, rgba(16,185,129,0.03) 100%);
}

.gc-cta-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 700; color: #FFFFFF; margin: 0 0 12px;
}

.gc-cta-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; color: #8899AA;
  max-width: 420px; margin: 0 auto 28px; line-height: 1.6;
}

.gc-cta-btn {
  display: inline-flex;
  align-items: center; gap: 8px;
  background: #10B981; color: #FFFFFF !important;
  padding: 14px 32px; border-radius: 12px;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700; font-size: 15px; transition: all 0.25s;
}

.gc-cta-btn:hover {
  background: #059669; transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16,185,129,0.25);
  color: #FFFFFF !important;
}

/* ── PRINT ── */
@media print {
  .gc-calculate-btn { display: none !important; }
  #gratuity-calculator .gc-result { display: block !important; }
}
