* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #1a1a1a;
  min-height: 100vh;
  color: #ffffff;
  animation: fadeIn 0.8s ease-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  animation: slideUp 0.8s ease-out;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.nav-btn {
  position: relative;
  padding: 16px 32px;
  background: #2a2a2a;
  color: #fff;
  border: 2px solid #3a3a3a;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.nav-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.page {
  display: none;
  background: #262626;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid #3a3a3a;
  animation: slideUp 0.6s ease-out;
}
.page.active {
  display: block;
}

.page h2 {
  color: #3b82f6;
  margin-bottom: 30px;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  position: relative;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #fff;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px;
  background: #1a1a1a;
  color: #fff;
  border: 2px solid #3a3a3a;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 15px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #1a1a1a;
  border: 2px solid #3a3a3a;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.checkbox-item:hover {
  border-color: #3b82f6;
  background: #2a2a2a;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}
.checkbox-item input[type="checkbox"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  accent-color: #3b82f6;
}

/*
 * Button glow system:
 * - Use --glow-rgb to hold the RGB components as "R,G,B" for the glow.
 * - Use --btn-bg for background if needed.
 * - All buttons keep the same box model and padding so toggling classes won't change size.
 */

/* Base button styles (always applied) */
.btn {
  --glow-rgb: 59, 130, 246; /* default (blue) */
  --btn-bg: #3b82f6;
  position: relative;
  padding: 14px 28px;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.12s ease, background 0.12s ease;
  margin-right: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--btn-bg);
  /* two-layer glow: soft outer + stronger spread */
  box-shadow: 0 10px 22px rgba(var(--glow-rgb), 0.16),
    0 0 40px rgba(var(--glow-rgb), 0.06);
  display: inline-block;
  text-decoration: none;
  text-align: center;
  line-height: 1;
}

/* Hover/active effects for enabled state — same glow color, higher intensity */
.btn:not(.disabled):hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 30px rgba(var(--glow-rgb), 0.36),
    0 0 70px rgba(var(--glow-rgb), 0.14);
}
.btn:not(.disabled):active {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 22px rgba(var(--glow-rgb), 0.28),
    0 0 48px rgba(var(--glow-rgb), 0.1);
}

/* Disabled variant keeps exact same padding/box model but with different colors and subtler glow */
.btn.disabled {
  --glow-rgb: 239, 68, 68; /* red glow */
  --btn-bg: #ef4444;
  box-shadow: 0 8px 18px rgba(var(--glow-rgb), 0.14),
    0 0 36px rgba(var(--glow-rgb), 0.06);
  transform: none;
  cursor: not-allowed;
}
/* Prevent pointer transforms on disabled */
.btn.disabled:hover {
  transform: none;
}

/* Secondary (green) button */
.btn.btn-secondary,
.btn-secondary {
  --glow-rgb: 16, 185, 129; /* green glow */
  --btn-bg: #10b981;
  background: var(--btn-bg);
  box-shadow: 0 10px 22px rgba(var(--glow-rgb), 0.16),
    0 0 40px rgba(var(--glow-rgb), 0.06);
}
.btn.btn-secondary:not(.disabled):hover,
.btn-secondary:not(.disabled):hover {
  box-shadow: 0 14px 30px rgba(var(--glow-rgb), 0.36),
    0 0 70px rgba(var(--glow-rgb), 0.14);
  transform: translateY(-3px) scale(1.02);
}

/* Override hover effects for summary buttons specifically */
.summary-button-container .btn.btn-secondary:not(.disabled):hover {
  transform: none;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

/* Custom deployment input styling */
#custom-deployment {
  display: none;
  margin-top: 10px;
  width: 100%;
  padding: 14px;
  background: #1a1a1a;
  color: #fff;
  border: 2px solid #3a3a3a;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#custom-deployment:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
  transform: translateY(-1px);
}

#custom-deployment.visible {
  display: block;
}

/* Remove-officer button (red) */
.btn.btn-remove {
  --glow-rgb: 239, 68, 68;
  --btn-bg: #ef4444;
  background: var(--btn-bg);
  box-shadow: 0 10px 22px rgba(var(--glow-rgb), 0.16),
    0 0 40px rgba(var(--glow-rgb), 0.06);
}
.btn.btn-remove:not(.disabled):hover {
  box-shadow: 0 14px 30px rgba(var(--glow-rgb), 0.36),
    0 0 70px rgba(var(--glow-rgb), 0.14);
  transform: translateY(-3px) scale(1.02);
}

.btn-small {
  padding: 10px 20px;
  font-size: 14px;
}

/* Ensure anchors using btn classes look and behave like buttons */
.external-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.output {
  margin-top: 30px;
  padding: 24px;
  background: #1a1a1a;
  border-radius: 12px;
  border: 2px solid #3a3a3a;
  animation: slideUp 0.5s ease-out;
}
.output textarea {
  width: 100%;
  height: 320px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 14px;
  border: none;
  background: transparent;
  color: #fff;
  resize: vertical;
  line-height: 1.5;
}

.stats {
  background: #3b82f6;
  color: white;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25);
  animation: slideUp 0.7s ease-out;
}
.monthly-hours {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.month-stat {
  background: rgba(255, 255, 255, 0.12);
  padding: 12px;
  border-radius: 8px;
  text-align: left;
  backdrop-filter: blur(6px);
  transition: transform 0.2s ease;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.month-stat:hover {
  transform: translateY(-2px);
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.month-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.caret {
  width: 14px;
  height: 14px;
  display: inline-block;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}
.caret.collapsed {
  transform: rotate(0deg);
}

.icon-shrink {
  flex-shrink: 0;
}

.month-flights {
  margin-top: 8px;
  max-height: 400px;
  overflow: auto;
  opacity: 1;
  transition: all 0.25s ease;
}

.month-flights.collapsed {
  display: none;
  opacity: 0;
}

.month-stats-summary {
  margin-bottom: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.summary-button-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  box-sizing: border-box;
  /* Contain the button's hover effects */
  overflow: hidden;
}

.summary-button-container .btn {
  margin: 0;
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
  transform: none;
}

/* Override default button hover effects */
.summary-button-container .btn:hover {
  transform: none;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.summary-button-container .btn:not(.disabled):hover {
  transform: none;
}

/* Ensure the button is hidden when the section is collapsed */
.month-flights.collapsed .summary-button-container {
  display: none;
}

.month-title {
  font-weight: 700;
}
.month-total {
  font-weight: 700;
}

.month-flights {
  margin-top: 8px;
  max-height: 400px;
  overflow: auto;
  transition: max-height 0.25s ease;
}

.flight-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  margin-bottom: 8px;
  font-size: 13px;
}
.flight-remove-btn {
  background: transparent;
  border: none;
  color: #ffdddd;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.crew-member {
  margin-bottom: 10px;
  padding: 8px;
  background: #1a1a1a;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

@media (max-width: 768px) {
  .inline-group {
    flex-direction: column;
    gap: 10px;
  }
  .checkbox-group {
    grid-template-columns: 1fr;
  }
  .nav-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
  .page {
    padding: 25px;
  }
}

.form-group #ot-flightlog-link + .btn {
  margin-top: 12px;
}

/* Personnel Setup Styles */
.personnel-setup {
  background: rgba(255, 0, 0, 0.1);
  border: 2px solid rgba(255, 0, 0, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
}

.personnel-setup h3 {
  color: #ff6b6b;
  margin-bottom: 10px;
}

.setup-notice {
  color: #ff8585;
  margin-bottom: 15px;
  font-size: 0.95em;
}

.personnel-input-group {
  display: flex;
  gap: 15px;
  align-items: center;
}

.personnel-input-group input[type="url"] {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid rgba(255, 0, 0, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: white;
  font-size: 16px;
  transition: all 0.3s ease;
}

.personnel-input-group input[type="url"]:focus {
  border-color: rgba(255, 0, 0, 0.5);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.1);
}

.personnel-input-group .btn {
  white-space: nowrap;
  padding: 12px 24px;
}
