/* ============================================
   Webkamery Horni Slavkov - LajsiNET
   Merged production stylesheet
   ============================================ */

/* --- Variables --- */
:root {
  --sky-50: #f0f7ff;
  --sky-100: #e0efff;
  --sky-200: #b9ddff;
  --sky-400: #47a3f3;
  --sky-500: #2b8be0;
  --sky-600: #1a73c7;
  --meadow-50: #f0fdf4;
  --meadow-400: #4ade80;
  --meadow-600: #16a34a;
  --sunset-50: #fff7ed;
  --sunset-400: #fb923c;
  --coral-400: #f87171;
  --coral-600: #dc2626;
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.06), 0 16px 40px rgba(0,0,0,0.1);
}

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

/* --- Base --- */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--sky-50);
  color: var(--stone-800);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(71,163,243,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(74,222,128,0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* --- Header --- */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--stone-200);
  padding: 0 2rem;
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

/* Brand (index page) */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--sky-400), var(--sky-600));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(43,139,224,0.3);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--white);
}

.brand-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--stone-800);
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.78rem;
  color: var(--stone-500);
  font-weight: 400;
}

/* Back link (detail page) */
.back-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--stone-100);
  color: var(--stone-600);
  text-decoration: none;
  font-size: 1.2rem;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.back-link:hover {
  background: var(--sky-100);
  color: var(--sky-600);
}

/* Header title (detail page) */
.header-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.header-title h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.header-title span {
  font-size: 0.78rem;
  color: var(--stone-400);
}

/* Header status */
.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--meadow-50);
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid rgba(22,163,74,0.15);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--meadow-400);
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--meadow-400);
  opacity: 0;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.header-status span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--meadow-600);
}

/* --- Hero section (index page) --- */
.hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.5rem 2rem 0.5rem;
}

.hero h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--stone-800);
  margin-bottom: 0.4rem;
}

.hero p {
  color: var(--stone-500);
  font-size: 1rem;
  max-width: 520px;
}

/* --- Camera grid (index page) --- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1320px;
  margin: 0 auto;
}

.cam-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.cam-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: border-color 0.3s ease;
  pointer-events: none;
}

.cam-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.cam-card:hover::after {
  border-color: var(--sky-400);
}

/* --- Camera image area (overview cards) --- */
.cam-image {
  position: relative;
  aspect-ratio: 32/9;
  overflow: hidden;
}

.cam-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cam-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--stone-400);
}

.cam-placeholder.sky {
  background: linear-gradient(170deg, #d4eafc 0%, #eef6ff 40%, #fef9f0 100%);
}

.cam-placeholder.meadow {
  background: linear-gradient(170deg, #d1f5dc 0%, #edfff3 40%, #f0f7ff 100%);
}

.cam-placeholder.snow {
  background: linear-gradient(170deg, #e2eeff 0%, #f4f0ff 40%, #fff5f5 100%);
}

.cam-placeholder svg {
  width: 40px;
  height: 40px;
  fill: var(--stone-300);
}

.cam-placeholder .cam-location {
  font-weight: 600;
  color: var(--stone-600);
  font-size: 0.95rem;
}

.cam-placeholder .cam-hint {
  font-size: 0.75rem;
  color: var(--stone-400);
}

.cam-placeholder .label {
  font-weight: 600;
  color: var(--stone-600);
  font-size: 1.1rem;
}

.cam-placeholder .hint {
  font-size: 0.8rem;
}

/* --- Live badge --- */
.live-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--coral-600);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(220,38,38,0.35);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
  animation: blink 1.4s infinite;
}

/* --- Timestamp overlay --- */
.time-overlay {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  color: var(--white);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: 'DM Sans', monospace;
  font-weight: 500;
}

/* --- Card info (index page) --- */
.cam-info {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cam-name {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--stone-800);
}

.cam-age {
  font-size: 0.8rem;
  color: var(--stone-400);
  margin-top: 2px;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  background: var(--meadow-50);
  color: var(--meadow-600);
  border: 1px solid rgba(22,163,74,0.15);
  letter-spacing: 0.02em;
}

.status-pill.offline {
  background: #fef2f2;
  color: var(--coral-600);
  border-color: rgba(220,38,38,0.15);
}

/* --- Main content (detail page) --- */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

/* --- Camera view (detail page) --- */
.camera-view {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--white);
  animation: fadeUp 0.5s ease-out both;
}

/* Detail page: show full panoramic image, no cropping */
.camera-image {
  position: relative;
  overflow: hidden;
}

.camera-image img,
.camera-image .detail-image {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Timeline slider --- */
.timeline-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px 24px;
  margin-top: 1rem;
  animation: fadeUp 0.5s ease-out 0.1s both;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.timeline-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--stone-600);
}

.timeline-count {
  font-size: 0.78rem;
  color: var(--stone-400);
}

.slider-track {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--sky-400) 0%, var(--sky-200) 100%);
  outline: none;
}

.slider-track::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--sky-500);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform 0.15s;
}

.slider-track::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.timeline-info {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--stone-400);
}

/* --- Action buttons --- */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  flex-wrap: wrap;
  animation: fadeUp 0.5s ease-out 0.15s both;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--stone-200);
  background: var(--white);
  color: var(--stone-700);
  cursor: pointer;
}

.action-btn:hover {
  border-color: var(--sky-400);
  color: var(--sky-600);
  background: var(--sky-50);
}

.action-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- Tabs --- */
.tabs-wrapper {
  margin-top: 2rem;
  animation: fadeUp 0.5s ease-out 0.2s both;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--white);
  padding: 4px;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  width: fit-content;
}

.tab {
  padding: 10px 22px;
  background: none;
  border: none;
  color: var(--stone-500);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 9px;
  transition: all 0.25s;
  font-family: inherit;
}

.tab:hover {
  color: var(--stone-700);
  background: var(--stone-50);
}

.tab.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--sky-400), var(--sky-600));
  box-shadow: 0 2px 8px rgba(43,139,224,0.3);
}

/* --- Tab content --- */
.tab-content {
  margin-top: 1.5rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.live-note {
  color: var(--stone-500);
  font-size: 0.85rem;
  background: var(--white);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

/* --- Day picker --- */
.day-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.day-picker input[type="date"] {
  background: var(--white);
  border: 1px solid var(--stone-200);
  color: var(--stone-700);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.day-picker input[type="date"]:focus {
  outline: none;
  border-color: var(--sky-400);
  box-shadow: 0 0 0 3px rgba(71,163,243,0.15);
}

.day-count {
  font-size: 0.82rem;
  color: var(--stone-400);
}

/* --- History thumbnail grid --- */
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.thumb-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.thumb-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.thumb-item.active {
  border-color: var(--sky-400);
}

/* Thumbnails: panoramic ratio matching cameras */
.thumb-image {
  aspect-ratio: 32/9;
  object-fit: cover;
  width: 100%;
  display: block;
}

.thumb-image-placeholder {
  aspect-ratio: 32/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--stone-400);
}

.thumb-image.morning { background: linear-gradient(135deg, #fde6c8 0%, #fef3e0 100%); color: #c27722; }
.thumb-image.midday  { background: linear-gradient(135deg, #c8e4fd 0%, #e6f2ff 100%); color: #3a7ec2; }
.thumb-image.evening { background: linear-gradient(135deg, #e0ccf5 0%, #f0e8fa 100%); color: #7c52b8; }
.thumb-image.neutral { background: linear-gradient(135deg, #e7e5e4 0%, #f5f5f4 100%); }

.thumb-time {
  text-align: center;
  font-size: 0.75rem;
  padding: 6px;
  color: var(--stone-500);
  font-weight: 500;
}

/* --- Archive section --- */
.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--stone-600);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}

.section-label:first-child { margin-top: 0; }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.archive-day {
  background: var(--white);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.archive-day:hover {
  border-color: var(--sky-400);
  background: var(--sky-50);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.archive-day .day-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--stone-700);
  line-height: 1;
}

.archive-day .day-month {
  font-size: 0.75rem;
  color: var(--stone-400);
  margin-top: 4px;
}

.archive-day .day-images {
  font-size: 0.72rem;
  color: var(--sky-500);
  font-weight: 600;
  margin-top: 8px;
}

.archive-day.month-card .day-num {
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--stone-200);
  margin: 1.5rem 0 0;
}

/* --- Footer --- */
.footer {
  max-width: 1320px;
  margin: 3rem auto 0;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--stone-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--stone-400);
  font-size: 0.78rem;
}

.footer a {
  color: var(--sky-500);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover { text-decoration: underline; }

/* --- Animations --- */
@keyframes ping {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

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

/* Entrance animations */
.hero { animation: fadeUp 0.6s ease-out both; }
.cam-card:nth-child(1) { animation: fadeUp 0.6s ease-out 0.15s both; }
.cam-card:nth-child(2) { animation: fadeUp 0.6s ease-out 0.25s both; }
.cam-card:nth-child(3) { animation: fadeUp 0.6s ease-out 0.35s both; }

/* --- Responsive breakpoints --- */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  /* Index page */
  .grid { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
  .header-inner { height: 60px; }
  .header { padding: 0 1rem; }
  .hero { padding: 1.5rem 1rem 0.5rem; }
  .hero h2 { font-size: 1.5rem; }
  .brand-text h1 { font-size: 1.1rem; }
  .header-status span { display: none; }
  .footer { flex-direction: column; gap: 0.5rem; text-align: center; }

  /* Detail page */
  .main { padding: 1rem; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; padding: 10px 12px; font-size: 0.8rem; }
  .history-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .archive-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
