/* ========================================================
   PORTAL SISTEM INFORMASI POLITEKNIK STIA LAN MAKASSAR
   Natural, Soft & Prestigious Aesthetics (UI/UX Premium Kampus & Pemerintah)
   ======================================================== */

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

:root {
  --font-primary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-readable: 'Lexend', sans-serif;
  
  /* Natural & Soft Premium Colors */
  --natural-navy: #112239;
  --natural-navy-soft: #1C3352;
  --natural-navy-light: #25426B;
  
  --champagne-gold: #C2A374;
  --champagne-gold-light: #F4EFE8;
  --champagne-gold-dark: #9F8052;
  
  --sage-green: #3A6953;
  --sage-green-light: #EDF4F0;
  
  --terracotta-soft: #99544D;
  --terracotta-light: #FBF0EF;
  
  --lavender-slate: #545975;
  --lavender-light: #F1F2F6;
  
  --bg-natural-light: #F9F9FA;
  --bg-card-light: #FFFFFF;
  --border-natural-light: rgba(226, 232, 240, 0.85);

  --font-scale: 1;
  --letter-spacing: 0em;
  --line-height-multiplier: 1.5;
}

html {
  font-family: var(--font-primary);
  scroll-behavior: smooth;
  font-size: calc(16px * var(--font-scale));
  letter-spacing: var(--letter-spacing);
  line-height: var(--line-height-multiplier);
}

h1, h2, h3, .font-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
}

/* Natural Soft Background Pattern */
body {
  background-color: #F8F9FA;
  background-image: 
    radial-gradient(at 100% 0%, rgba(194, 163, 116, 0.05) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(58, 105, 83, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
}

.dark body {
  background-color: #0F172A;
  background-image: 
    radial-gradient(at 100% 0%, rgba(194, 163, 116, 0.04) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(30, 41, 59, 0.4) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Glassmorphism & Soft Card Elevation */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .glass-panel {
  background: rgba(18, 28, 45, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.7);
  box-shadow: 0 4px 16px -2px rgba(17, 34, 57, 0.04), 0 2px 4px -1px rgba(17, 34, 57, 0.02);
  transition: all 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dark .glass-card {
  background: rgba(23, 35, 54, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.25);
}

.glass-card:hover {
  transform: translateY(-3px);
  border-color: rgba(194, 163, 116, 0.45);
  box-shadow: 0 16px 28px -6px rgba(17, 34, 57, 0.08), 0 6px 10px -2px rgba(17, 34, 57, 0.03);
}

.dark .glass-card:hover {
  border-color: rgba(194, 163, 116, 0.35);
  box-shadow: 0 16px 28px -6px rgba(0, 0, 0, 0.4);
}

/* Custom Scrollbar - Soft & Subtle */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #f1f4f8;
}

.dark ::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ========================================================
   ACCESSIBILITY MODES & OVERRIDES
   ======================================================== */

/* Top Government Header Gradient (Biru ke Orange Identitas Kampus) */
.top-header-gradient {
  background: linear-gradient(90deg, #0C1E38 0%, #1E40AF 48%, #EA580C 100%) !important;
}

/* 1. Dyslexia Friendly Mode */
body.dyslexia-font {
  font-family: var(--font-readable), 'Comic Sans MS', 'Trebuchet MS', sans-serif !important;
  letter-spacing: 0.08em !important;
  word-spacing: 0.15em !important;
}

body.dyslexia-font h1,
body.dyslexia-font h2,
body.dyslexia-font h3,
body.dyslexia-font h4,
body.dyslexia-font button,
body.dyslexia-font a,
body.dyslexia-font p,
body.dyslexia-font span {
  font-family: var(--font-readable), 'Comic Sans MS', 'Trebuchet MS', sans-serif !important;
}

/* 2. Highlight Links Mode */
body.highlight-links a,
body.highlight-links button {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 4px !important;
  outline: 2px solid #2563eb !important;
  background-color: rgba(254, 240, 138, 0.3) !important;
}

/* 3. High Contrast Dark Mode (Yellow on Black - High Visibility) */
body.contrast-yellow-black {
  background-color: #000000 !important;
  color: #ffea00 !important;
}

body.contrast-yellow-black * {
  background-color: #000000 !important;
  color: #ffea00 !important;
  border-color: #ffea00 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.contrast-yellow-black a,
body.contrast-yellow-black button {
  color: #00ffff !important;
  text-decoration: underline !important;
}

body.contrast-yellow-black .badge,
body.contrast-yellow-black [class*="bg-"] {
  border: 1px solid #ffea00 !important;
}

/* 4. High Contrast Black on White */
body.contrast-black-white {
  background-color: #ffffff !important;
  color: #000000 !important;
}

body.contrast-black-white * {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #000000 !important;
  box-shadow: none !important;
}

body.contrast-black-white a,
body.contrast-black-white button {
  color: #0000ee !important;
  text-decoration: underline !important;
}

/* 5. Grayscale / Monokrom Mode */
body.contrast-grayscale {
  filter: grayscale(100%) !important;
}

/* 6. Invert Mode */
body.contrast-invert {
  filter: invert(100%) hue-rotate(180deg) !important;
}

body.contrast-invert img,
body.contrast-invert video,
body.contrast-invert iframe {
  filter: invert(100%) hue-rotate(180deg) !important;
}

/* 6b. Sepia / Eye Care Reading Mode */
body.contrast-sepia {
  background-color: #fbf0d9 !important;
  color: #3b2f1e !important;
  filter: sepia(60%) contrast(92%) !important;
}

body.contrast-sepia * {
  background-color: transparent !important;
  color: #3b2f1e !important;
  border-color: #d1be9b !important;
}

body.contrast-sepia header,
body.contrast-sepia nav,
body.contrast-sepia footer,
body.contrast-sepia .card-system {
  background-color: #f4e8ce !important;
}

/* 7. Big Cursor Mode */
body.big-cursor,
body.big-cursor * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="%23112239" stroke="white" stroke-width="2"><path d="M4 4l7 18 3-7 7-3z"/></svg>'), auto !important;
}

/* 7b. Reading Guide Ruler (Garis Penuntun Baca Horizontal) */
#reading-guide-ruler {
  position: fixed;
  left: 0;
  width: 100vw;
  height: 6px;
  background-color: #0284c7;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 999999;
  display: none;
  transform: translateY(-50%);
  transition: top 0.04s ease-out;
}
body.reading-guide-active #reading-guide-ruler {
  display: block !important;
}

/* 7c. Reading Mask (Masker Baca / Fokus Baris) */
#reading-mask-top,
#reading-mask-bottom {
  position: fixed;
  left: 0;
  width: 100vw;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
  z-index: 999998;
  display: none;
  transition: height 0.04s ease-out, top 0.04s ease-out;
}
#reading-mask-top {
  top: 0;
}
body.reading-mask-active #reading-mask-top,
body.reading-mask-active #reading-mask-bottom {
  display: block !important;
}

/* 8. Reduced Motion & Stop Marquee */
body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
body.reduced-motion .ticker-content,
body.reduced-motion [class*="ticker"] {
  animation-play-state: paused !important;
}

/* 8b. Hide Images (Mode Teks Murni) */
body.hide-images img:not(.a11y-exempt),
body.hide-images picture,
body.hide-images [style*="background-image"]:not(.a11y-exempt) {
  opacity: 0.04 !important;
  filter: grayscale(100%) blur(2px) !important;
  pointer-events: none;
}

/* 8c. Text Align Modes */
body.align-left p, body.align-left h1, body.align-left h2, body.align-left h3, body.align-left h4, body.align-left span, body.align-left div {
  text-align: left !important;
}
body.align-center p, body.align-center h1, body.align-center h2, body.align-center h3, body.align-center h4, body.align-center span, body.align-center div {
  text-align: center !important;
}
body.align-right p, body.align-right h1, body.align-right h2, body.align-right h3, body.align-right h4, body.align-right span, body.align-right div {
  text-align: right !important;
}
body.align-justify p, body.align-justify h1, body.align-justify h2, body.align-justify h3, body.align-justify h4, body.align-justify span, body.align-justify div {
  text-align: justify !important;
}

/* 8d. Font Legible Serif Mode */
body.legible-serif,
body.legible-serif * {
  font-family: Georgia, 'Times New Roman', Cambria, serif !important;
}

/* 9. Text Spacing Variations */
body.spacing-medium {
  letter-spacing: 0.05em !important;
  word-spacing: 0.1em !important;
  line-height: 1.8 !important;
}

body.spacing-large {
  letter-spacing: 0.12em !important;
  word-spacing: 0.2em !important;
  line-height: 2.1 !important;
}

/* Focus styles for Keyboard Accessibility (WCAG 2.1 AA) */
*:focus-visible {
  outline: 2px solid #C2A374 !important;
  outline-offset: 3px !important;
  border-radius: 6px;
}

/* Pulse badge animation */
@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
}

.animate-pulse-dot {
  animation: pulse-dot 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Natural Hero Glow - Soft Ambient Light */
.hero-glow-natural {
  background: 
    radial-gradient(circle at 50% 0%, rgba(194, 163, 116, 0.16) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(58, 105, 83, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 90% 60%, rgba(37, 66, 107, 0.2) 0%, transparent 50%);
}

/* Hero White Dominant with Blue & Orange Accents (Putih Dominan, Biru, Orange) */
.hero-white-blue-orange {
  background-color: #FFFFFF;
  background-image: 
    radial-gradient(circle at 14% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 86% 24%, rgba(249, 115, 22, 0.09) 0%, transparent 48%),
    radial-gradient(circle at 50% 88%, rgba(14, 165, 233, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #FFFFFF 0%, #FAFCFF 48%, #F1F5F9 100%);
  position: relative;
}

.dark .hero-white-blue-orange {
  background-color: #0B1323;
  background-image: 
    radial-gradient(circle at 14% 20%, rgba(37, 99, 235, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 86% 24%, rgba(249, 115, 22, 0.14) 0%, transparent 48%),
    radial-gradient(circle at 50% 88%, rgba(14, 165, 233, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #0B1323 0%, #0F172A 60%, #131F33 100%);
}

.hero-white-blue-orange::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Hero Semangat & Soft (Inspiring Dawn, Warm Energy & Soft Horizon) */
.hero-semangat-soft {
  background: 
    radial-gradient(ellipse at 85% 20%, rgba(245, 158, 11, 0.24) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 85%, rgba(225, 112, 85, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 10%, rgba(99, 102, 241, 0.22) 0%, transparent 65%),
    linear-gradient(145deg, #0D1C33 0%, #163660 30%, #253960 60%, #3D334C 82%, #4C2D37 100%);
  position: relative;
}

.hero-semangat-soft::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Marquee / Ticker Animation (Batas Kiri Dibatasi) */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  overflow: hidden;
  position: relative;
  width: 100%;
  white-space: nowrap;
  /* Mask gradient agar teks menghilang secara halus di batas kiri dan kanan, tidak terpotong kasar */
  mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
}

.ticker-content {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: ticker 42s linear infinite;
  will-change: transform;
}

.ticker-content:hover {
  animation-play-state: paused;
}

@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Soft Floating Animation */
@keyframes softFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.animate-soft-float {
  animation: softFloat 4s ease-in-out infinite;
}

/* Read Aloud active highlight */
.tts-speaking {
  outline: 2px dashed #3A6953 !important;
  background-color: rgba(58, 105, 83, 0.08) !important;
}
