/* center everything */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: rgb(238, 238, 238);
  overflow-y: auto;
}

/* shared card style for form and active pass */
.form, .activePass {
  width: 30vw;
  min-height: 70vh;
  background-color: white;
  border-radius: 0.5vw;
  display: flex;
  flex-direction: column;
  margin-top: 1vw;
  align-items: center;
  padding: 3vw;
  gap: 0.5vw;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s ease;
}

/* active pass overrides */
.activePass {
  text-align: center;
  justify-content: flex-start;
  padding-top: 4vw;
  gap: 0.6vw;
}

.activePass h1 {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.activePass h2 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
}

/* names on the pass */
.activePass .peopleOnPass {
  font-weight: 600;
  font-size: clamp(1.2rem, 1.8vw, 1.7rem);
  opacity: 0.85;
}

/* thin line between sections */
.pass-divider {
  width: 60%;
  height: 1px;
  background-color: rgba(150, 150, 150, 0.3);
}

/* from -> to route display */
.pass-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8vw;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 600;
}

.route-arrow {
  color: rgb(29, 125, 241);
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
}

/* small "time gone" label above the timer */
.time-label {
  font-size: clamp(0.85rem, 1vw, 1rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
  margin: 0;
}

/* the actual timer number */
.activePass .timeGone {
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* arrived + cancel buttons */
.pass-buttons {
  display: flex;
  gap: 1vw;
  margin-top: 1vw;
}

.pass-buttons button {
  padding: 0.8rem 2rem;
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

/* green arrived button */
.btn-arrived {
  background-color: rgb(34, 197, 94);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-arrived:hover {
  background-color: rgb(22, 163, 74);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}

.btn-arrived:active {
  background-color: rgb(16, 140, 60);
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(34, 197, 94, 0.3);
}

/* red cancel button */
.btn-cancel {
  background-color: rgb(239, 68, 68);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-cancel:hover {
  background-color: rgb(200, 50, 50);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-cancel:active {
  background-color: rgb(170, 40, 40);
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.3);
}

.form:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* css for mobile */
@media (max-width: 768px) {
  .form, .activePass {
    width: 80vw;
    min-height: 70vh;
    padding: 5vw;
  }
}

/* form layout */
.form form {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form label {
  text-align: left;
  width: 100%;
  font-size: clamp(0.9rem, 1.1vw, 1.1rem);
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

/* inputs and dropdowns */
.form input,
.form select {
  width: 100%;
  box-sizing: border-box;
  padding: 1.5rem;
  font-size: clamp(1rem, 1.2vw, 1.2rem);
  border: 2px solid #ddd;
  border-radius: 0.4vw;
  font-family: inherit;
  transition: border-color 0.3s ease;
  margin-bottom: 2vh;
}

.form select:hover,
.form input:hover {
  border: 2px solid rgb(29, 125, 241, 0.5);
}

.form select:focus,
.form input:focus {
  border: 2px solid rgb(29, 125, 241);
  outline: none;
}

/* submit button */
.form button {
  width: 40%;
  padding: 0.8rem 1.5rem;
  font-size: clamp(0.9rem, 1.1vw, 1.1rem);
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  background-color: rgb(29, 125, 241);
  color: white;
  transition: background-color 0.3s ease;
  align-self: center;
  margin-top: 1vh;
}

.form button:hover {
  background-color: rgb(20, 100, 200);
}

.form button:active {
  background-color: rgb(15, 80, 170);
}

/* light mode */
@media (prefers-color-scheme: light) {
  body {
    background-color: rgb(238, 238, 238);
  }
  .form, .activePass {
    background-color: white;

  }
 .form h2, .activePass h2 {
    color: #333;
  }
  .form h1, .activePass h1 {
    color: #333;
  }
  .form label, .activePass label {
    color: #333;
  }
  .form input, .activePass input,
  .form select, .activePass select {
    background-color: white;
    color: #333;
    border-color: #ddd;
  }
  #custom-from,
  #custom-to {
    background-color: white;
    color: #333;
    border-color: #ddd;
  }
  .pass-route {
    color: #333;
  }
  .time-label {
    color: #666;
  }
  .pass-divider {
    background-color: rgba(0, 0, 0, 0.1);
  }
}

/* dark mode */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1a1a1a;
  }

  .form, .activePass {
    background-color: #2a2a2a;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 10px 20px rgba(0, 0, 0, 0.4);

  }
  .form:hover, .activePass:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  }
  .form h2, .activePass h2 {
    color: #eee;
  }
  .form h1, .activePass h1 {
    color: #eee;
  }
  .form label, .activePass label {
    color: #ccc;
  }
  .form input, .activePass input,
  .form select, .activePass select {
    background-color: #333;
    color: #eee;
    border-color: #555;
  }
  .form select option, .activePass select option {
    background-color: #333;
    color: #eee;
  }
  #custom-from,
  #custom-to {
    background-color: #333;
    color: #eee;
    border-color: #555;
  }
  .form button {
    background-color: rgb(40, 130, 240);
  }
  .form button:hover {
    background-color: rgb(55, 145, 255);
  }
  .form button:active {
    background-color: rgb(25, 110, 220);
  }
  .pass-route {
    color: #eee;
  }
  .time-label {
    color: #999;
  }
  .pass-divider {
    background-color: rgba(255, 255, 255, 0.1);
  }
}


/* notification bar animation */
@keyframes notifBar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* notification popup */
.notification {
  transition: opacity 0.4s linear;
  width: 280px;
  position: fixed;
  z-index: 9999;
  top: 2vh;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.05),
    rgba(20,20,30,0.6)
  );
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 12px 16px 12px 40px;
  box-shadow:
    0 12px 40px rgba(0,0,0,0.6),
    0 0 30px rgba(255,255,255,0.05);
}

.notification.fadeOut {
  opacity: 0;
}

.notification h1,
.notification h2 {
  margin: 0;
  padding: 0;
  line-height: 1.3;
}

.notification h2 {
  font-size: 0.8rem;
  opacity: 0.6;
  color: white;
  margin-top: 2px;
}

/* green for success, red for fail */
.notification.success h1 {
  font-size: 1rem;
  color: rgb(4, 255, 0);
}

.notification.failed h1 {
  font-size: 1rem;
  color: rgb(240, 15, 15);
}

/* icon inside notif */
.notification svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
}

.notification.success svg {
  fill: #00ff66;
}

.notification.failed svg {
  fill: #f00f0f;
}

/* glow around notif */
.notification.success {
  box-shadow:
    0 18px 60px rgba(0,0,0,0.55),
    0 0 28px rgba(0, 255, 140, 0.18);
}

.notification.failed {
  box-shadow:
    0 18px 60px rgba(0,0,0,0.55),
    0 0 28px rgba(240, 15, 15, 0.50);
}

/* progress bar at bottom of notif */
.notification.success::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgb(4, 255, 0);
  transform-origin: left;
  animation: notifBar 1.3s linear reverse;
}

.notification.failed::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgb(240, 15, 15);
  transform-origin: left;
  animation: notifBar 1.3s linear reverse;
}

/* notif mobile */
@media (max-width: 768px) {
  .notification {
    width: 75vw;
    padding: 10px 14px 10px 38px;
  }
  .notification svg {
    left: 8px;
    width: 18px;
    height: 18px;
  }
  .notification.success h1,
  .notification.failed h1 {
    font-size: 0.9rem;
  }
  .notification h2 {
    font-size: 0.75rem;
  }
}

/* form field wrappers */
.form div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* custom "other" textareas */
#custom-from,
#custom-to {
    width: 70%;
    box-sizing: border-box;
    padding: 0.6rem;
    font-size: clamp(0.85rem, 1vw, 1rem);
    height: 2.5rem;
    border: 2px solid #ddd;
    border-radius: 0.4vw;
    font-family: inherit;
    transition: border-color 0.3s ease;
    margin-bottom: 2vh;
    text-align: center;
    resize: none;
    overflow: hidden;
}

#custom-from:hover,
#custom-to:hover {
    border: 2px solid rgb(29, 125, 241, 0.5);
}

#custom-from:focus,
#custom-to:focus {
    border: 2px solid rgb(29, 125, 241);
    outline: none;
}