/*
 * JPCB Website – Custom CSS
 * Works alongside the local Tailwind build.
 * -------------------------------------------------------
 * Contains: CSS variables, custom components, accessibility
 * modes, and animations that Tailwind can't generate alone.
 */

/* -------------------------------------------------------
   2. CSS CUSTOM PROPERTIES (Design Tokens)
   ------------------------------------------------------- */
:root {
  /* Banking Green – trust, growth, stability */
  --primary:            152 58% 24%;
  --primary-foreground: 0 0% 100%;
  --primary-hover:      152 58% 20%;

  /* Warm Teal – modern accent */
  --secondary:            170 45% 30%;
  --secondary-foreground: 0 0% 100%;

  /* Gold – premium, call-to-action */
  --accent:            40 80% 50%;
  --accent-foreground: 40 80% 12%;

  /* Backgrounds */
  --background: 0 0% 100%;
  --foreground: 210 20% 12%;

  /* Cards / Surfaces */
  --card:            0 0% 100%;
  --card-foreground: 210 20% 12%;

  /* Muted */
  --muted:            210 10% 96%;
  --muted-foreground: 210 10% 40%;

  /* Borders & Inputs */
  --border: 210 10% 90%;
  --input:  210 10% 90%;
  --ring:   152 58% 24%;

  /* Destructive (red) */
  --destructive:            0 72% 51%;
  --destructive-foreground: 0 0% 100%;

  /* Misc */
  --radius:      0.5rem;
  --section-alt: 210 15% 97%;

  /* Typography */
  --font-heading: 'Merriweather', Georgia, serif;
  --font-body:    'Source Sans 3', -apple-system, sans-serif;
}

/* -------------------------------------------------------
   3. DARK MODE
   ------------------------------------------------------- */
.dark {
  --primary:            152 50% 42%;
  --primary-foreground: 0 0% 100%;
  --primary-hover:      152 50% 48%;
  --secondary:            170 40% 40%;
  --secondary-foreground: 0 0% 100%;
  --accent:            40 80% 55%;
  --accent-foreground: 0 0% 0%;
  --background: 0 0% 0%;
  --foreground: 0 0% 95%;
  --card:            0 0% 6%;
  --card-foreground: 0 0% 95%;
  --muted:            0 0% 10%;
  --muted-foreground: 0 0% 65%;
  --border: 0 0% 16%;
  --input:  0 0% 16%;
  --ring:   152 50% 42%;
  --destructive:            0 65% 55%;
  --destructive-foreground: 0 0% 100%;
  --section-alt: 0 0% 4%;
}

/* -------------------------------------------------------
   4. HIGH CONTRAST MODE
   ------------------------------------------------------- */
.high-contrast {
  --primary:            152 100% 18%;
  --primary-foreground: 0 0% 100%;
  --background:         0 0% 100%;
  --foreground:         0 0% 0%;
  --card:               0 0% 100%;
  --card-foreground:    0 0% 0%;
  --muted:              0 0% 95%;
  --muted-foreground:   0 0% 0%;
  --border:             0 0% 0%;
  --accent:             40 100% 40%;
  --accent-foreground:  0 0% 0%;
}
.dark.high-contrast {
  --primary:          152 100% 50%;
  --primary-foreground: 0 0% 0%;
  --background:       0 0% 0%;
  --foreground:       0 0% 100%;
  --card:             0 0% 0%;
  --card-foreground:  0 0% 100%;
  --muted:            0 0% 8%;
  --muted-foreground: 0 0% 100%;
  --border:           0 0% 100%;
}

/* -------------------------------------------------------
   5. ACCESSIBILITY MODES
   ------------------------------------------------------- */
.grayscale-mode { filter: grayscale(100%); }

.reader-mode {
  --background:  45 30% 96%;
  --foreground:  30 10% 15%;
  --card:        45 30% 98%;
  --card-foreground: 30 10% 15%;
  --muted:       45 20% 92%;
  --section-alt: 45 25% 94%;
}
.reader-mode body { max-width: 800px; margin: 0 auto; }

.highlight-links a:not(.no-highlight):not([role="button"]) {
  background-color: hsl(50 100% 80%) !important;
  color: hsl(0 0% 0%) !important;
  text-decoration: underline !important;
  padding: 0.125rem 0.25rem;
  border-radius: 2px;
  outline: 2px solid hsl(50 100% 60%);
}

.highlight-headings h1,
.highlight-headings h2,
.highlight-headings h3,
.highlight-headings h4,
.highlight-headings h5,
.highlight-headings h6 {
  background-color: hsl(200 100% 90%) !important;
  color: hsl(0 0% 0%) !important;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  outline: 2px solid hsl(200 80% 60%);
}

.text-spacing,
.text-spacing p,
.text-spacing li,
.text-spacing span,
.text-spacing div {
  letter-spacing: 0.08em !important;
  word-spacing:   0.2em  !important;
  line-height:    2      !important;
}

.focus-strip-active { cursor: none; }
.focus-strip-clear {
  position: fixed;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 9998;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
  transition: top 0.05s linear;
}

.pause-motion,
.pause-motion * {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
}

/* Font size scales */
.text-scale-80  { font-size: 80%;  }
.text-scale-90  { font-size: 90%;  }
.text-scale-100 { font-size: 100%; }
.text-scale-110 { font-size: 110%; }
.text-scale-120 { font-size: 120%; }
.text-scale-130 { font-size: 130%; }
.text-scale-140 { font-size: 140%; }
.text-scale-150 { font-size: 150%; }

/* -------------------------------------------------------
   6. BASE STYLES
   ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  margin: 0;
  overflow-x: clip;
  max-width: 100%;
}

img, video, iframe, table { max-width: 100%; }

/* Mobile top bar (Digital Banking CTA) - show below 1024px, hide above */
.mobile-top-bar { display: block; }
@media (min-width: 1024px) { .mobile-top-bar { display: none !important; } }

/* Desktop inline Digital Banking button - hide below 1024px */
.header-digital-cta { display: none !important; }
@media (min-width: 1024px) { .header-digital-cta { display: inline-flex !important; } }

/* Mobile logo cap - keep room for search + hamburger */
@media (max-width: 1023px) {
  header img[alt*="Jalgaon"], header img[alt*="JPC"] {
    max-width: 200px;
    height: auto;
  }
}
@media (max-width: 480px) {
  header img[alt*="Jalgaon"], header img[alt*="JPC"] {
    max-width: 150px;
  }
}

/* Accessibility toolbar - tighten spacing on mobile so all controls (incl. Marathi, More) fit */
@media (max-width: 768px) {
  [role="toolbar"][aria-label="Accessibility options"] .a11y-btn {
    min-width: 32px;
    min-height: 32px;
    padding: 0.25rem;
    gap: 0.25rem;
  }
  [role="toolbar"][aria-label="Accessibility options"] .a11y-lang-btn {
    padding: 0.125rem 0.35rem;
    font-size: 0.7rem;
  }
  [role="toolbar"][aria-label="Accessibility options"] .py-1\.5 {
    gap: 0.125rem;
  }
  [role="toolbar"][aria-label="Accessibility options"] .gap-1 {
    gap: 0.125rem !important;
  }
  [role="toolbar"][aria-label="Accessibility options"] .gap-0\.5 {
    gap: 0 !important;
  }
  [role="toolbar"][aria-label="Accessibility options"] .mr-1 {
    margin-right: 0.125rem !important;
  }
  [role="toolbar"][aria-label="Accessibility options"] #a11y-scale-display {
    min-width: 2rem;
    font-size: 0.7rem;
  }
}

/* Trust stats: grid on mobile, even-spaced flex row on desktop */
.trust-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  width: 100%;
}
@media (min-width: 640px) {
  .trust-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .trust-stats-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .trust-stats-grid > * { flex: 1; min-width: 120px; }
}

@media (min-width: 768px) {
  body { font-size: 1.0625rem; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
}

*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

/* -------------------------------------------------------
   7. LAYOUT UTILITIES
   ------------------------------------------------------- */
.container-bank {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px)  { .container-bank { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .container-bank { padding-left: 2rem;   padding-right: 2rem;   } }

.section-padding { padding-top: 3rem; padding-bottom: 3rem; }
@media (min-width: 768px)  { .section-padding { padding-top: 4rem;  padding-bottom: 4rem;  } }
@media (min-width: 1024px) { .section-padding { padding-top: 5rem;  padding-bottom: 5rem;  } }

.section-alt { background-color: hsl(var(--section-alt)); }

/* -------------------------------------------------------
   8. COMPONENTS
   ------------------------------------------------------- */

/* Cards */
.bank-card {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.07);
  transition: box-shadow 0.2s;
}
.bank-card:hover { box-shadow: 0 4px 12px 0 rgba(0,0,0,0.1); }

.bank-card-elevated {
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  box-shadow: 0 4px 12px 0 rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}
.bank-card-elevated:hover { box-shadow: 0 8px 24px 0 rgba(0,0,0,0.12); }

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }

.btn-accent {
  display: inline-flex;
  align-items: center;
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-accent:hover { opacity: 0.9; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-secondary:hover { opacity: 0.9; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  background-color: transparent;
  color: hsl(var(--primary));
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid hsl(var(--primary));
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.btn-outline:hover {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* Skip Links */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 9999;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* Tap targets */
.tap-target { min-height: 44px; min-width: 44px; }

/* Trust badge */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: hsl(var(--muted));
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Readable text */
.readable { font-size: 1rem; line-height: 1.625; }
@media (min-width: 768px) { .readable { font-size: 1.125rem; } }

/* -------------------------------------------------------
   9. GRADIENTS
   ------------------------------------------------------- */
.gradient-primary {
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(152 48% 32%) 100%);
}
.gradient-secondary {
  background: linear-gradient(135deg, hsl(var(--secondary)) 0%, hsl(170 38% 38%) 100%);
}

/* -------------------------------------------------------
   10. TICKER ANIMATION
   ------------------------------------------------------- */
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-animate {
  animation: ticker 30s linear infinite;
}
.ticker-animate:hover {
  animation-play-state: paused;
}

/* -------------------------------------------------------
   11. FADE-IN ANIMATION
   ------------------------------------------------------- */
@keyframes fadeIn {
  0%   { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.4s ease-out; }

/* -------------------------------------------------------
   12. ACCESSIBILITY TOOLBAR
   ------------------------------------------------------- */
.a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: hsl(var(--primary-foreground));
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.15s;
}
.a11y-btn:hover         { background-color: rgba(255,255,255,0.2); }
.a11y-btn.a11y-btn-active { background-color: hsl(var(--primary-foreground)); color: hsl(var(--primary)); font-weight: 600; }

.a11y-lang-btn {
  padding: 0.125rem 0.55rem;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: hsl(var(--primary-foreground));
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.a11y-lang-btn:hover       { background-color: rgba(255,255,255,0.2); }
.a11y-lang-btn.a11y-lang-active { background-color: hsl(var(--primary-foreground)); color: hsl(var(--primary)); font-weight: 600; }

/* -------------------------------------------------------
   13. NAVIGATION
   ------------------------------------------------------- */
.nav-link {
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover, .nav-link.active {
  color: hsl(var(--primary));
}

.dropdown-item {
  color: hsl(var(--foreground));
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 0.15s;
}
.dropdown-item:hover { background-color: hsl(var(--muted)); }

.mobile-sub-link {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
}
.mobile-sub-link:hover { color: hsl(var(--primary)); }

.hover-primary:hover  { color: hsl(var(--primary)); }
.hover-bg-muted:hover { background-color: hsl(var(--muted)); }

/* -------------------------------------------------------
   14. QUICK ACTIONS
   ------------------------------------------------------- */
.quick-action-card {
  transition: border-color 0.2s;
  text-decoration: none;
}
.quick-action-card:hover { border-color: hsl(var(--primary)); }

.quick-action-alert { border-color: hsl(var(--destructive) / 0.3); }
.quick-action-alert:hover { border-color: hsl(var(--destructive)); }

.quick-action-icon {
  background-color: hsl(var(--primary) / 0.1);
}
.quick-action-card:hover .quick-action-icon { background-color: hsl(var(--primary)); }

.quick-action-icon-alert { background-color: hsl(var(--destructive) / 0.1); }
.quick-action-card:hover .quick-action-icon-alert { background-color: hsl(var(--destructive)); }

.quick-action-svg { color: hsl(var(--primary)); }
.quick-action-card:hover .quick-action-svg { color: hsl(var(--primary-foreground)); }

.quick-action-svg-alert { color: hsl(var(--destructive)); }
.quick-action-card:hover .quick-action-svg-alert { color: hsl(var(--primary-foreground)); }

/* -------------------------------------------------------
   15. NOTICE ITEMS
   ------------------------------------------------------- */
.notice-item { text-decoration: none; display: block; }
.notice-item:hover { border-color: hsl(var(--primary)); }

/* -------------------------------------------------------
   16. PRODUCT CARDS
   ------------------------------------------------------- */
.product-learn-more { color: hsl(var(--primary)); text-decoration: none; }
.product-learn-more:hover { gap: 0.75rem; }

/* -------------------------------------------------------
   17. FOOTER LINKS
   ------------------------------------------------------- */
.footer-link {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  display: inline-block;
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
  transition: color 0.15s;
  min-height: 44px;
  line-height: 44px;
}
.footer-link:hover { color: rgba(255,255,255,1); }

/* -------------------------------------------------------
   18. LUCIDE ICONS (ensure inline display)
   ------------------------------------------------------- */
[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
