/* Reset und Basisstile */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: relative; /* For absolute positioning of watermark */
}

.container {
  width: 100%;
  height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1; /* Ensure content is above the watermark */
}

/* Logo Watermark */
.logo-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 0;
  opacity: 0.08; /* Subtle watermark effect */
  pointer-events: none; /* Allow clicks to pass through */
}

.logo-watermark img {
  max-width: 60%;
  max-height: 60%;
  object-fit: contain;
}

/* Header-Stile */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  height: auto;
  max-height: 20vh;
}

.greeting-container {
  flex: 1;
  margin-right: 20px;
}

.main-greeting {
  font-size: clamp(24px, 3vw, 48px);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin-bottom: 5px;
  line-height: 1.1;
}

.sub-greeting {
  font-size: clamp(16px, 1.5vw, 24px);
  font-weight: 400;
  color: var(--accent-color);
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 5px;
  line-height: 1.3;
}

.time-date {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Right align time and date */
}

.current-time {
  font-size: clamp(36px, 5vw, 80px);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1;
  letter-spacing: -0.02em;
}

.current-date {
  font-size: clamp(14px, 1.5vw, 24px);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  margin-top: 5px;
}

/* Main Content - Widget Grid */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-auto-rows: minmax(200px, auto);
  gap: 20px;
  height: 100%;
  max-height: 75vh;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.widget-grid::-webkit-scrollbar {
  width: 8px;
}

.widget-grid::-webkit-scrollbar-track {
  background: transparent;
}

.widget-grid::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

/* Widget Styles */
.widget {
  background: rgba(15, 40, 90, 0.6);
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.widget-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.widget-header h2 {
  font-size: clamp(14px, 1.2vw, 22px);
  color: var(--accent-color);
  font-weight: 600;
  text-align: center;
  margin: 0 8px;
}

.widget-header i {
  font-size: clamp(14px, 1.2vw, 22px);
  color: var(--accent-color);
}

.widget-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Weather Widget */
.weather-widget {
  grid-row: span 2;
}

.current-weather {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 15px;
  flex: 0 0 auto;
}

.weather-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.weather-icon-temp {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.weather-icon {
  font-size: clamp(24px, 3vw, 48px);
  margin-right: 15px;
  color: var(--accent-color);
}

.temperature {
  font-size: clamp(28px, 3.5vw, 0px);
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.weather-description {
  font-size: clamp(16px, 1.5vw, 24px);
  text-align: center;
  font-weight: 500;
}

.weather-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  flex: 1;
  padding-left: 15px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}

.detail-label {
  font-size: clamp(12px, 0.9vw, 16px);
  color: rgba(255, 255, 255, 0.7);
}

.detail-value {
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 500;
}

.forecast {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.forecast-header {
  text-align: center;
  margin-bottom: 10px;
  font-size: clamp(14px, 1.1vw, 20px);
  color: var(--accent-color);
  font-weight: 500;
}

.forecast-days {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  flex: 1;
  min-height: 0;
}

.forecast-day {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.forecast-date {
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--accent-color);
  font-size: clamp(12px, 0.9vw, 16px);
}

.forecast-icon {
  font-size: clamp(18px, 2vw, 36px);
  margin: 5px 0;
  color: var(--accent-color);
}

.forecast-temp {
  font-size: clamp(14px, 1.2vw, 22px);
  font-weight: 600;
  margin: 5px 0;
}

.forecast-desc {
  font-size: clamp(10px, 0.8vw, 14px);
  color: rgba(255, 255, 255, 0.9);
}

/* Transport Widget */
.transport-widget {
  grid-row: span 2;
}

.departures {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 5px;
}

.departures::-webkit-scrollbar {
  display: none;
}

.departure-item {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 10px;
  align-items: center;
  transition: transform 0.2s ease;
}

.departure-item:hover {
  transform: translateX(5px);
}

.train-line {
  background: var(--accent-color);
  color: var(--primary-color);
  font-weight: bold;
  padding: 5px;
  border-radius: 6px;
  margin-right: 10px;
  min-width: 40px;
  text-align: center;
  font-size: clamp(12px, 0.9vw, 16px);
}

.departure-details {
  flex: 1;
  min-width: 0;
}

.departure-direction {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: clamp(12px, 1vw, 18px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.departure-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: clamp(10px, 0.8vw, 14px);
  color: rgba(255, 255, 255, 0.8);
}

.departure-time {
  font-weight: 600;
}

.departure-status.delayed {
  color: #ff6b6b;
}

.no-departures {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

/* News Widget */
.news-widget {
  grid-row: span 2;
}

.news-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.news-items::-webkit-scrollbar {
  width: 5px;
}

.news-items::-webkit-scrollbar-track {
  background: transparent;
}

.news-items::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.news-item {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.news-item:hover {
  transform: translateY(-3px);
}

.news-image {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  overflow: hidden;
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-content {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.news-title {
  font-size: clamp(12px, 1vw, 18px);
  font-weight: 600;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-summary {
  font-size: clamp(10px, 0.8vw, 14px);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: clamp(9px, 0.7vw, 12px);
  color: rgba(255, 255, 255, 0.7);
}

/* Joke and Tip Widgets */
.joke-widget,
.tip-widget {
  display: flex;
  flex-direction: column;
}

.joke-content,
.tip-content {
  font-size: clamp(12px, 1vw, 18px);
  line-height: 1.5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-style: italic;
}

/* Footer */
footer {
  margin-top: 15px;
  text-align: center;
  font-size: clamp(10px, 0.8vw, 14px);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 0;
  height: auto;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.admin-link {
  position: absolute;
  right: 10px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: clamp(10px, 0.8vw, 14px);
  transition: color 0.2s ease;
}

.admin-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .container {
    padding: 15px;
  }

  .widget-grid {
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 15px;
  }

  .greeting-container {
    margin-right: 0;
    margin-bottom: 10px;
    text-align: center;
  }

  .time-date {
    align-items: center;
  }

  .current-weather {
    flex-direction: column;
  }

  .weather-details {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    margin-top: 10px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .widget-grid {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .forecast-days {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .forecast-day {
    min-width: 120px;
  }

  .news-item {
    flex-direction: column;
  }

  .news-image {
    width: 100%;
    height: 120px;
  }
}

@media (max-height: 600px) {
  .container {
    padding: 8px;
  }

  header {
    margin-bottom: 10px;
  }

  .widget-header {
    margin-bottom: 5px;
    padding-bottom: 5px;
  }

  .current-weather {
    padding: 10px;
    margin-bottom: 10px;
  }

  footer {
    margin-top: 8px;
    padding: 5px 0;
  }
}
