/* ============================================
   GORJE.CSS - Modern, responsive, glassmorphic
   ============================================ */

:root {
  --bg: #050b12;
  --panel: rgba(8, 14, 22, 0.2);
  --border: rgba(255,255,255,0.08);
  --text: #ffffff;
  --muted: rgba(255,255,255,0.74);
  --accent: #ff6b4a;
  --radius: 22px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  position: relative;
}

/* CAMERA BACKGROUND - vedno viden */
.camera-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.camera-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,0.58), rgba(0,0,0,0.05) 45%),
    linear-gradient(to right, rgba(0,0,0,0.34), transparent 30%),
    linear-gradient(to left, rgba(0,0,0,0.18), transparent 30%);
  pointer-events: none;
}

/* TOPBAR - fix na velikih zaslonih */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 20;
  padding: 30px;
  pointer-events: none;
}

.hero-info {
  pointer-events: auto;
}

.hero-info h1 {
  font-size: clamp(34px, 4vw, 62px);
  line-height: 0.92;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 8px 28px rgba(0,0,0,0.5);
  letter-spacing: -0.04em;
}

.hero-info p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  text-shadow: 0 4px 14px rgba(0,0,0,0.45);
}

.refresh-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}

.refresh-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}

.timer-number {
  font-weight: 700;
  font-family: monospace;
  font-size: 15px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.status-dot.green {
  background: #00ff99;
  box-shadow: 0 0 10px #00ff99;
}

.status-dot.red {
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444;
}

/* WEATHER - privzeto fixed na velikih zaslonih */
.floating-weather {
  position: fixed;
  left: 30px;
  bottom: 30px;
  z-index: 30;
  width: min(430px, calc(100vw - 60px));
}

.weather-hud {
  padding: 24px;
  border-radius: 28px;
  background: rgba(8, 14, 22, 0.12);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.weather-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.weather-label {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 10px;
}

.weather-big {
  display: flex;
  align-items: flex-start;
  line-height: 1;
}

.weather-big span {
  font-size: 76px;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.weather-big small {
  font-size: 30px;
  margin-top: 10px;
  margin-left: 4px;
  color: rgba(255,255,255,0.7);
}

.weather-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 130px;
}

.weather-stat {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
}

.meta-label {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.58);
  margin-bottom: 6px;
}

.weather-stat strong {
  font-size: 24px;
  font-weight: 700;
}

.weather-bottom {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.weather-live {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.7);
}

.weather-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.weather-dot.green {
  background: #00ff99;
  box-shadow: 0 0 8px #00ff99;
}

.weather-dot.red {
  background: #ff4444;
  box-shadow: 0 0 8px #ff4444;
}

.weather-refresh {
  font-size: 13px;
  color: rgba(255,255,255,0.62);
}

/* RIGHT PANEL - privzeto fixed na velikih zaslonih */
.right-panel {
  position: fixed;
  right: 30px;
  top: 30px;
  width: min(560px, 42vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 30;
}

.glass {
  background: rgba(8,14,22,0.34);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 26px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.glass.minimized {
  background: rgba(8,14,22,0.15);
  backdrop-filter: blur(8px);
}

.glass.minimized .timelapse-preview,
.glass.minimized .panel-content,
.glass.minimized .feed-card {
  display: none;
}

.glass .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  background: rgba(0,0,0,0.2);
}

.glass .panel-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.toggle-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-btn:hover {
  background: rgba(255,255,255,0.25);
}

.timelapse-preview {
  position: relative;
  aspect-ratio: 16/9;
}

.timelapse-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timelapse-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.timelapse-preview video.active-video {
  display: block;
}

.timelapse-preview img.hidden-preview {
  display: none;
}

/* PLAY OVERLAY - samo na hover */
.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  background: rgba(0,0,0,0.2);
}

.timelapse-preview:hover .play-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Na dotičnih napravah (touch) naj se gumb pokaže ob dotiku */
@media (hover: none) and (pointer: coarse) {
  .play-overlay {
    opacity: 0.7;
    pointer-events: auto;
  }
  .timelapse-preview:hover .play-overlay {
    opacity: 0.7;
  }
}

.play-overlay button {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.16);
  color: white;
  font-size: 32px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: 0.25s ease;
  pointer-events: auto;
}

.play-overlay button:hover {
  transform: scale(1.06);
  background: rgba(255,255,255,0.22);
}

.panel-content {
  padding: 22px;
}

.panel-content h2 {
  font-size: 22px;
  margin-bottom: 18px;
}

.button-row {
  display: flex;
  gap: 12px;
}

.button-row button {
  flex: 1;
  border: none;
  border-radius: 16px;
  padding: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.primary {
  background: var(--accent);
  color: white;
}

.secondary {
  background: rgba(255,255,255,0.15);
  color: white;
}

.feed-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
}

.feed-card img {
  width: 140px;
  height: 94px;
  border-radius: 18px;
  object-fit: cover;
  cursor: pointer;
}

.feed-info h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.feed-info p {
  color: rgba(255,255,255,0.66);
  font-size: 13px;
  line-height: 1.5;
}

.media-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.84);
  backdrop-filter: blur(12px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.media-modal.active {
  display: flex;
}

.media-wrapper {
  width: min(1500px, 94vw);
  max-height: 92vh;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);
}

.media-wrapper video,
.media-wrapper img {
  width: 100%;
  display: block;
  max-height: 92vh;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 30px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.footer {
  position: fixed;
  right: 30px;
  bottom: 20px;
  z-index: 40;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 13px;
  color: rgba(255,255,255,0.72);
}

/* RESPONSIVE - samo na manjših zaslonih spremenimo layout */
@media (max-width: 1100px) {
  body {
    overflow-y: auto;
  }
  .topbar {
    position: relative;
    padding: 20px;
  }
  .right-panel {
    position: relative;
    width: calc(100% - 40px);
    margin: 20px auto 0;
    right: auto;
    top: auto;
  }
  .floating-weather {
    position: relative;
    width: calc(100% - 40px);
    left: auto;
    bottom: auto;
    margin: 20px auto;
  }
  .footer {
    position: relative;
    width: fit-content;
    margin: 20px auto;
    right: auto;
    bottom: auto;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 16px;
  }
  .hero-info h1 {
    font-size: 32px;
  }
  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .weather-big span {
    font-size: 48px;
  }
  .weather-big small {
    font-size: 24px;
  }
  .button-row {
    flex-direction: column;
  }
  .feed-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .feed-card img {
    width: 100%;
    height: auto;
  }
  .play-overlay button {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
}