@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-main: #ffffff;
  --bg-alt: #f7f7f9;
  --border-color: #e2e2e6;
  --border-color-dark: #111111;
  --text-primary: #111111;
  --text-secondary: #55555a;
  --text-muted: #71717a;
  --accent-color: #111111;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: all 0.2s ease;
  --transition-medium: all 0.4s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 130px; /* Offset for sticky header and TOC */
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 60px;
}

/* Screen Transitions */
.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* Landing Countdown Screen */
#landing-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1000;
  background: radial-gradient(circle at center, #10101a 0%, #030305 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: opacity 0.6s ease;
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.countdown-card {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--border-color-dark);
  border-radius: 16px;
  padding: 40px 30px;
  width: 90%;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
}

.countdown-card .logo-container img {
  max-height: 50px;
  margin-bottom: 12px;
}

.countdown-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.countdown-card .subtitle {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Countdown Grid */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 30px;
}

.countdown-item {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.countdown-unit {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.btn-enter {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.05rem;
  border-radius: 10px;
  background: var(--accent-color);
  color: #ffffff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-enter:hover {
  background: #25252b;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Main Operations Portal Screen */
#portal-screen {
  opacity: 1;
  transition: opacity 0.6s ease;
}

/* Container */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* Header & Official Banner */
header {
  text-align: left;
  border-bottom: 2px solid var(--border-color-dark);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.logo-container {
  margin-bottom: 12px;
}

.logo-container img {
  max-height: 44px;
  width: auto;
}

h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Sticky Table of Contents (TOC) */
.toc-nav {
  position: sticky;
  top: 0;
  background: var(--bg-main);
  z-index: 100;
  border-bottom: 2px solid var(--border-color-dark);
  padding: 10px 0;
  display: flex;
  overflow-x: auto;
  gap: 6px;
  margin-bottom: 24px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.toc-nav::-webkit-scrollbar {
  display: none;
}

.toc-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.toc-btn:hover {
  background: var(--bg-main);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.toc-btn.active {
  background: var(--border-color-dark);
  color: var(--bg-main);
  border-color: var(--border-color-dark);
}

/* Vertical Sections Styling */
.portal-section {
  padding-top: 10px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.portal-section h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  border-left: 4px solid var(--border-color-dark);
  padding-left: 12px;
}

/* Cards & Content blocks */
.glass-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Urgent Info Banner */
.urgent-banner {
  background: var(--bg-alt);
  border: 2px solid var(--border-color-dark);
  border-radius: 12px;
}

.urgent-banner h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-left: none;
  padding-left: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 580px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-btn {
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.contact-btn:hover {
  background: var(--bg-alt);
  border-color: var(--border-color-dark);
}

.contact-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.contact-number {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}

/* Flat Briefing Cards */
.briefing-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 20px;
}

.briefing-card h3 {
  font-size: 1.1rem;
  font-weight: 750;
  color: var(--text-primary);
  margin-bottom: 12px;
  border-left: 3px solid var(--border-color-dark);
  padding-left: 10px;
}

.briefing-card p, .briefing-card ul, .briefing-card ol {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}


/* Data Tables with Desktop Layout */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  border: none;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

th {
  background: var(--bg-alt);
  font-weight: 700;
  color: var(--text-primary);
}

/* Premium Mobile Squeeze-to-Fit Fluid Tables */
@media (max-width: 600px) {
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 10px 0;
  }

  table {
    font-size: 0.74rem; /* Compact yet readable sans-serif */
    letter-spacing: -0.2px;
    width: 100%;
  }

  th, td {
    padding: 6px 4px; /* Highly optimized micro-padding */
    white-space: normal; /* Force natural word wrapping instead of overflow */
    word-break: break-word; /* Wrap long phone numbers or emails gracefully */
  }

  th {
    font-weight: 750;
  }

  /* Specific micro-optimizations for various columns */
  td:first-child, th:first-child {
    padding-left: 6px;
  }

  td:last-child, th:last-child {
    padding-right: 6px;
  }
  
  /* Safe fallback scrollbar styling if a custom system displays extremely small */
  .table-wrapper::-webkit-scrollbar {
    height: 4px;
  }
  
  .table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
  }
  
  .table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
  }
}


/* Badge Warnings and Alert Highlights */
.badge-urgent {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-info {
  display: inline-block;
  background: var(--bg-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-color-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* List Details */
ul, ol {
  padding-left: 20px;
  margin: 10px 0;
}

li {
  margin-bottom: 6px;
}

/* Map Viewer */
.map-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.map-container {
  width: 100%;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #fdfdfd;
}

.map-container img {
  width: 100%;
  height: auto;
  display: block;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--border-color-dark);
  color: var(--bg-main);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-primary:hover {
  background: var(--text-secondary);
}

/* Interactive Contingent Search */
.search-input {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  margin-bottom: 12px;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--border-color-dark);
  background: var(--bg-main);
}

.contingents-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  background: var(--bg-main);
}

.contingent-item {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
}

.contingent-item:hover {
  background: var(--bg-alt);
}

.contingent-item:nth-child(even) {
  background: var(--bg-alt);
}

/* Footer note */
.footer-note {
  text-align: center;
  margin-top: 40px;
  margin-bottom: 50px; /* buffer for bottom bar */
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Floating Bottom Status Bar */
.bottom-status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 52px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 2px solid var(--border-color-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.04);
}

.status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  animation: pulse-green 1.8s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.status-center {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  max-width: 40%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-tools {
  background: var(--border-color-dark);
  color: var(--bg-main);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-tools:hover {
  background: var(--text-secondary);
}

/* Briefing Assistant Drawer */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1005;
  transition: opacity 0.3s ease;
}

.tools-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid var(--border-color-dark);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1010;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.tools-drawer.drawer-closed {
  transform: translate(-50%, 100%);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 2px solid var(--border-color-dark);
}

.drawer-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.btn-close-drawer {
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 4px;
}

.btn-close-drawer:hover {
  color: var(--text-primary);
}

.drawer-content {
  padding: 16px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Feedback Form Styles */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-group-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.required-star {
  color: #ef4444;
}

.optional-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
}

.feedback-form input[type="text"],
.feedback-form input[type="email"],
.feedback-form textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border-color-dark);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.feedback-form input[type="text"]:focus,
.feedback-form input[type="email"]:focus,
.feedback-form textarea:focus {
  border-color: var(--text-primary);
  background: var(--bg-main);
  box-shadow: 0 0 0 1px var(--text-primary);
}

.feedback-form textarea {
  height: 100px;
  resize: none;
}

.btn-submit-feedback {
  background: var(--border-color-dark);
  color: var(--bg-main);
  border: none;
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
}

.btn-submit-feedback:hover {
  background: var(--text-primary);
}

.btn-submit-feedback:disabled {
  background: var(--border-color);
  color: var(--text-muted);
  cursor: not-allowed;
}

.fb-status-msg {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  transition: var(--transition-fast);
}

.fb-status-msg.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.fb-status-msg.error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* Interactive Map Tabs Styling */
.map-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.map-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.map-tab-btn {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.map-tab-btn:hover {
  background: var(--bg-main);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.map-tab-btn.active {
  background: var(--border-color-dark);
  color: var(--bg-main);
  border-color: var(--border-color-dark);
}

.hidden-map {
  display: none !important;
}

/* Parade Maps Grid Styling */
.parade-maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.parade-map-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  transition: var(--transition-fast);
}

.parade-map-card:hover {
  border-color: var(--border-color-dark);
}

.parade-map-title {
  font-size: 0.85rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  color: var(--text-primary);
}
