:root {
  --font-main: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --color-black: #000000;
  --color-white: #ffffff;
  --color-bg: #f0f0f0;
  --color-text-dark: #000000;
  --color-text-light: #666666;

  /* Train Line Colors */
  --ew-green: #009645;
  --ns-red: #d42e12;
  --ne-purple: #9900aa;
  --cc-yellow: #fa9e0d;
  --dt-blue: #005ec4;
  --te-brown: #9d5b25;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  min-height: 100vh;
  color: var(--color-text-dark);
}

.container {
  max-width: 420px;
  width: 100%;
  background-color: #fff;
  height: calc(100vh - 20px);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.container main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.container main::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Header */
.main-header {
  background-color: var(--color-black);
  color: var(--color-white);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.logo h1 {
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-style: italic;
  font-weight: 900;
  font-size: 2.2rem;
  letter-spacing: -2px;
  margin: 0;
  line-height: 1;
}

.tagline {
  font-size: 0.7rem;
  text-align: right;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

/* Info Bar (Date/Time) */
.info-bar {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background-color: var(--color-white);
  flex-shrink: 0;
}

.date-weather {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.date {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-dark);
  letter-spacing: 0;
  line-height: 1.2;
  margin-bottom: 0;
}

.weather-current {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.weather-current > div {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  line-height: 1;
  margin-bottom: 2px;
}

.weather-current .icon {
  font-size: 1.5rem;
  line-height: 1;
  display: inline-block;
}

.weather-current .temp {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
}

.weather-current .condition {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  display: block;
  margin-top: 0;
  width: 100%;
  line-height: 1.2;
}

.time {
  font-size: 3rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: var(--color-text-dark);
  margin-top: 0;
  text-align: right;
}

/* Hero Section */
.hero-section {
  display: flex;
  background-color: var(--color-white);
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
}

.forecast-panel {
  padding: 20px;
  flex: 1;
  min-width: 0;
}

.forecast-panel h2 {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 15px;
  text-transform: uppercase;
  color: var(--color-text-dark);
  letter-spacing: 0;
}

.forecast-item {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

.forecast-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.forecast-item .day {
  font-weight: 700;
  font-size: 0.8rem;
  display: inline-block;
  color: var(--color-text-dark);
}

.forecast-item .date-small {
  font-size: 0.7rem;
  color: #888;
  margin-left: 8px;
  font-weight: 400;
}

.forecast-item p {
  font-size: 0.75rem;
  line-height: 1.3;
  margin-top: 2px;
  color: var(--color-text-dark);
  font-weight: 400;
}

.hero-image {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  overflow: hidden;
  background-image: url('/public/images/model.JPG');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: bottom right;
  min-height: 400px;
  background-position: center;
}

/* Promo Banner */
.promo-banner {
  margin: 20px;
  height: 100px;
  background-color: #333;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  flex-shrink: 0;
}

.banner-placeholder {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 10px;
  position: relative;
}

.banner-button {
  background-color: var(--color-white);
  color: var(--color-black);
  border: none;
  padding: 10px 20px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 0;
  font-family: var(--font-main);
  letter-spacing: 0;
  line-height: 1.2;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.banner-button:hover {
  background-color: #f0f0f0;
}

/* Train Services */
.train-services {
  padding: 0 20px;
  margin-bottom: 30px;
  background-color: var(--color-white);
}

.service-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.service-row:last-child {
  margin-bottom: 0;
}

.line-label {
  color: white;
  padding: 6px 15px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
  width: 60%;
  display: flex;
  align-items: center;
  letter-spacing: 0;
}

/* Train Icons (Simulated with CSS pseudo-elements or just text for now) */
.line-label::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-color: white;
  border-radius: 2px;
  margin-right: 8px;
  flex-shrink: 0;
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-7H6V6h5v4zm2 0V6h5v4h-5zm3.5 7c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4zM7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17zm3.5-7H6V6h5v4zm2 0V6h5v4h-5zm3.5 7c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/></svg>');
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  background-color: currentColor;
}

.line-label.ew {
  background-color: var(--ew-green);
}
.line-label.ns {
  background-color: var(--ns-red);
}
.line-label.ne {
  background-color: var(--ne-purple);
}
.line-label.cc {
  background-color: var(--cc-yellow);
  color: black;
} /* Yellow often needs black text */
.line-label.cc::before {
  background-color: black;
}
.line-label.dt {
  background-color: var(--dt-blue);
}
.line-label.te {
  background-color: var(--te-brown);
}

.status {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: right;
  color: var(--color-text-dark);
}

/* Single Train Service Message */
.train-service-message {
  padding: 20px;
  background-color: var(--color-white);
  border: 2px solid #e0e0e0;
  border-radius: 8px;
}

.service-message-label {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--color-text-dark);
  letter-spacing: 0;
}

.service-message-content {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text-dark);
  padding: 12px;
  background-color: #f5f5f5;
  border-radius: 4px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.service-message-content.has-alert {
  background-color: #fff3cd;
  border-left: 4px solid #ffc107;
  color: #856404;
}

/* Weather Report */
.weather-report {
  padding: 0 20px;
  padding-bottom: 40px;
  background-color: var(--color-white);
}

.weather-report h2 {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: var(--color-text-dark);
  letter-spacing: 0;
}

.region-report {
  margin-bottom: 25px;
}

.region-report:last-child {
  margin-bottom: 0;
}

.region-report h3 {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-transform: uppercase;
  color: var(--color-text-dark);
  letter-spacing: 0;
}

.report-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  line-height: 1.4;
}

.locations {
  font-weight: 600;
  color: var(--color-text-dark);
}

.conditions {
  text-align: right;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-dark);
}

/* Mobile-first responsive design */
@media (max-width: 420px) {
  body {
    padding: 10px 5px;
  }
  
  .container {
    max-width: 100%;
    height: calc(100vh - 10px);
  }
  
  .main-header {
    padding: 10px 15px;
  }
  
  .logo h1 {
    font-size: 1.8rem;
  }
  
  .tagline {
    font-size: 0.6rem;
  }
  
  .info-bar {
    padding: 15px;
  }
  
  .forecast-panel {
    padding: 0 15px;
  }
  
  .promo-banner {
    margin: 15px;
    height: 100px;
  }
  
  .train-services {
    padding: 15px;
  }
  
  .weather-report {
    padding: 15px;
  }
}

@media (min-width: 768px) {
  .container {
    margin: 10px;
    border-radius: 12px;
    overflow: hidden;
  }
}

/* Container preloader */

#page-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  margin: 0;
  padding: 0;
}

#page-loader img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Progress bar container */
.progress-bar-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  max-width: 80%;
  z-index: 10000;
}

.progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #000 0%, #333 50%, #000 100%);
  border-radius: 10px;
  width: 0%;
  animation: progressAnimation 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

@keyframes progressAnimation {
  0% {
    width: 0%;
    transform: translateX(0);
  }
  50% {
    width: 70%;
  }
  100% {
    width: 100%;
    transform: translateX(0);
  }
}

