@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap");

:root {
  --color-bg: #121212;
  --clr-card: #1d1d1f;
  --clr-input: #2c2c2e;
  --clr-border: #434346;
  --clr-light: #f4f4f4;
  --clr-muted: #9a9a9a;
  --clr-primary: #4c5eff;
  --clr-danger: #e74c3c;
  --clr-shadow: rgba(0, 0, 0, 0.2);
  --max-width: 720px;
  --clr-surface-a10: #282828;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "DM Sans", sans-serif;
  background-color: var(--color-bg);
  color: var(--clr-light);
  margin: 0;
  padding: 32px 20px;
}

.header {
  max-width: var(--max-width);
  margin: 0 auto;
  /*border-bottom: 1px solid var(--clr-border);*/
  text-align: center;
}

.header p {
  text-transform: uppercase;
  font-size: 16px;
  color: var(--clr-muted);
  font-weight: bold;
  margin: 0;
}

.header h1 {
  font-size: 38px;
  font-weight: 800;
  margin: 0;
  color: white;
}

.description {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.description p {
  font-size: 20px;
  color: var(--clr-muted);
  margin-top: 8px;
  margin-bottom: 32px;
}

@media (max-width: 520px) {
  .header h1 {
    font-size: 32px;
  }

  .header p {
    font-size: 14px;
  }

  .description p {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .header h1 {
    font-size: 32px;
  }

  .header p {
    font-size: 14px;
  }

  .description p {
    font-size: 18px;
  }
}

@media (max-width: 400px) {
  .header h1 {
    font-size: 28px;
  }

  .header p {
    font-size: 13px;
  }

  .description p {
    font-size: 16px;
  }
}

/** --- Trips --- **/

.trips {
  max-width: var(--max-width);
  margin: 0 auto;
}

.trip {
  position: relative;
  background-color: var(--clr-card);
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.trip-input {
  display: flex;
  flex-direction: column;
  flex: 1 1 150px;
  min-width: 150px;
}

.trip-input label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--clr-muted);
}

.trip-input input {
  height: 40px;
  border: none;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px;
  background-color: var(--clr-input);
  color: var(--clr-light);
  outline: none;
  font-size: 14px;
}

.trip-input input::placeholder {
  font-size: 14px;
}

.active-time-input {
  display: flex;
  gap: 8px;
}

.active-time-input input {
  width: 100%;
}

.remove-trip-button {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: var(--clr-danger);
  color: white;
  border: none;
  border-radius: 50%;
  scale: 1;
  padding: 3px 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  display: none;
  transition: background-color 0.2s ease;
  flex: none;
  min-width: 0;
}

.remove-trip-button:hover {
  background-color: #ff5e57;
}

/** --- Blue Buttons --- **/

.blue-buttons {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.blue-buttons > button {
  background-color: var(--clr-primary);
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 16px;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.15s ease;
  flex: 1 1 150px;
  min-width: 150px;
}

.blue-buttons > button:hover {
  scale: 1.02;
  transform: translateY(-1px);
}

/** --- Results --- **/

.results {
  max-width: var(--max-width);
  display: none;
  flex-direction: column;
  margin: 48px auto 16px;
  padding: 24px;
  background-color: var(--clr-card);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#results-heading {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 26px;
  color: var(--clr-accent);
  text-transform: uppercase;
  margin: 16px 0;
  margin-top: 8px;
}

.result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  height: 80px;
  border-bottom: 1px solid var(--clr-border);
}

.result:last-child {
  border-bottom: none;
}

.result p {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.result span {
  font-size: 18px;
  font-weight: 500;
}

/** --- Breakdowns --- **/

.breakdowns {
  max-width: var(--max-width);
  display: none;
  flex-direction: column;
  margin: 16px auto;
  padding: 24px;
  background-color: var(--clr-card);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#breakdowns-heading {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 26px;
  color: var(--clr-accent);
  text-transform: uppercase;
  margin: 8px 0;
  margin-bottom: 16px;
}

.breakdown {
  /*border: 1px solid var(--clr-border);*/
  border-radius: 8px;
  margin-bottom: 16px;
}

.breakdown-trip-number {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #fff;
}

.breakdown-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0;
  border-bottom: 1px solid var(--clr-border);
  height: 56px;
  margin-left: 20px;
}

.breakdown-result:last-child {
  border-bottom: none;
}

.breakdown-result p {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

.breakdown-result span {
  font-size: 16px;
  font-weight: 500;
}

/** --- Utility --- **/

.active {
  display: flex;
}
