/* ==========================================================================
   SOKB SEMICONDUCTOR (SOKB PRIVATE LIMITED)
   Enterprise Design System & GIGW Compliance Stylesheet
   Domain: sokbsemi.in | Contact: design@sokbsemi.in
   Mobile, Tablet, Cross-Browser & Security Hardened
   ========================================================================== */

:root {
  --color-silicon-gray: #2B2D2F;
  --color-navy-blue: #0F2042;
  --color-navy-dark: #091326;
  --color-copper: #D97706;
  --color-copper-light: #F59E0B;
  --color-copper-dark: #B45309;
  --color-bg-light: #F8FAFC;
  --color-surface-light: #FFFFFF;
  --color-border-light: #E2E8F0;
  --color-text-light: #1E293B;
  --color-text-muted-light: #64748B;
  
  --base-font-size: 16px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
  font-size: var(--base-font-size);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-light);
  color: var(--color-text-light);
  transition: background-color 0.2s ease, color 0.2s ease;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ==========================================================================
   GIGW ACCESSIBILITY CONTROLS (Guidelines for Indian Government Websites)
   ========================================================================== */

/* Skip to Main Content Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--color-copper);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  font-size: 0.875rem;
  z-index: 9999;
  transition: top 0.2s ease-in-out;
  border-radius: 0 0 0.375rem 0.375rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #000;
}

/* Accessible Focus Outlines */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-copper);
  outline-offset: 2px;
}

/* Text Scaling via GIGW Bar */
html[data-font-size="small"] {
  --base-font-size: 14px;
}
html[data-font-size="normal"] {
  --base-font-size: 16px;
}
html[data-font-size="large"] {
  --base-font-size: 18px;
}

/* ==========================================================================
   HIGH CONTRAST MODE (GIGW MANDATE)
   ========================================================================== */
html.high-contrast {
  filter: contrast(130%);
}

html.high-contrast body {
  background-color: #000000 !important;
  color: #FFFF00 !important;
}

html.high-contrast .bg-white,
html.high-contrast .bg-slate-50,
html.high-contrast .bg-slate-100,
html.high-contrast .bg-slate-800,
html.high-contrast .bg-slate-900,
html.high-contrast .bg-gray-900 {
  background-color: #000000 !important;
  border-color: #FFFF00 !important;
}

html.high-contrast a,
html.high-contrast button {
  color: #FFFF00 !important;
}

html.high-contrast text,
html.high-contrast p,
html.high-contrast span,
html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast h4,
html.high-contrast th,
html.high-contrast td {
  color: #FFFF00 !important;
}

html.high-contrast .border,
html.high-contrast .border-t,
html.high-contrast .border-b,
html.high-contrast .border-l,
html.high-contrast .border-r {
  border-color: #FFFF00 !important;
}

html.high-contrast .badge-copper,
html.high-contrast .bg-amber-600,
html.high-contrast .bg-amber-500 {
  background-color: #000000 !important;
  border: 2px solid #FFFF00 !important;
  color: #FFFF00 !important;
}

/* ==========================================================================
   DARK MODE PALETTE
   ========================================================================== */
html.dark {
  color-scheme: dark;
}

html.dark body {
  background-color: #090D16;
  color: #E2E8F0;
}

html.dark .bg-surface-primary {
  background-color: #0F172A;
}

html.dark .bg-surface-card {
  background-color: #131E35;
}

html.dark .border-surface {
  border-color: #1E293B;
}

html.dark .logo-text-primary {
  fill: #FFFFFF;
}

html.light .logo-text-primary {
  fill: #0F2042;
}

/* Monospace Technical Elements */
.font-mono-tech {
  font-family: var(--font-mono);
  letter-spacing: -0.025em;
}

/* Technical Data Matrix Table Styling & Mobile Responsiveness */
.table-responsive-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.tech-table {
  width: 100%;
  min-width: 620px; /* Ensures scannability on small screens without truncation */
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.tech-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background-color: rgba(15, 32, 66, 0.06);
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #CBD5E1;
  text-align: left;
}

html.dark .tech-table th {
  background-color: rgba(15, 23, 42, 0.8);
  border-bottom-color: #334155;
  color: #94A3B8;
}

.tech-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #E2E8F0;
  vertical-align: top;
}

html.dark .tech-table td {
  border-bottom-color: #1E293B;
}

.tech-table tr:hover td {
  background-color: rgba(217, 119, 6, 0.04);
}

html.dark .tech-table tr:hover td {
  background-color: rgba(217, 119, 6, 0.08);
}

/* Memory Map Visualizer */
.memory-row {
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.memory-row:hover {
  transform: translateX(4px);
}

/* Semiconductor Grid Pattern Accent */
.silicon-grid-pattern {
  background-image: radial-gradient(#94A3B8 0.75px, transparent 0.75px);
  background-size: 16px 16px;
}

html.dark .silicon-grid-pattern {
  background-image: radial-gradient(#334155 0.75px, transparent 0.75px);
}

/* Copper Accent Bar */
.accent-border-top {
  border-top: 3px solid var(--color-copper);
}

/* Badges */
.badge-copper {
  background-color: rgba(217, 119, 6, 0.12);
  color: #B45309;
  border: 1px solid rgba(217, 119, 6, 0.3);
  font-family: var(--font-mono);
}

html.dark .badge-copper {
  background-color: rgba(217, 119, 6, 0.2);
  color: #FBBF24;
  border-color: rgba(217, 119, 6, 0.4);
}

.badge-blue {
  background-color: rgba(15, 32, 66, 0.08);
  color: #0F2042;
  border: 1px solid rgba(15, 32, 66, 0.2);
  font-family: var(--font-mono);
}

html.dark .badge-blue {
  background-color: rgba(56, 189, 248, 0.1);
  color: #38BDF8;
  border-color: rgba(56, 189, 248, 0.3);
}

/* Interactive Timeline Component */
.timeline-stem {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 23px;
  width: 2px;
  background: #CBD5E1;
}

html.dark .timeline-stem {
  background: #334155;
}

/* Mobile & Tablet Usability & Touch Enhancements */
@media (max-width: 768px) {
  /* Enforce minimum touch target sizing (44px) */
  button,
  a.btn,
  .nav-link,
  input[type="submit"] {
    min-height: 44px;
  }

  /* Micro-spacing adjustments for mobile screens */
  .tech-table th,
  .tech-table td {
    padding: 0.625rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* Anti-Bot Proof-of-Work Verification Badge */
.pow-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background-color: rgba(16, 185, 129, 0.08);
  color: #059669;
}

html.dark .pow-badge {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* Print Optimization */
@media print {
  .no-print,
  nav,
  footer,
  #gigw-bar,
  #theme-toggle-btn {
    display: none !important;
  }
  
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 11pt;
  }
  
  .shadow-md,
  .shadow-lg,
  .shadow-xl {
    box-shadow: none !important;
  }
  
  .tech-table th,
  .tech-table td {
    border-color: #000000 !important;
  }
}
