@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root {
  --primary-color: #FF9859;
  --secondary-color: #EECBB2;
  --accent-color: #2F314D;
  --light-color: #f8f9fa;
  --gray-color: #949494;
}

html {
  font-family: sans-serif;
  line-height: 1.2;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  margin: 0;
  padding: 0;
  font-family: "Rubik", serif;
  font-weight: normal;
  line-height: 1.2;
  color: #2F314D !important;
  background-color: #F8F4EE;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #2F314D;
}

button.navbar-toggler {
  padding: 0.25rem;
  border: 0;
}

button.navbar-toggler i.bi {
  color: #FF9859;
  font-size: 2rem;
  -webkit-text-stroke-width: 1px;
}

.app-status {
  position: relative;
  top: -1rem;
  font-size: 0.8rem;
}

.navbar-nav .nav-item {
  text-align: center;
  padding: 0.5rem 0;
}

.text-red {
  color: #EA5C4F;
}

.text-orange {
  color: #FF9859;
}

.rotate180 {
  transform: rotate(180deg);
  margin-top: 0.1rem;
}

.navbar {
  background-color: #2F314D;
  color: #FAFAFA;
  /* iPhone / Safari 的安全區域 */
  padding-top: calc(20px + env(safe-area-inset-top));
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
}

.nav.fixed-bottom {
  text-align: center;
  background-color: #ffffff;
  box-shadow: 0 0 1.5rem rgba(51, 51, 51, 0.8);
}

.nav.fixed-bottom .nav-link {
  color: #2F314D;
  padding: 0.5rem 0.8rem;
}

.nav.fixed-bottom .nav-link span {
  width: 45px;
  display: block;
}

.nav.fixed-bottom .bi {
  font-size: 1.7rem;
}

.nav.fixed-bottom .nav-item:nth-child(3) {
  margin-top: -2.54rem;
}

.nav.fixed-bottom .highlight-btn {
  width: 65px;
  height: 65px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 0.5rem;
  background-color: #729B58;
  color: #FAFAFA;
  border: 0.4rem solid #FFFFFF;
  border-radius: 50%;
}

header {
  background-color: #EECBB2;
  border-bottom-left-radius: 2rem;
  border-bottom-right-radius: 2rem;
}

#timeSelector {
  display: none;
}

.title-panel {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 3rem;
  border-radius: 1rem;
  font-size: 1.2rem;
  background-color: #EECBB3;
}

.title-panel.attention {
  background-color: #FECE85;
}

.title-panel .bi {
  font-size: 2rem;
  margin-right: 0.5rem;
}

.status-wrapper {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 1rem;
  font-size: 1rem;
  background-color: #F4F0EC;
  margin: 0 0 1rem;
  box-shadow: 0 0.6rem 0 0 #ACACAC;
}

.status-panel {
  display: flex;
  justify-content: center;
  align-items: center;
}

.status-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.status-on {
  background-color: #92BA79;
  border: 2px solid #729B58;
  animation: blink 2s infinite;
}

@keyframes blink {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}


.status-off {
  background-color: #E95C50;
  border: 2px solid #D83B2E;
}

.status-unknown {
  background-color: #FECE85;
  border: 2px solid #FFB646;
}

.station-container {
  position: relative;
  height: 8rem;
  padding: 20px 0;
}

.station-marker {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  background-color: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FF9966;
  border: 5px solid #F96;
  position: relative;
  z-index: 2;
}

.station-connector {
  position: absolute;
  left: 10px;
  top: 45px;
  width: 2px;
  height: calc(100% - 21px);
  border-left: 10px dotted #ccc;
  z-index: 1;
}

.bus-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  color: #92BA79;
  font-size: 2rem;
  margin: 10px 0;
  position: relative;
}

.bus-icon svg {
  -webkit-transform: scaleX(-1);
  transform: scaleX(-1);
}

.bus-number {
  position: absolute;
  top: -8px;
  right: -4px;
  background: #2F314D;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animated-hover {
  animation-name: moving-3s;
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

@keyframes moving-3s {
  0% {
    transform: translate(0, 5px);
  }

  50% {
    transform: translate(0, -5px);
  }

  100% {
    transform: translate(0, 5px);
  }
}

.animated-blink {
  animation-name: blink-1s;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

@keyframes blink-1s {
  0% {
    opacity: 1;
  }

  30% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.timetable-divider {
  border-left: 3px solid #CCCCCC;
}

.horizontal-divider {
  border-bottom: 3px solid #CCCCCC;
}

.journey-time {
  font-size: 2.5rem;
  font-weight: bold;
}

.service-times {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
}

.last-bus-times {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
}

.require-attention {
  color: #E95C50;
}

/* .current-date-container {
  border-left: 4px solid var(--primary-color);
} */

.table-success {
  background-color: rgba(25, 135, 84, 0.2) !important;
}

tr.table-secondary td {
  color: #6c757d;
}

.time-selector {
  margin: 10px 0 20px;
  display: flex;
  flex-direction: column;
  overflow-x: auto; 
  padding-bottom: 10px;
}

.time-selector .btn {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 5px;
  width: 100%;
  font-weight: 500;
}

.time-selector .btn-outline-primary {
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
}

.time-selector .btn.active {
  color: #FAFAFA;
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.route-info {
  /* background-color: var(--secondary-color); */
  border-radius: 8px;
  margin-bottom: 15px;
}

.timetable th {
  background-color: var(--primary-color);
  color: white;
}

.timetable tr:nth-child(even) {
  background-color: var(--secondary-color);
}

.operation-days {
  display: inline-block;
  padding: 3px 8px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-right: 5px;
}

.bus-number {
  font-weight: bold;
  color: var(--primary-color);
}

.last-bus {
  font-weight: bold;
  color: #dc3545;
}

@media (max-width: 768px) {
  .timetable {
    font-size: 0.85rem;
  }

  .time-selector .btn {
    min-width: 100px;
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

@media (min-width: 576px) {
  .time-selector {
    flex-direction: row;
  }
  
  .time-selector .btn {
    margin-left: 0;
    margin-right: 0.8rem;
    width: auto;
    min-width: 20rem;
  }
}

.bg-footer {
  height: 35rem;
  background-image: url('../imgs/bg_footer_m.png');
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: bottom;
  /* iPhone / Safari 的安全區域 */
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}

.img-bee {
  width: 22rem;
}

@media (min-width: 576px) {
  .bg-footer {
    height: 30rem;
    background-image: url('../imgs/bg_footer_d.png');
  }

  .img-bee {
    width: 26rem;
  }
}