/**
 * Kalender Worgita - Tactical Military Design System
 * Yonif TP 815 / Kodam XVII Cenderawasih
 */

:root {
  color-scheme: dark;
  --bg: #080a08;
  --bg-main: #080a08;
  --bg-surface: rgba(15, 23, 17, 0.75);
  --bg-card: rgba(22, 36, 27, 0.55);
  --bg-card-hover: rgba(30, 51, 38, 0.7);
  --border-tactical: rgba(255, 255, 255, 0.12);
  --border-tactical-focus: rgba(212, 175, 55, 0.5);
  
  --line: rgba(255, 255, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.13);
  --glass-army: rgba(29, 66, 42, 0.28);
  --accent: #c9ced6;

  --camo-green-dark: #0d2115;
  --camo-green-mid: #1d422a;
  --camo-green-bright: #2f6b43;
  --camo-green-light: #48a065;
  
  --gold-commando: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.28);
  --gold-dark: #9e8020;
  
  --red-siaga: #e53e3e;
  --amber-prioritas: #dd6b20;
  --blue-intel: #3182ce;
  --purple-tradisi: #805ad5;

  --text-primary: #f0fdf4;
  --text-secondary: #a3b899;
  --text-muted: #88988a;
  --text-gold: #f6e05e;

  --font-tactical: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-tactical);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Background: Dark Cracked Shards that drift slowly */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg svg {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
  to {
    transform: translate(-2%, 2%) scale(1.04);
  }
}

/* Pure Minimalist Glass Panel */
.glass-panel, .glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  border-radius: 20px;
}

/* Diagonal Sheen Animation Ray */
.card-sheen {
  position: relative;
  overflow: hidden;
}
.card-sheen::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 60%;
  width: 140px;
  transform: skewX(-8deg);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .08), transparent);
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen {
  0%, 100% { left: 55%; }
  50% { left: 30%; }
}

/* Capsule Glass Button */
.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 22px;
  background: linear-gradient(180deg, var(--glass-2), var(--glass));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .2s, background .3s, box-shadow .3s;
  text-decoration: none;
}
.glass-btn:hover {
  background: var(--glass-2);
  box-shadow: 0 0 24px rgba(212, 175, 55, .25), inset 0 1px 0 rgba(255, 255, 255, .3);
  color: #fff;
}
.glass-btn:active {
  transform: scale(.97);
}

.glass-btn.gold {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.15));
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--text-gold);
}
.glass-btn.gold:hover {
  background: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Sleek Bottom-Bordered Glass Input Field */
.glass-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 11px 4px;
  margin-bottom: 12px;
  transition: border-color .3s, box-shadow .3s;
}
.glass-field:focus-within {
  border-color: var(--gold-commando);
  box-shadow: 0 1px 0 0 var(--gold-commando);
}
.glass-field svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 1.8;
  transition: stroke .3s;
}
.glass-field:focus-within svg {
  stroke: var(--gold-commando);
}
.glass-field input, .glass-field select {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}
.glass-field input::placeholder {
  color: var(--text-muted);
}

/* Glass Tag */
.glass-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text-secondary);
}

/* Sliding Dual-Pane Glass Auth Card */
.auth-sliding-card {
  position: relative;
  width: min(880px, 100%);
  min-height: 460px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03));
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.auth-sliding-card .form-box {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  padding: 0 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: opacity .5s ease, transform .7s cubic-bezier(.77,0,.18,1);
}
.auth-sliding-card #auth-roles {
  right: 0;
}
.auth-sliding-card #auth-login {
  left: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
}
.auth-sliding-card.show-login #auth-roles {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-30px);
}
.auth-sliding-card.show-login #auth-login {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.auth-sliding-card .overlay-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  padding: 0 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform .7s cubic-bezier(.77,0,.18,1);
  z-index: 2;
  background: linear-gradient(135deg, rgba(17, 34, 23, 0.85), rgba(10, 20, 14, 0.95));
  border-right: 1px solid var(--line);
}
.auth-sliding-card.show-login .overlay-panel {
  transform: translateX(100%);
  border-right: none;
  border-left: 1px solid var(--line);
}
.auth-sliding-card .ov {
  transition: opacity .35s ease;
}
.auth-sliding-card .ov.b {
  position: absolute;
  left: 44px;
  right: 44px;
  opacity: 0;
  pointer-events: none;
}
.auth-sliding-card.show-login .ov.a {
  opacity: 0;
  pointer-events: none;
}
.auth-sliding-card.show-login .ov.b {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 768px) {
  .auth-sliding-card {
    height: auto;
    min-height: 480px;
  }
  .auth-sliding-card .overlay-panel {
    display: none;
  }
  .auth-sliding-card .form-box {
    position: relative;
    width: 100%;
    padding: 32px 24px;
    display: none;
    opacity: 1;
    transform: none;
  }
  .auth-sliding-card:not(.show-login) #auth-roles {
    display: flex;
  }
  .auth-sliding-card.show-login #auth-login {
    display: flex;
    opacity: 1;
  }
}

/* Scrollbar Taktis */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-tactical);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--camo-green-bright);
}

/* Container Taktis */
.tactical-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
}

@media (min-width: 768px) {
  .tactical-container {
    padding: 0.5rem 1.25rem;
  }
}

/* Header Komando */
.military-header {
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(17, 26, 20, 0.95) 100%);
  border-bottom: 2px solid var(--border-tactical);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.badge-unit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-commando);
  color: var(--gold-commando);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.radar-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #48bb78;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(72, 187, 120, 0.7);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(72, 187, 120, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
  }
}

/* Card Taktis */
.tactical-card {
  background: var(--bg-card);
  border: 1px solid var(--border-tactical);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.tactical-card:hover {
  border-color: var(--border-tactical-focus);
}

/* Tombol Taktis */
.btn-tactical {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-tactical-gold {
  background: linear-gradient(135deg, var(--gold-commando) 0%, #b89224 100%);
  color: #0b130e;
  border-color: #e5c158;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.btn-tactical-gold:hover {
  background: linear-gradient(135deg, #e5c158 0%, var(--gold-commando) 100%);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
  transform: translateY(-1px);
}

.btn-tactical-green {
  background: var(--camo-green-mid);
  color: var(--text-primary);
  border-color: var(--camo-green-bright);
}

.btn-tactical-green:hover {
  background: var(--camo-green-bright);
  border-color: var(--camo-green-light);
}

.btn-tactical-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-tactical);
}

.btn-tactical-outline:hover {
  background: rgba(29, 66, 42, 0.3);
  color: var(--text-primary);
  border-color: var(--border-tactical-focus);
}

.btn-tactical-danger {
  background: rgba(229, 62, 62, 0.2);
  color: #feb2b2;
  border-color: #e53e3e;
}

.btn-tactical-danger:hover {
  background: #e53e3e;
  color: #fff;
}

/* Kategori Militer Badges */
.badge-category {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-HUT_TRADISI {
  background: rgba(212, 175, 55, 0.15);
  color: #f6e05e;
  border: 1px solid rgba(212, 175, 55, 0.4);
}
.badge-OPERASI_PAMTAS {
  background: rgba(229, 62, 62, 0.15);
  color: #feb2b2;
  border: 1px solid rgba(229, 62, 62, 0.4);
}
.badge-LATIHAN {
  background: rgba(49, 130, 206, 0.15);
  color: #bee3f8;
  border: 1px solid rgba(49, 130, 206, 0.4);
}
.badge-TERITORIAL {
  background: rgba(72, 187, 120, 0.15);
  color: #9ae6b4;
  border: 1px solid rgba(72, 187, 120, 0.4);
}
.badge-DINAS_DALAM {
  background: rgba(221, 107, 32, 0.15);
  color: #fbd38d;
  border: 1px solid rgba(221, 107, 32, 0.4);
}
.badge-APEL_UPACARA {
  background: rgba(128, 90, 213, 0.15);
  color: #d6bcfa;
  border: 1px solid rgba(128, 90, 213, 0.4);
}
.badge-ADMINISTRASI {
  background: rgba(160, 174, 192, 0.15);
  color: #e2e8f0;
  border: 1px solid rgba(160, 174, 192, 0.4);
}

/* Prioritas Badges */
.badge-priority-TINGGI {
  color: #fc8181;
}
.badge-priority-SEDANG {
  color: #f6ad55;
}
.badge-priority-RUTIN {
  color: #68d391;
}

/* Grid Kalender Bulanan */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.calendar-day-header {
  text-align: center;
  padding: 0.45rem 0.25rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e2e8f0;
  background: rgba(22, 36, 27, 0.85);
  border: 1px solid var(--border-tactical);
  border-radius: 4px;
}

.calendar-day-header.is-sunday {
  color: #ff8787 !important;
  background: rgba(229, 62, 62, 0.28) !important;
  border-color: rgba(229, 62, 62, 0.55) !important;
  font-weight: 800;
}

.form-select-tactical {
  background: rgba(22, 36, 27, 0.85);
  border: 1px solid var(--border-tactical);
  color: #fff;
  border-radius: 6px;
  font-family: var(--font-tactical);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.form-select-tactical:focus, .form-select-tactical:hover {
  border-color: var(--gold-commando);
  box-shadow: 0 0 8px var(--gold-glow);
}

.form-select-tactical option {
  background: #0f1711;
  color: #fff;
  padding: 6px;
}

/* Night Vision Tactical Mode (Mode Pos Jaga Malam) */
body.night-vision {
  --bg: #050202 !important;
  --bg-main: #050202 !important;
  --bg-surface: rgba(20, 5, 5, 0.92) !important;
  --bg-card: rgba(35, 8, 8, 0.7) !important;
  --bg-card-hover: rgba(55, 12, 12, 0.85) !important;
  --border-tactical: rgba(255, 50, 50, 0.28) !important;
  --border-tactical-focus: #ff3333 !important;
  --gold-commando: #ff4d4d !important;
  --gold-glow: rgba(255, 50, 50, 0.45) !important;
  --text-primary: #ffebeb !important;
  --text-secondary: #ff9999 !important;
  --text-gold: #ff6666 !important;
}

body.night-vision .bg svg g {
  stroke: rgba(255, 50, 50, 0.18) !important;
}

body.night-vision .radar-pulse {
  background-color: #ff3333 !important;
  box-shadow: 0 0 8px #ff3333 !important;
}

.calendar-day-cell {
  min-height: 95px;
  background: var(--bg-card);
  border: 1px solid var(--border-tactical);
  border-radius: 6px;
  padding: 0.35rem;
  position: relative;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.calendar-day-cell:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-tactical-focus);
}

.calendar-day-cell.is-sunday {
  background: rgba(229, 62, 62, 0.18) !important;
  border-color: rgba(229, 62, 62, 0.35) !important;
}

.calendar-day-cell.is-sunday:hover {
  background: rgba(229, 62, 62, 0.28) !important;
  border-color: rgba(229, 62, 62, 0.55) !important;
}

.calendar-day-cell.is-sunday .day-number-badge {
  color: #ff8787 !important;
  font-weight: 800;
  background: rgba(229, 62, 62, 0.25);
  border-radius: 4px;
}

.calendar-day-cell.other-month {
  opacity: 0.4;
  background: rgba(17, 26, 20, 0.5);
}

.calendar-day-cell.is-sunday.other-month {
  background: rgba(229, 62, 62, 0.08) !important;
  opacity: 0.65;
}

.calendar-day-cell.is-today {
  border: 2px solid var(--gold-commando);
  box-shadow: 0 0 12px var(--gold-glow);
}

.calendar-day-cell.is-sunday.is-today {
  border: 2px solid #fc8181 !important;
  box-shadow: 0 0 16px rgba(229, 62, 62, 0.6) !important;
}

.calendar-day-cell.is-sunday.is-today .day-number-badge {
  background: #e53e3e !important;
  color: #ffffff !important;
}

.day-number-badge {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-mono);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.calendar-day-cell.is-today .day-number-badge {
  background: var(--gold-commando);
  color: #0b130e;
}

.day-events-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  max-height: 80px;
}

.event-pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.2;
  font-weight: 500;
  transition: transform 0.1s;
}

.event-pill:hover {
  transform: translateX(2px);
  filter: brightness(1.2);
}

/* Modal Backdrop & Window */
.tactical-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.tactical-modal {
  background: var(--bg-surface);
  border: 2px solid var(--border-tactical-focus);
  border-radius: 10px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(47, 107, 67, 0.2);
}

.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-tactical);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 33, 21, 0.5);
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-tactical);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(13, 33, 21, 0.3);
}

/* Form Inputs */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-tactical);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-commando);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* Navigasi Mobile Bawah */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-tactical);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0.25rem;
  z-index: 30;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

/* Cetak / Print Styles */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    background-image: none !important;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .tactical-modal-backdrop {
    position: static;
    background: none;
    padding: 0;
  }
  .tactical-modal {
    border: none;
    box-shadow: none;
    max-width: 100%;
    max-height: none;
  }
}

.print-only {
  display: none;
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#btn-toggle-alarm:hover {
  border-color: var(--gold-commando);
  transform: translateY(-1px);
}


