/* ================================================
   SBI Credit Card Cash Withdrawal Fee 2026
   Professional Financial Article Stylesheet
   ================================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a5f;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;

  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue-600);
  text-decoration: none;
  transition: color .2s;
}
a:hover {
  color: var(--blue-800);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== TOPBAR ==================== */
.topbar {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-900) 100%);
  color: white;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.badge {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,.2);
}

/* ==================== HERO ==================== */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%);
  color: white;
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.breadcrumb {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  margin-bottom: 16px;
  letter-spacing: .02em;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.025em;
  max-width: 800px;
}

.subtitle {
  font-size: 1.125rem;
  line-height: 1.6;
  color: rgba(255,255,255,.85);
  max-width: 700px;
  margin-bottom: 24px;
}

.subtitle strong {
  color: #fbbf24;
  font-weight: 700;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.meta-item {
  font-size: .85rem;
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== MAIN GRID ==================== */
.main-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 80px;
}

/* ==================== TABLE OF CONTENTS ==================== */
.toc {
  align-self: start;
  position: sticky;
  top: 70px;
}

.toc-inner {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.toc h3 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-500);
  margin-bottom: 14px;
  font-weight: 600;
}

.toc ol {
  list-style: none;
  counter-reset: toc-counter;
}

.toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 6px;
}

.toc ol li a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .88rem;
  color: var(--gray-600);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all .2s;
  line-height: 1.4;
}

.toc ol li a::before {
  content: counter(toc-counter);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: .75rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

.toc ol li a:hover {
  background: var(--blue-50);
  color: var(--blue-700);
  text-decoration: none;
}

.toc ol li a:hover::before {
  background: var(--blue-100);
  color: var(--blue-700);
}

/* ==================== ARTICLE BODY ==================== */
.article-body {
  min-width: 0;
}

.article-body section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s;
}

.article-body section:hover {
  box-shadow: var(--shadow-md);
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue-100);
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-top: 28px;
  margin-bottom: 12px;
}

.article-body p {
  margin-bottom: 14px;
  color: var(--gray-700);
}

.article-body ul, .article-body ol {
  margin-bottom: 14px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
  color: var(--gray-700);
}

.source-note {
  font-size: .85rem;
  color: var(--gray-500);
  font-style: italic;
  margin-bottom: 12px;
}

/* ==================== TABLES ==================== */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

thead {
  background: linear-gradient(135deg, var(--gray-800), var(--gray-700));
  color: white;
}

thead th {
  padding: 12px 16px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  font-size: .85rem;
  letter-spacing: .02em;
}

tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--gray-50);
}

.row-highlight {
  background: var(--amber-50) !important;
}

.row-highlight:hover {
  background: var(--amber-100) !important;
}

.highlight-cell {
  background: var(--amber-50);
  font-weight: 600;
  color: var(--amber-700);
}

.danger-cell {
  background: var(--red-50);
  color: var(--red-700);
  font-weight: 600;
}

.warn-cell {
  background: var(--amber-50);
  color: var(--amber-700);
  font-weight: 600;
}

.good-cell {
  background: var(--green-50);
  color: var(--green-700);
  font-weight: 600;
}

.highlight-col {
  background: var(--green-50);
}

.total-col {
  font-weight: 700;
  font-size: 1rem;
}

.calc-table thead {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-800));
}

/* ==================== CALLOUTS ==================== */
.callout {
  padding: 18px 22px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  font-size: .93rem;
  line-height: 1.6;
}

.callout ol {
  padding-left: 20px;
  margin-top: 8px;
}

.callout-warn {
  background: var(--amber-50);
  border-left: 4px solid var(--amber-500);
  color: var(--amber-700);
}

.callout-info {
  background: var(--blue-50);
  border-left: 4px solid var(--blue-500);
  color: var(--blue-800);
}

.callout-good {
  background: var(--green-50);
  border-left: 4px solid var(--green-500);
  color: var(--green-700);
}

/* ==================== INSIGHT CARDS ==================== */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.insight-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: transform .2s, box-shadow .2s;
}

.insight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.insight-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.insight-card h4 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.insight-card p {
  font-size: .87rem;
  color: var(--gray-600);
  margin-bottom: 0;
}

/* ==================== RATE CARDS ==================== */
.rate-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.rate-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 2px solid;
}

.rate-high {
  background: var(--red-50);
  border-color: var(--red-500);
}

.rate-low {
  background: var(--green-50);
  border-color: var(--green-500);
}

.rate-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.rate-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.rate-high .rate-value {
  color: var(--red-600);
}

.rate-low .rate-value {
  color: var(--green-600);
}

.rate-annual {
  font-size: .9rem;
  color: var(--gray-500);
  font-weight: 500;
}

.rate-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.rate-card p {
  font-size: .87rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* ==================== TRAPS ==================== */
.trap-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.trap {
  display: flex;
  gap: 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color .3s;
}

.trap:hover {
  border-color: var(--red-300);
}

.trap-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.trap-body h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--gray-900);
}

.settlement-order {
  list-style: none;
  padding-left: 0;
  margin: 12px 0;
  counter-reset: settlement;
}

.settlement-order li {
  counter-increment: settlement;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  border-bottom: 1px dashed var(--gray-200);
}

.settlement-order li::before {
  content: counter(settlement);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: .75rem;
  font-weight: 600;
}

.settlement-order .last-item {
  background: var(--red-50);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--red-700);
  border-bottom: none;
}

.settlement-order .last-item::before {
  background: var(--red-500);
  color: white;
}

.tag-danger {
  display: inline-block;
  background: var(--red-600);
  color: white;
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-left: 4px;
}

.example-box {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 12px;
  font-size: .9rem;
}

/* ==================== COMPARISON CARDS ==================== */
.comparison-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 20px 0;
}

.comparison-card {
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  border: 2px solid;
}

.comparison-card.bad {
  background: var(--red-50);
  border-color: var(--red-200);
}

.comparison-card.good {
  background: var(--green-50);
  border-color: var(--green-500);
  position: relative;
}

.comparison-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 12px;
}

.comparison-cost {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.comparison-card.bad .comparison-cost {
  color: var(--red-600);
}

.comparison-card.good .comparison-cost {
  color: var(--green-600);
}

.comparison-card p {
  font-size: .87rem;
  color: var(--gray-600);
  margin-bottom: 0;
}

.savings-tag {
  display: inline-block;
  margin-top: 14px;
  background: var(--green-600);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
}

/* ==================== STEPS ==================== */
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  transition: border-color .2s;
}

.step:hover {
  border-color: var(--blue-300);
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color: white;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

.step p {
  margin-bottom: 0;
  font-size: .93rem;
}

/* ==================== DISCLAIMER ==================== */
.disclaimer {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-top: 20px;
  font-size: .85rem;
  color: var(--gray-600);
}

.disclaimer p {
  margin-bottom: 0;
  color: var(--gray-600);
}

/* ==================== FOOTER ==================== */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 32px 0;
  text-align: center;
  font-size: .85rem;
}

.footer p {
  color: var(--gray-400);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  
  .toc {
    position: static;
    order: -1;
  }
  
  .toc-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    align-items: center;
  }
  
  .toc h3 {
    margin-bottom: 0;
    margin-right: 10px;
  }
  
  .toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .toc ol li a {
    padding: 4px 10px;
    font-size: .82rem;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 36px 0 32px;
  }
  
  .hero h1 {
    font-size: 1.65rem;
  }
  
  .subtitle {
    font-size: 1rem;
  }
  
  .meta-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .article-body section {
    padding: 24px 18px;
  }
  
  .article-body h2 {
    font-size: 1.3rem;
  }
  
  .insights-grid,
  .rate-cards,
  .comparison-cards {
    grid-template-columns: 1fr;
  }
  
  .trap {
    flex-direction: column;
    gap: 12px;
  }
  
  .trap-num {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 1rem;
  }
  
  table {
    font-size: .82rem;
  }
  
  thead th {
    padding: 10px 10px;
    font-size: .78rem;
  }
  
  tbody td {
    padding: 9px 10px;
  }
  
  .toc-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .toc ol {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .hero h1 {
    font-size: 1.4rem;
  }
  
  .article-body section {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
  
  .rate-header {
    flex-direction: column;
    gap: 4px;
  }
  
  .rate-value {
    font-size: 1.3rem;
  }
  
  .comparison-cost {
    font-size: 1.5rem;
  }
  
  .callout {
    padding: 14px 16px;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  .topbar, .toc, .footer {
    display: none;
  }
  
  .hero {
    background: white !important;
    color: black !important;
    padding: 20px 0;
  }
  
  .hero h1 {
    color: black;
  }
  
  .subtitle, .breadcrumb, .meta-item {
    color: #333 !important;
  }
  
  .main-grid {
    display: block;
  }
  
  .article-body section {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
  
  body {
    font-size: 12pt;
  }
}

/* ==================== SMOOTH SCROLL TARGET HIGHLIGHT ==================== */
section:target {
  animation: highlightSection .8s ease-out;
}

@keyframes highlightSection {
  0% {
    box-shadow: 0 0 0 4px rgba(59,130,246,.4);
  }
  100% {
    box-shadow: var(--shadow-sm);
  }
}

/* ==================== SCROLLBAR STYLING ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
