/* National Tribal Scholarship Portal - Ministry of Tribal Affairs, Govt of India */
/* Custom Styles & Accessibility (GIGW 3.0 Compliance) */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Noto+Serif:wght@600;700&display=swap');

:root {
  --font-scale: 1;
}

html {
  font-size: calc(16px * var(--font-scale));
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.focus\:not-sr-only:focus {
  position: fixed;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  z-index: 9999;
}

/* High Contrast Mode */
body.high-contrast {
  filter: contrast(125%);
  background-color: #000000 !important;
  color: #ffffff !important;
}

body.high-contrast header,
body.high-contrast footer,
body.high-contrast .bg-surface-container-lowest,
body.high-contrast .bg-surface-container-low,
body.high-contrast .bg-surface-container-high,
body.high-contrast .bg-surface-container-highest,
body.high-contrast .bg-surface-container,
body.high-contrast .bg-surface,
body.high-contrast .bg-surface-variant {
  background-color: #121212 !important;
  color: #ffff00 !important;
  border-color: #ffff00 !important;
}

body.high-contrast .text-primary,
body.high-contrast .text-secondary,
body.high-contrast .text-on-surface,
body.high-contrast .text-on-surface-variant {
  color: #ffffff !important;
}

body.high-contrast a,
body.high-contrast button {
  color: #ffff00 !important;
}

/* Dark Mode (High-Fidelity Tailwind & Custom Integration) */
html.dark,
body.dark-mode {
  background-color: #0b111e !important;
  color: #f1f5f9 !important;
}

html.dark body.dark-mode {
  background-color: #0b111e !important;
}

html.dark header,
html.dark footer,
html.dark .bg-surface,
html.dark .bg-surface-container,
html.dark .bg-surface-container-lowest,
html.dark .bg-surface-container-low,
html.dark .bg-surface-container-high,
html.dark .bg-surface-container-highest {
  background-color: #162032 !important;
  color: #f1f5f9 !important;
  border-color: #2e3d55 !important;
}

html.dark .bg-white {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #94a3b8 !important;
}

html.dark .text-primary {
  color: #93c5fd !important;
}

html.dark .text-on-surface,
html.dark .text-on-surface-variant {
  color: #e2e8f0 !important;
}

html.dark .text-outline {
  color: #94a3b8 !important;
}

html.dark .border-outline-variant\/30,
html.dark .border-outline-variant\/40,
html.dark .border-outline-variant\/20,
html.dark .border-outline-variant {
  border-color: #334155 !important;
}

html.dark tr.hover\:bg-surface-container-low:hover,
html.dark div.hover\:bg-surface-container-low:hover {
  background-color: #1e293b !important;
}

/* Low-Bandwidth / 2G Data Saver Mode */
body.low-bandwidth-mode {
  letter-spacing: 0.01em;
}

body.low-bandwidth-mode img:not(.keep-logo) {
  filter: grayscale(80%) opacity(85%);
  max-height: 140px;
}

body.low-bandwidth-mode .hero-banner-container {
  display: none !important;
}

body.low-bandwidth-mode .shadow-lg,
body.low-bandwidth-mode .shadow-md,
body.low-bandwidth-mode .shadow-xl {
  box-shadow: none !important;
}

/* Tribal Warli Pattern Borders */
.tribal-pattern-border {
  background: repeating-linear-gradient(
    45deg,
    #a04100,
    #a04100 10px,
    #fd8544 10px,
    #fd8544 20px,
    #00183b 20px,
    #00183b 30px
  );
}

/* Stepper Connector Lines */
.stepper-progress-fill {
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar for nice tables */
.custom-scrollbar::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f3ff;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #c4c6d0;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #747780;
}

/* Animation utilities */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

/* Print Stylesheet for Pre-Submission & Acknowledgment Receipts */
@media print {
  header, footer, nav, .no-print, button, .sticky {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt !important;
  }
  .print-only {
    display: block !important;
  }
  .shadow-md, .shadow-lg, .shadow-xl, .shadow-sm {
    box-shadow: none !important;
  }
  .bg-surface-container-lowest, .bg-surface-container-low, .bg-surface {
    background-color: transparent !important;
  }
}
