:root {
  --bg-color: #050505;
  --glass-bg: rgba(30, 30, 30, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --accent-color: #4dabf7;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --radius: 24px;
  --padding: 30px;
}

body {
  margin: 0;
  height: 100vh;
  background-color: var(--bg-color);
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- LAYOUT --- */
.dashboard-container {
  display: flex;
  width: 96vw;
  height: 94vh;
  gap: 20px;
}

.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.left-panel {
  flex: 4;
  padding: var(--padding);
}

.right-panel {
  flex: 1;
}

/* --- KLOCKA & HEADER --- */
header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 20px;
  flex-shrink: 0; /* Viktigt för att inte krocka med scroll */
}

.clock-container {
  text-align: left;
}
#current-time {
  font-size: 5rem;
  font-weight: 800;
  margin: 0;
  line-height: 1;
  background: linear-gradient(45deg, #fff, #bbb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
#current-date {
  font-size: 1.2rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.route-header {
  text-align: right;
}
.route-header h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 600;
}
.route-header .arrow {
  color: var(--accent-color);
  padding: 0 10px;
}
.route-header p {
  margin: 5px 0 0;
  color: var(--text-secondary);
}

/* --- BUS LISTA --- */
#bus-list-container {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 10px;
  /* Dölj scrollbar men tillåt scroll (valfritt) eller styla den */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#bus-list-container::-webkit-scrollbar {
  width: 6px;
}
#bus-list-container::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.bus-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-bottom: 20px;
}

.trip-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0;
  animation: slideIn 0.5s ease forwards;
}
.trip-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.005);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.trip-time {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
}
.trip-bus {
  font-size: 1.1rem;
  font-weight: 600;
  background: #e91e63;
  padding: 4px 12px;
  border-radius: 50px;
  margin-left: 15px;
}
.trip-countdown {
  font-size: 1.4rem;
  color: var(--accent-color);
  font-weight: 500;
}

.loading-pulse {
  height: 70px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  animation: pulse 1.5s infinite;
  margin-bottom: 10px;
}
@keyframes pulse {
  0% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 0.3;
  }
}

/* --- SOLUPPGÅNG & INTRO --- */
#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;

  /* 
     Animation för bakgrunden: 
     0-10s: Svart -> Mörkröd
     10-20s: Mörkröd -> Orange
     20-25s: Orange -> Gul
     25-30s: Gul -> Vit -> Transparent 
  */
  animation: sunriseEffect 30s linear forwards;
}

@keyframes sunriseEffect {
  0% {
    background-color: #000000;
  }
  30% {
    background-color: #2b0f0f;
  } /* Gryning */
  60% {
    background-color: #5e2800;
  } /* Solen på väg */
  85% {
    background-color: #c98800;
  } /* Stark orange */
  95% {
    background-color: #ffeaa7;
    opacity: 1;
  } /* Ljusgul */
  100% {
    background-color: #ffffff;
    opacity: 0;
    visibility: hidden;
  }
}

.intro-card {
  position: relative;
  /* STÖRRE KORT: 300x300 */
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(20, 20, 20, 0.8);
  /* Radie måste matcha rect rx */
  border-radius: 40px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.intro-counter {
  font-size: 8rem; /* Mycket större text */
  font-weight: 800;
  color: #fff;
  z-index: 2;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.border-progress-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.border-rect {
  fill: none;
  stroke: #ffffff;
  stroke-width: 4;
  stroke-linecap: round;
  /* Vi styr dessa med JS, men sätter en transition för mjukhet */
  transition: stroke-dashoffset 1s linear;
}
