/* CS & Tech Internships – UW Oshkosh (load after Pico.css) */

:root {
  --block-spacing: 1rem;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

/* RGB Halo Animation - Enhanced for visibility */
@keyframes rgbHalo {
  0% {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6),
                0 0 30px rgba(255, 0, 0, 0.4),
                0 0 45px rgba(255, 0, 0, 0.3),
                inset 0 0 15px rgba(255, 0, 0, 0.1);
  }
  33% {
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6),
                0 0 30px rgba(0, 255, 0, 0.4),
                0 0 45px rgba(0, 255, 0, 0.3),
                inset 0 0 15px rgba(0, 255, 0, 0.1);
  }
  66% {
    box-shadow: 0 0 15px rgba(0, 0, 255, 0.6),
                0 0 30px rgba(0, 0, 255, 0.4),
                0 0 45px rgba(0, 0, 255, 0.3),
                inset 0 0 15px rgba(0, 0, 255, 0.1);
  }
  100% {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.6),
                0 0 30px rgba(255, 0, 0, 0.4),
                0 0 45px rgba(255, 0, 0, 0.3),
                inset 0 0 15px rgba(255, 0, 0, 0.1);
  }
}

/* Base selected row styles - will be overridden by desktop/mobile specific rules */
table tbody tr.selected {
  position: relative;
  z-index: 1;
  overflow: visible;
}

header {
  text-align: center;
  padding-block: 2.5rem 2rem;
  margin-bottom: 1rem;
}

header h1 {
  margin-bottom: 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header p {
  color: var(--muted-color);
  font-size: 1rem;
  margin: 0;
  line-height: 1.6;
}

.filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .filters {
    grid-template-columns: 1fr 200px 140px;
    padding: 1.25rem 1.5rem;
    background: var(--pico-card-background-color);
    border-radius: 0.75rem;
    border: 1px solid var(--pico-muted-border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
}

.filters label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-color);
}

.table-wrapper {
  overflow-x: hidden;
  overflow-y: visible;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  -webkit-overflow-scrolling: touch;
}

table {
  margin: 0;
  width: 100%;
}

table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-color);
  white-space: nowrap;
  padding: 1rem 1.25rem;
  font-weight: 600;
  background: transparent;
  border-bottom: 2px solid var(--pico-muted-border-color);
}

table tbody tr {
  border-bottom: 1px solid var(--pico-muted-border-color);
  transition: background-color 0.2s ease, transform 0.1s ease;
  cursor: pointer;
}

table tbody tr:last-child {
  border-bottom: none;
}

table tbody tr:hover {
  background: var(--pico-card-background-color);
}

table tbody tr:active {
  transform: translateX(0);
}

table tbody td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

/* Desktop: Enhanced RGB halo for selected row */
table tbody tr.selected {
  position: relative;
  animation: rgbHalo 2s ease-in-out infinite;
  border-radius: 0.5rem;
  z-index: 1;
  transform: translateX(0);
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.6),
              0 0 30px rgba(255, 0, 0, 0.4),
              0 0 45px rgba(255, 0, 0, 0.3);
}

table tbody tr.selected > td {
  background: var(--pico-card-background-color);
  border-radius: 0.375rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.cell-title {
  font-weight: 500;
  max-width: 24rem;
  line-height: 1.5;
}

.cell-company {
  font-weight: 600;
  font-size: 1.05rem;
}

.cell-location {
  color: var(--muted-color);
  font-size: 0.95rem;
}

.pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 999px;
  background: var(--pico-muted-border-color);
  color: var(--pico-muted-color);
  transition: transform 0.2s ease;
}

.pill:hover {
  transform: scale(1.05);
}

.pill.software {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.pill.data {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.pill.security {
  background: rgba(234, 179, 8, 0.2);
  color: #ca8a04;
}

.pill.support {
  background: rgba(168, 85, 247, 0.15);
  color: #7c3aed;
}

a.apply {
  font-weight: 600;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: inline-block;
}

a.apply:hover {
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  transform: scale(1.05);
}

a.apply:active {
  transform: scale(0.98);
}

.results-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted-color);
  font-weight: 500;
  padding: 0.75rem 0;
}

footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--pico-muted-border-color);
  font-size: 0.9rem;
  color: var(--muted-color);
  text-align: center;
}

footer time {
  font-weight: 600;
  color: var(--pico-color);
  font-size: 0.95rem;
}

footer .disclosure {
  margin-top: 1.25rem;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.85;
  line-height: 1.6;
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted-color);
}

.empty-state p {
  margin: 0.5rem 0;
}

/* Mobile: card layout and stacked filters - Mobile-First Design */
@media (max-width: 767px) {
  main.container {
    padding-inline: 5%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
  }

  header {
    padding-block: 2rem 1.5rem;
    text-align: center;
    width: 90%;
    max-width: 400px;
  }

  header h1 {
    font-size: 1.6rem;
    line-height: 1.3;
  }

  header p {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  section {
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
  }

  .filters > div {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .filters label {
    font-size: 0.625rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
    text-align: center;
    opacity: 0.7;
    width: 100%;
  }

  .filters input,
  .filters select {
    font-size: 1rem;
    padding: 0.75rem;
    min-height: 44px;
    width: 100%;
    text-align: center;
  }

  .table-wrapper {
    overflow: visible;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    margin-inline: 0;
    padding-inline: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Single unified background - no segmented look */
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    padding: 2rem;
  }

  table {
    width: 100%;
    background: transparent;
  }

  table thead {
    display: none;
  }

  table tbody tr {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    width: 100%;
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  table tbody tr:not(.selected):active {
    transform: scale(0.98);
  }

  table tbody tr:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  table tbody tr:last-child.selected {
    margin-bottom: -0.25rem;
  }

  table tbody tr:hover {
    background: transparent;
    box-shadow: none;
  }

  table tbody tr.selected {
    position: relative;
    animation: rgbHalo 2s ease-in-out infinite;
    border-radius: 0.75rem;
    z-index: 1;
    overflow: visible;
  }

  table tbody tr.selected > td {
    background: var(--pico-card-background-color);
    border-radius: 0.5rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  table tbody td {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    padding: 0;
    text-align: center;
    width: 100%;
    /* Ensure no individual backgrounds - transparent for unified look */
    background: transparent;
  }

  table tbody td:empty {
    display: none;
  }

  /* Label styles - Mobile-First */
  table tbody td.cell-company::before,
  table tbody td.cell-location::before,
  table tbody td.cell-title::before,
  table tbody td:nth-child(4)::before {
    font-size: 0.625rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 0.25rem;
    display: block;
    width: 100%;
    text-align: center;
    /* Transparent - no individual backgrounds */
    background: transparent;
  }

  table tbody td.cell-company::before {
    content: "Company";
  }

  table tbody td.cell-location::before {
    content: "Location";
  }

  table tbody td.cell-title::before {
    content: "Title";
  }

  table tbody td:nth-child(4)::before {
    content: "Category";
  }

  /* Content styles - Mobile-First */
  table tbody td.cell-company {
    padding-top: 0;
    padding-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
  }

  table tbody td.cell-location {
    padding-top: 0;
    padding-bottom: 1.25rem;
    font-size: 1rem;
    text-align: center;
    width: 100%;
  }

  table tbody td.cell-title {
    padding-top: 0;
    padding-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
    line-height: 1.5;
  }

  table tbody td:nth-child(4) {
    padding-top: 0;
    padding-bottom: 1.25rem;
    text-align: center;
    width: 100%;
  }

  /* Apply button - no border-top since we're in one card */
  table tbody td:nth-child(5) {
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
    margin-top: 0.75rem;
    width: 100%;
  }

  table tbody td:nth-child(5) a.apply {
    display: block;
    padding: 0.75rem 1.5rem;
    min-height: 44px;
    line-height: 1.5;
    box-sizing: border-box;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
    border-radius: 0.5rem;
  }

  table tbody tr:only-child td {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted-color);
    font-size: 1rem;
    line-height: 1.6;
  }

  .results-line {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    text-align: center;
    width: 100%;
  }

  .empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .empty-state p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0.75rem 0;
  }

  footer {
    margin-top: 2rem;
    padding: 1.5rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.6;
    text-align: center;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  footer p {
    margin-bottom: 0.75rem;
  }

  footer .disclosure {
    margin-top: 1rem;
    padding-inline: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.6;
  }
}
