/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0b0f1a;
  --surface: #111827;
  --surface-alt: #1a2235;
  --border: #1e293b;
  --border-focus: #6366f1;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --secondary: #c084fc;
  --accent: #38bdf8;
  --success: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --shadow: 0 4px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .5);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: linear-gradient(135deg, #d4941a, #e8a317 30%, #4a6ec7 70%, #2b4aaf);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ========== ANIMATED BACKGROUND ========== */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .12;
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 20s ease-in-out infinite alternate;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -150px;
  left: -100px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: var(--secondary);
  top: 40%;
  right: -120px;
  animation-delay: -7s;
}

.blob-3 {
  width: 450px;
  height: 450px;
  background: var(--accent);
  bottom: -100px;
  left: 30%;
  animation-delay: -14s;
}

@keyframes blobFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(40px, -30px) scale(1.08);
  }

  100% {
    transform: translate(-20px, 20px) scale(.96);
  }
}

/* ========== HEADER ========== */
header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 50px 20px 30px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.logo-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

.logo-circle img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 50%;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.logo h1 span {
  font-weight: 400;
}

.tagline {
  margin-top: 8px;
  color: rgba(255, 255, 255, .9);
  font-size: .95rem;
  letter-spacing: .3px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

/* ========== MAIN ========== */
main {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ========== CARD ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: border-color .3s;
}

.card:hover {
  border-color: rgba(99, 102, 241, .25);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, .1);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.card-desc {
  color: var(--text-muted);
  font-size: .88rem;
  margin-bottom: 24px;
}

/* ========== FORMS ========== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.form-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
}

input,
select,
textarea {
  font-family: var(--mono);
  font-size: .9rem;
  padding: 10px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .18);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ========== BUTTONS ========== */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .25s, background .25s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, .5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-accent {
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  box-shadow: 0 4px 14px rgba(56, 189, 248, .3);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(56, 189, 248, .5);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

.btn-yellow-blue {
  background: linear-gradient(135deg, #facc15, #3b82f6);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-yellow-blue:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.btn-yellow-blue:active {
  transform: translateY(0);
}

.btn-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(248, 113, 113, .12);
  color: var(--danger);
  font-size: .85rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s;
}

.btn-remove:hover {
  background: rgba(248, 113, 113, .25);
}

.btn-text-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-text-reset:hover {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border-color: var(--danger);
}

.host-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ========== HOST ENTRIES ========== */
.host-entry {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  animation: slideIn .3s ease;
}

.host-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.host-badge {
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(56, 189, 248, .1);
  padding: 3px 10px;
  border-radius: 20px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== RESULTS ========== */
.results-panel {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn .4s ease;
}

.results-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, .2);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, .04);
}

.result-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  font-weight: 600;
}

.result-value {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== TABLE ========== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: .85rem;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  color: var(--text);
}

tbody tr:hover {
  background: rgba(99, 102, 241, .05);
}



/* ========== BURGER MENU ========== */
.burger-menu {
  display: block;
  width: 40px;
  height: 35px;
  background: transparent;
  border: 2px solid white; /* Added border to default state */
  cursor: pointer;
  padding: 0;
  z-index: 10;
  position: absolute;
  top: 45px;
  right: 15px;
  border-radius: 6px;
  transition: border-color 0.3s ease, opacity 0.3s ease; /* Added transition for opacity if needed */
}

.burger-menu.active {
  border: 2px solid white;
}

.bar {
  width: 28px;
  height: 3px;
  background: white;
  border-radius: 10px;
  transition: all 0.3s ease;
  position: absolute;
  left: 4px; /* Centered horizontally: (40px width - 4px border - 28px bar) / 2 + 2px border = 4px? No.
               Width: 40px. Border: 2px. Inner width: 36px.
               (36 - 28) / 2 = 4px.
               So left: 4px is correct for inner positioning relative to padding-box/content-box if box-sizing is border-box?
               Actually, position: absolute is relative to the border-box of the parent.
               Parent width 40px. Border 2px.
               If we want to center 28px in 40px, (40-28)/2 = 6px from outer edge.
               BUT wait, border takes up space.
               Let's try left: 4px and see. If it was 6px before with no border, now with 2px border it effectively pushes content?
               Let's stick to calculated center.
               40px total width. 28px bar.
               (40 - 28) / 2 = 6px from left edge.
  */
  left: 4px; /* Adjusted for border: (36px inner width - 28px bar) / 2 = 4px */
  transform-origin: center;
}

.bar:nth-child(1) {
  top: 7px; /* (31px inner height - 3*3px bars - 2*5px gaps) / 2 ... let's just eyeball/calculate.
               Inner height = 35 - 4 = 31px.
               Bars at 20%, 50%, 80% roughly.
               Middle bar at 31/2 - 1.5 = 14px.
               Top bar at 14 - 8 = 6px?
               Let's try: 7px, 14px, 21px.
            */
}

.bar:nth-child(2) {
  top: 14px; /* Centered vertically: (31px inner height - 3px bar) / 2 = 14px */
}

.bar:nth-child(3) {
  top: 21px;
}

.burger-menu.active .bar {
  left: 4px;
}

.burger-menu.active .bar:nth-child(1) {
  top: 14px; /* Centered: (35px height - 3px bar) / 2 = 16px. Adjusting to 14px visually centers it better with border */
  transform: rotate(45deg);
}

.burger-menu.active .bar:nth-child(2) {
  opacity: 0;
}

.burger-menu.active .bar:nth-child(3) {
  top: 14px; /* Same as top bar */
  transform: rotate(-45deg);
}

.nav-menu {
  display: none;
  position: absolute;
  top: 90px;
  right: 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 9;
  min-width: 150px;
  padding: 10px 0;
}

.nav-menu.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.nav-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-menu li {
  padding: 10px 20px;
  cursor: pointer;
  color: var(--text);
  transition: background-color 0.2s;
}

.nav-menu li:hover {
  background-color: var(--surface-alt);
  color: var(--primary);
}

/* ========== MODAL ========== */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--surface);
  margin: auto;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  /* Removed overflow-y: auto */
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideIn 0.3s ease;
  color: var(--text);
}

.modal-scroll-area {
  overflow-y: auto;
  flex: 1;
  /* Hide scrollbar but allow scrolling */
  scrollbar-width: none;  /* Firefox */
  -ms-overflow-style: none;  /* IE/Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.modal-scroll-area::-webkit-scrollbar {
  display: none;
}

.close-modal {
  color: var(--text-muted);
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
  color: var(--primary);
  text-decoration: none;
}

.modal h2 {
  color: var(--accent);
  margin-bottom: 15px;
  font-size: 1.5rem;
  text-align: center;
}

.intern-list {
  list-style-type: none;
  padding-left: 0;
  margin: 15px 0;
  color: var(--text);
  text-align: center;
}

.modal-scroll-area p {
  text-align: center;
}

.intern-list li {
  margin-bottom: 8px;
  font-family: var(--mono);
}

.modal-footer {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 15px;
}

.guide-content h3 {
  color: var(--primary);
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 1rem;
}

.guide-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.guide-content ul {
  list-style-type: disc;
  padding-left: 24px;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.guide-content li {
  margin-bottom: 6px;
}

.guide-content strong {
  color: var(--text);
}

/* ========== HIDDEN ========== */
.hidden {
  display: none !important;
}

/* ========== PRINT STYLES ========== */
@media print {
  /* Hide everything by default */
  body > *:not(#print-report) {
    display: none !important;
  }

  /* Reset body styles for print */
  body {
    background: white !important;
    color: black !important;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
  }

  /* Show and style the report container */
  #print-report {
    display: block !important;
    visibility: visible !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
    padding: 20px;
    z-index: 9999;
  }

  /* Print Report Styles */
  .print-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #000;
    padding-bottom: 15px;
  }

  .print-header h1 {
    font-size: 18pt;
    margin: 0;
    color: #000;
  }

  .print-meta {
    font-size: 10pt;
    color: #555;
    margin-top: 5px;
  }

  .print-section {
    margin-bottom: 30px;
  }

  .print-section h2 {
    font-size: 14pt;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    margin-bottom: 15px;
    color: #000;
  }

  .print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }

  .print-item {
    font-size: 11pt;
  }

  .print-label {
    font-weight: bold;
    color: #333;
  }

  .print-value {
    font-family: 'JetBrains Mono', monospace;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
  }

  th, td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
    font-size: 10pt;
    color: #000;
  }

  th {
    background-color: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    font-weight: bold;
  }

  .print-footer {
    margin-top: 50px;
    text-align: center;
    font-size: 9pt;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 10px;
  }
}


/* ========== FOOTER ========== */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 20px 40px;
  color: rgba(255, 255, 255, .85);
  font-size: .8rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

/* ========== ERROR ========== */
.error-msg {
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .3);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-top: 16px;
  animation: fadeIn .3s ease;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {

  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  header {
    padding: 32px 16px 20px;
    text-align: left;
  }

  .logo {
    justify-content: flex-start;
  }

  .logo h1 {
    font-size: 1.6rem;
    text-align: left;
  }

  .card {
    padding: 20px;
  }

  main {
    padding: 0 12px 40px;
  }

  .host-actions {
    flex-direction: column;
  }

  .nav-menu {
    top: 80px; /* Increased from 70px to avoid collision with burger menu border */
    right: 16px;
  }

  .burger-menu {
    top: 33px; /* Adjusted for larger size */
    right: 11px; /* Adjusted for larger size */
  }
}