/* 
Citation: ChatGPT (OpenAI, 2025) was used to help review CSS organization
and suggest minor aesthetic adjustments and for table resizing. All styling and layout were created
and finalized by the team.
*/

/* ===== COLOR SYSTEM =====
   Primary Accent (Neon Red-Orange): hsl(8, 100%, 50%)
   Secondary Accent (Warm Yellow):   hsl(48, 100%, 50%)
   Text Light:                       #f0f0f0
   Surface Dark:                     rgba(15, 15, 15, 0.9)
   Overlay Background:               rgba(0, 0, 0, 0.75)
   ============================================== */

:root {
  --accent-red: hsl(8, 100%, 50%);
  --accent-yellow: hsl(48, 100%, 50%);
  --text-light: #f0f0f0;
  --surface-dark: rgba(15, 15, 15, 0.9);
  --overlay-bg: rgba(0, 0, 0, 0.75);
}

/* ===== GLOBAL ===== */
body {
  margin: 0;
  font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text-light);
  background: #000;
  overflow-x: hidden;
}

/* ===== BACKGROUND VIDEO ===== */
#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  filter: brightness(0.9) contrast(1.2);
}

/* ===== NAVIGATION BAR ===== */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);

  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  row-gap: 0.6rem;

  padding: 12px 10px;
  border-bottom: 2px solid var(--accent-red);
}

nav a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;

  transition: color 0.3s ease, transform 0.2s ease;
  font-size: clamp(0.8rem, 1vw, 1rem);
}

nav a:hover {
  color: hsl(48, 100%, 60%);
  text-shadow: 0 0 8px hsl(48, 100%, 55%);
}

/* ===== MAIN CONTENT OVERLAY ===== */
.overlay-content {
  position: relative;
  margin: 100px auto 60px;
  max-width: min(95%, 900px);
  padding: clamp(20px, 4vw, 40px);
  border-radius: 14px;
  background: var(--surface-dark);
  color: var(--text-light);
  border-left: 3px solid var(--accent-red);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);

  transition: opacity 0.35s ease, transform 0.4s ease;
}

.overlay-content.loading {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

/* ===== HEADINGS ===== */
h1 {
  color: var(--accent-red);
  text-transform: uppercase;
  font-size: 2rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-shadow: 0 0 14px rgba(255, 36, 0, 0.5);
}

h2 {
  color: white;
  font-size: 1.3rem;
  margin-top: 30px;
}

/* ===== TABLES ===== */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 20px auto;
  background: rgba(25, 25, 25, 0.95);
  border-radius: 8px;
  overflow: hidden;
  table-layout: auto;
}

th {
  background: var(--accent-red);
  color: #000;
  padding: 12px 15px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

td {
  color: var(--text-light);
  padding: 12px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

tr {
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* ===== TABLE COLUMN WIDTH CONTROL ===== */

/* For 3-column M:N relationship tables (ProjectLines, LineStations) */
table.mapping-table {
  table-layout: fixed !important;
  width: 750px !important;
  max-width: 750px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 25px !important;
  margin-bottom: 25px !important;
}

table.mapping-table th:nth-child(1),
table.mapping-table td:nth-child(1) {
  width: 340px !important;
  text-align: left !important;
  padding-left: 25px !important;
  padding-right: 25px !important;
}

table.mapping-table th:nth-child(2),
table.mapping-table td:nth-child(2) {
  width: 340px !important;
  text-align: left !important;
  padding-left: 25px !important;
  padding-right: 25px !important;
}

table.mapping-table th:nth-child(3),
table.mapping-table td:nth-child(3) {
  width: 70px !important;
  text-align: center !important;
  padding-left: 25px !important;
  padding-right: 25px !important;
}

/* For standard entity tables */
table th:first-child:not(.mapping-table th),
table td:first-child:not(.mapping-table td) {
  width: 60px;
  text-align: center;
  min-width: 60px;
  max-width: 60px;
}

table th:last-child:not(.mapping-table th),
table td:last-child:not(.mapping-table td) {
  width: 80px;
  text-align: center;
  min-width: 80px;
  max-width: 80px;
}

table th:nth-child(2):not(.mapping-table th),
table td:nth-child(2):not(.mapping-table td) {
  min-width: 250px;
}

table th:nth-child(4):not(.mapping-table th),
table td:nth-child(4):not(.mapping-table td) {
  width: 120px;
  text-align: center;
}

table th:nth-child(5):not(.mapping-table th),
table td:nth-child(5):not(.mapping-table td) {
  width: 120px;
  text-align: center;
}

table th:nth-child(5):not(.mapping-table th):not(:last-child),
table td:nth-child(5):not(.mapping-table td):not(:last-child) {
  width: 200px;
  text-align: left;
}

table th:nth-child(3):not(.mapping-table th),
table td:nth-child(3):not(.mapping-table td) {
  width: 150px;
}

/* ===== STATIONS TABLE SPECIFIC STYLING ===== */
table.stations-table {
  width: 750px !important;
  max-width: 750px !important;
  table-layout: fixed !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}

table.stations-table th:nth-child(1),
table.stations-table td:nth-child(1) {
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  text-align: center !important;
  padding-left: 30px !important;
  padding-right: 30px !important;
}

table.stations-table th:nth-child(2),
table.stations-table td:nth-child(2) {
  width: 300px !important;
  min-width: 300px !important;
  max-width: 300px !important;
  text-align: left !important;
  padding-left: 30px !important;
  padding-right: 20px !important;
}

table.stations-table th:nth-child(3),
table.stations-table td:nth-child(3) {
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
  text-align: left !important;
  padding-left: 20px !important;
  padding-right: 30px !important;
}

table.stations-table th:nth-child(4),
table.stations-table td:nth-child(4) {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
  text-align: center !important;
  padding-left: 30px !important;
  padding-right: 30px !important;
}

table.stations-table th:nth-child(5),
table.stations-table td:nth-child(5) {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  text-align: center !important;
  padding-left: 30px !important;
  padding-right: 30px !important;
}

/* ===== RAILLINES TABLE SPECIFIC STYLING ===== */
table.raillines-table {
  width: 720px !important;
  max-width: 720px !important;
  table-layout: fixed;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 20px;
  margin-bottom: 20px;
}

table.raillines-table th:nth-child(1),
table.raillines-table td:nth-child(1) {
  width: 55px;
  text-align: center;
  padding-left: 15px;
  padding-right: 20px;
}

table.raillines-table th:nth-child(2),
table.raillines-table td:nth-child(2) {
  width: 120px;
  padding-left: 15px;
  padding-right: 10px;
}

table.raillines-table th:nth-child(3),
table.raillines-table td:nth-child(3) {
  width: 90px;
  text-align: center;
  padding-left: 15px;
  padding-right: 10px;
}

table.raillines-table th:nth-child(4),
table.raillines-table td:nth-child(4) {
  width: 95px;
  text-align: center;
  padding-left: 15px;
  padding-right: 10px;
}

table.raillines-table th:nth-child(5),
table.raillines-table td:nth-child(5) {
  width: 300px;
  text-align: left;
  padding-left: 15px;
  padding-right: 10px;
}

table.raillines-table th:nth-child(6),
table.raillines-table td:nth-child(6) {
  width: 60px;
  text-align: center;
  padding-left: 15px;
  padding-right: 20px;
}

/* ===== LINKS ===== */
a {
  color: var(--accent-yellow);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-red);
}

/* ===== FORMS ===== */
form {
  margin-top: 25px;
  background: rgba(30, 30, 30, 0.9);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);

  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

label {
  display: block;
  margin-top: 10px;
  font-weight: 500;
  color: var(--text-light);
}

input,
select,
button {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  outline: none;

  box-sizing: border-box;
  max-width: 100%;
}

input:focus,
select:focus {
  box-shadow: 0 0 6px var(--accent-red);
}

button {
  background: var(--accent-red);
  color: #000;
  font-weight: bold;
  margin-top: 15px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.15s ease;
}

button:hover {
  background: var(--accent-yellow);
  transform: translateY(-1px);
}

.crud-panel {
  max-width: 100%;
  overflow: hidden;
}

/* ===== HOMEPAGE HERO SECTION ===== */
.home-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90vh;
  text-align: center;
}

.overlay-box {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--accent-red);
  border-radius: 20px;

  max-width: min(95%, 900px);
  padding: clamp(1.6rem, 5vw, 3rem);

  box-shadow: 0 0 20px rgba(255, 60, 0, 0.4);
  backdrop-filter: blur(4px);
  animation: fadeIn 1.4s ease-in-out;
}

.hero-title {
  color: var(--accent-red);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
  text-shadow: 0 0 16px rgba(255, 60, 0, 0.3);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
}

.hero-subtitle {
  color: #f2f2f2;
  font-size: 1.05rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-links a {
  background: var(--accent-red);
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.25s ease, transform 0.25s ease;
}

.hero-links a:hover {
  background: var(--accent-yellow);
  transform: translateY(-3px);
}

.hero-credit {
  color: #d0d0d0;
  font-size: 0.95rem;
  margin-top: 1rem;
  letter-spacing: 0.3px;
}

.credit-names {
  color: #fff;
  font-weight: 600;
}

/* ===== MUTE BUTTON (HIDDEN) ===== */
#mute-btn {
  display: none;
}

/* ===== VIDEO CONTROLS (if shown) ===== */
video::-webkit-media-controls-panel {
  background: rgba(0, 0, 0, 0.5);
  color: var(--accent-red);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reset-link {
  color: hsl(8, 100%, 50%);
  font-weight: bold;
}

.reset-link:hover {
  color: #ff0000;
}

/* ===== BUTTONS ===== */
#pause-toggle {
  position: fixed;
  bottom: 20px;
  right: 80px;
  z-index: 100;

  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--accent-red);
  border-radius: 50%;

  width: 40px;
  height: 40px;

  font-size: 1.2rem;
  color: var(--text-light);
  cursor: pointer;

  transition: all 0.3s ease;

  display: flex;
  align-items: center;
  justify-content: center;
}

#pause-toggle:hover {
  background: var(--accent-red);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 60, 0, 0.6);
}

#pause-toggle:active {
  transform: scale(0.95);
}

#mute-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;

  background: rgba(0, 0, 0, 0.7);
  border: 2px solid var(--accent-red);
  border-radius: 50%;

  width: 40px;
  height: 40px;

  font-size: 1.2rem;
  color: var(--text-light);
  cursor: pointer;

  transition: all 0.3s ease;

  display: flex;
  align-items: center;
  justify-content: center;
}

#mute-toggle:hover {
  background: var(--accent-red);
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 60, 0, 0.6);
}

#mute-toggle:active {
  transform: scale(0.95);
}

/* ===== BANNERS ===== */
.error-banner {
  background: rgba(255, 50, 50, 0.15);
  border-left: 3px solid hsl(8, 100%, 50%);
  color: #ffb3b3;
  padding: 12px 18px;
  margin-bottom: 18px;
  border-radius: 6px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.success-banner {
  background: rgba(50, 255, 50, 0.15);
  border-left: 3px solid hsl(120, 100%, 40%);
  color: #b3ffb3;
  padding: 12px 18px;
  margin-bottom: 18px;
  border-radius: 6px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.edit-button {
  color: #ffd700;
  text-decoration: underline;
  cursor: pointer;
}

.edit-button:hover {
  color: var(--accent-red);
  text-decoration: none;
}

/* Highlight animation for Update forms */
.highlight {
  animation: flash 0.7s ease-out;
}

@keyframes flash {
  0%   { background-color: rgba(255, 255, 0, 0.35); }
  100% { background-color: transparent; }
}

/* Smooth transition for forms */
form {
  transition: background-color 0.4s ease;
}

/* Slightly larger than the compact fix, still smaller than original */
nav {
  padding: 10px 6px;   /* keep compact */
  gap: 0.90rem;
  row-gap: 0.40rem;
}

nav a {
  font-size: 0.78rem;  /* slightly larger than before, still < original */
  letter-spacing: 0.6px;
}

