/* CGPA & Percentage Calculator Tool Styles */
@import url('../../css/style.css');

.tool-page-wrapper {
  background-color: #f8fafc;
  min-height: 100vh;
}

/* Hero Section */
.tool-hero {
  padding: 80px 20px 48px;
  background: linear-gradient(135deg, #0a192f 0%, #0f2b48 60%, #1e40af 100%);
  color: #ffffff;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tool-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.tool-hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.tool-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(147, 197, 253, 0.35);
  color: #93c5fd;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.tool-hero h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.tool-hero-lead {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.6;
  color: #cbd5e1;
  max-width: 720px;
  margin: 0 auto 28px;
}

.tool-hero-highlights {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  color: #e2e8f0;
}

.hero-pill svg {
  color: #38bdf8;
}

/* Calculator Section & Card */
.calc-section {
  padding: 40px 20px 60px;
  position: relative;
  margin-top: -30px;
  z-index: 2;
}

.calc-container {
  max-width: 1100px;
  margin: 0 auto;
}

.calc-card-main {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.12), 0 8px 16px -6px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
  padding: 36px 32px;
  position: relative;
}

/* Two Column Grid */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: start;
}

@media (max-width: 860px) {
  .calc-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .calc-card-main {
    padding: 24px 18px;
  }
}

/* Left Column: Controls & Inputs */
.calc-controls-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.calc-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  margin-bottom: 8px;
  display: block;
}

/* Segmented Toggle Groups */
.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  border: 1px solid #e2e8f0;
}

.segment-btn {
  background: transparent;
  border: none;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-family: inherit;
}

.segment-btn:hover:not(.active) {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.5);
}

.segment-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 10px -2px rgba(37, 99, 235, 0.4);
}

/* Scale Subtitle helper */
.scale-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 6px;
  line-height: 1.4;
}

/* Input Card & Slider */
.calc-input-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
}

.input-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.input-header-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.input-range-badge {
  font-size: 0.76rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
}

.calc-number-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.calc-input-number {
  width: 100%;
  padding: 12px 60px 12px 18px;
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.calc-input-number:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.input-unit-symbol {
  position: absolute;
  right: 18px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #64748b;
  pointer-events: none;
}

/* Slider Track & Thumb */
.calc-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  transition: background 0.15s;
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.6);
}

.calc-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
  cursor: pointer;
}

.slider-scale-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 0 2px;
}

/* Formula Box */
.formula-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.formula-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.formula-body {
  flex: 1;
}

.formula-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #166534;
  margin-bottom: 4px;
}

.formula-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #14532d;
  line-height: 1.4;
}

.formula-note {
  font-size: 0.78rem;
  color: #15803d;
  margin-top: 4px;
  line-height: 1.35;
}

/* Right Column: Result Cards */
.calc-results-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Primary Result Card */
.res-card-primary {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px -2px rgba(37, 99, 235, 0.08);
}

.res-primary-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #1d4ed8;
  margin-bottom: 8px;
}

.res-primary-val {
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.res-primary-sub {
  font-size: 0.85rem;
  color: #475569;
  margin-top: 8px;
  font-weight: 500;
}

/* Result Sub Cards Grid */
.res-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.res-sub-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  transition: transform 0.2s, border-color 0.2s;
}

.res-sub-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.res-sub-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.res-sub-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.res-sub-note {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Academic Performance Band */
.perf-band-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
}

.perf-band-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.perf-band-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.perf-band-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: #dbeafe;
  color: #1d4ed8;
}

.perf-bar-wrapper {
  position: relative;
  margin: 10px 0 6px;
}

.perf-bar-track {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #ef4444 0%, #f59e0b 50%, #3b82f6 65%, #10b981 80%, #059669 100%);
  position: relative;
  overflow: visible;
}

.perf-bar-marker {
  position: absolute;
  top: -4px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border: 3px solid #0f172a;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: left 0.2s ease;
}

.perf-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 6px;
}

/* Study Abroad Card (Dashed Border) */
.study-abroad-card {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.study-abroad-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.study-abroad-body {
  flex: 1;
}

.study-abroad-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0284c7;
  margin-bottom: 4px;
}

.study-abroad-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
}

/* Right Col Footer Brand */
.calc-brand-footer {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding-top: 4px;
}

.calc-brand-footer span {
  color: #2563eb;
}

/* SEO Content & Informational Sections */
.info-section {
  padding: 60px 20px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.info-container {
  max-width: 960px;
  margin: 0 auto;
}

.info-block {
  margin-bottom: 56px;
}

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

.info-heading {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.info-lead-p {
  font-size: 1rem;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 20px;
}

/* Formula Highlight Box in SEO Section */
.seo-formula-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

@media (max-width: 640px) {
  .seo-formula-grid {
    grid-template-columns: 1fr;
  }
}

.seo-formula-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.seo-formula-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.seo-formula-card .code-math {
  display: inline-block;
  background: #e2e8f0;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.seo-formula-card p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
}

/* Responsive Table Wrapper */
.table-responsive-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  margin: 24px 0;
}

.conversion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
  min-width: 640px;
}

.conversion-table th {
  background: #0f172a;
  color: #ffffff;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.conversion-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.conversion-table tr:nth-child(even) {
  background: #f8fafc;
}

.conversion-table tr:hover {
  background: #f1f5f9;
}

.conversion-table .badge-grade {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-distinction {
  background: #dcfce7;
  color: #15803d;
}

.badge-first {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-second {
  background: #fef3c7;
  color: #b45309;
}

.badge-pass {
  background: #f1f5f9;
  color: #475569;
}

/* 3-Step Guide Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

.step-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px 20px;
  position: relative;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 14px;
}

.step-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.55;
}

/* FAQ Section */
.faq-section {
  padding: 60px 20px 80px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.faq-container {
  max-width: 820px;
  margin: 0 auto;
}

.faq-header {
  text-align: center;
  margin-bottom: 40px;
}

.faq-header h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.faq-header p {
  font-size: 1rem;
  color: #64748b;
}

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

.faq-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item:hover {
  border-color: #cbd5e1;
}

.faq-item.active {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 20px 24px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: inherit;
  position: relative;
  z-index: 1;
}

.faq-icon-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.3s ease, color 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon-arrow,
.faq-item.active .faq-icon-arrow {
  transform: rotate(180deg);
  color: #2563eb;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  padding: 0 24px;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.65;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.35s ease, visibility 0s 0.35s;
}

.faq-question[aria-expanded="true"] + .faq-answer,
.faq-answer.active {
  max-height: 600px;
  opacity: 1;
  visibility: visible;
  padding: 4px 24px 20px;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.35s ease, visibility 0s 0s;
}

/* CTA Section */
.tool-cta-section {
  padding: 70px 20px;
  background: linear-gradient(135deg, #0a192f 0%, #0f2b48 60%, #1e40af 100%);
  color: #ffffff;
  text-align: center;
}

.tool-cta-container {
  max-width: 760px;
  margin: 0 auto;
}

.tool-cta-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 16px;
  line-height: 1.3;
}

.tool-cta-desc {
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 32px;
}

.tool-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #2563eb;
  color: #ffffff;
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5);
  transition: all 0.2s ease;
}

.tool-cta-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -5px rgba(37, 99, 235, 0.6);
  color: #ffffff;
}

.tool-cta-btn svg {
  transition: transform 0.2s;
}

.tool-cta-btn:hover svg {
  transform: translateX(4px);
}



/* =========================================
   MOBILE RESPONSIVENESS & STACKING FIX
   ========================================= */
@media (max-width: 768px) {
  .calc-container,
  .calc-card-main,
  .calculator-section,
  .calculator-card,
  .generator-section,
  .generator-card,
  .results-wrapper,
  .output-section {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .calc-inputs-grid,
  .breakdown-grid,
  .calc-grid,
  .competitors-grid,
  .steps-grid,
  .why-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    width: 100% !important;
  }

  .input-card,
  .breakdown-item,
  .shock-card,
  .result-card,
  .competitor-box {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}
