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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

h1 {
  font-size: 1.8rem;
  font-weight: 300;
  color: #fff;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-time {
  font-size: 2rem;
  font-weight: 300;
  color: #7b8cde;
}

#last-update {
  font-size: 0.85rem;
  color: #888;
}

#refresh-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  font-size: 1.4rem;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

#refresh-btn:hover {
  border-color: #666;
  color: #fff;
}

#refresh-btn.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.day-section {
  margin-bottom: 30px;
}

.day-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 10px 0;
}

.nav-btn {
  background: none;
  border: 1px solid #444;
  color: #888;
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.nav-btn:hover {
  border-color: #7b8cde;
  color: #fff;
}

.nav-label {
  font-size: 0.95rem;
  color: #ccc;
  min-width: 200px;
  text-align: center;
}

.nav-today-btn {
  border-color: #7b8cde;
  color: #7b8cde;
  font-weight: 500;
}

.nav-today-btn:hover {
  background: #7b8cde;
  color: #1a1a2e;
}

.day-header {
  font-size: 1.1rem;
  font-weight: 500;
  color: #7b8cde;
  margin-bottom: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid #2a2a4e;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.day-weather {
  font-size: 0.95rem;
  font-weight: 400;
  color: #ccc;
  white-space: nowrap;
}

/* ===== TIMELINE ===== */

.timeline {
  position: relative;
  margin: 0 0 10px 0;
}

/* Hodinové značky */
.tl-hour {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #2a2a4e;
}

.tl-hour.tl-noon {
  border-top-color: #f39c1240;
}

.tl-hour span {
  position: absolute;
  top: 4px;
  left: 0;
  font-size: 0.7rem;
  color: #555;
  width: 42px;
  text-align: right;
}

.tl-noon span {
  color: #f39c12;
}

.tl-hour.tl-midnight {
  border-top-color: #7b8cde40;
}

.tl-midnight span {
  color: #7b8cde;
}

/* Komprimovaná mezera (prázdné hodiny) */
.tl-gap {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
}

.tl-gap::after {
  content: '';
  position: absolute;
  left: 54px;
  right: 0;
  top: 50%;
  border-top: 1px dashed #222240;
}

.tl-gap span {
  font-size: 0.6rem;
  color: #3a3a5e;
  width: 42px;
  text-align: right;
  position: relative;
  z-index: 1;
}

/* Události v timeline */
.tl-event {
  position: absolute;
  left: 54px;
  right: 0;
  border-radius: 6px;
  padding: 6px 10px;
  background: #252544;
  border-left: 4px solid #666;
  border-top: 1px solid #3a3a5e;
  border-right: 1px solid #3a3a5e;
  border-bottom: 1px solid #3a3a5e;
  overflow: hidden;
  z-index: 1;
  display: flex;
  gap: 10px;
  transition: background 0.2s;
}

.tl-event:hover {
  background: #2a2a55;
}

.tl-event.morning {
  border-left-color: #f39c12;
}

.tl-event.afternoon {
  border-left-color: #3498db;
}

.tl-event.evening {
  border-left-color: #9b59b6;
}

.tl-event.is-now {
  box-shadow: 0 0 15px #2ecc7125;
  border-color: #2ecc71;
}

.tl-event-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: #7b8cde;
  min-width: 42px;
  flex-shrink: 0;
}

.tl-event-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.tl-event-title {
  font-size: 0.9rem;
  color: #fff;
}

.tl-event-person {
  font-size: 0.8rem;
  color: #888;
}

/* Progress — vertikální výplň shora dolů */
.tl-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: #2ecc7112;
  z-index: 0;
  border-radius: 6px 6px 0 0;
}

/* "Teď" linka */
.tl-now {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.tl-now::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  flex-shrink: 0;
  animation: pulse-dot 2s infinite;
}

.tl-now::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #2ecc71;
}

.tl-now span {
  padding: 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #2ecc71;
  white-space: nowrap;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Cinema info uvnitř události */
.event-cinema {
  margin-top: 6px;
  padding: 6px 8px;
  background: #1a1a35;
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.movie-title {
  color: #e74c3c;
  font-weight: 500;
}

.movie-start {
  color: #7b8cde;
  font-weight: 600;
}

.movie-duration {
  color: #888;
}

.movie-end {
  color: #2ecc71;
  font-weight: 600;
}

.movie-tickets {
  color: #f39c12;
  font-weight: 500;
}

/* Ostatní */
.loading, .error, .empty {
  text-align: center;
  padding: 40px;
  color: #666;
}

.no-events {
  padding: 15px;
  color: #666;
  font-style: italic;
}

.legend {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: #888;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-color.morning {
  background-color: #f39c12;
}

.legend-color.afternoon {
  background-color: #3498db;
}

.legend-color.evening {
  background-color: #9b59b6;
}

.error {
  color: #e74c3c;
}

@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .tl-event {
    left: 46px;
    flex-direction: column;
    gap: 2px;
  }

  .day-nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-label {
    width: 100%;
    order: -1;
    font-size: 0.85rem;
  }
}
