* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #ffffff;
}

/* Photo Layers */
.photo-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.65);
  transform: scale(1.08);
  transition: opacity 1.2s ease-in-out;
}

.fg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: opacity 1.2s ease-in-out;
}

/* Glassmorphism Ambient HUD */
.hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  transition: opacity 0.5s ease;
}

.hud-card {
  background: rgba(18, 18, 22, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  max-width: 440px;
}

.card-header {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
  font-weight: 600;
}

/* Positioning */
.top-left {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: start;
}

.top-right {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  min-width: 280px;
}

.bottom-left {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  justify-self: start;
  width: 420px;
}

.bottom-right {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  justify-self: end;
  text-align: right;
}

/* Clock & Weather Details */
.clock-display {
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.date-display {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
  font-weight: 400;
}

.weather-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 1.1rem;
}

.weather-icon {
  font-size: 1.5rem;
}

.weather-temp {
  font-weight: 700;
}

.weather-condition {
  color: rgba(255, 255, 255, 0.75);
}

/* Forecast Mini-list */
.forecast-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forecast-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.forecast-day {
  width: 50px;
  font-weight: 500;
}

.forecast-temp {
  font-weight: 600;
}

/* Calendar Events List */
.calendar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 180px;
  overflow: hidden;
}

.calendar-event-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Photo Metadata */
.photo-location {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.photo-date {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

.photos-badge {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.favorite-star {
  color: #ffcc00;
  font-size: 1.1rem;
  display: none;
}

.favorite-star.active {
  display: inline;
}

/* Sleep Screen */
.sleep-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.sleep-clock {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.15);
  font-weight: 300;
}

.hidden {
  display: none !important;
}

/* Portrait Orientation Adaptations for Lenovo Smart Frame */
@media (orientation: portrait) {
  .hud-overlay {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    padding: 24px;
  }

  .top-left {
    grid-column: 1;
    grid-row: 1;
  }

  .top-right {
    grid-column: 1;
    grid-row: 2;
    margin-top: 16px;
    justify-self: start;
    width: 100%;
  }

  .bottom-left {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    width: 100%;
  }

  .bottom-right {
    grid-column: 1;
    grid-row: 4;
    text-align: left;
    justify-self: start;
    margin-top: 16px;
  }

  .photos-badge {
    justify-content: flex-start;
  }
}
