/* Barevné šablony a styly pro vygenerovaný web dovolené */

/* Světlé schéma (Light) */
body.scheme-light {
  --bg: #f3f4f6;
  --paper: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --panel-shadow: rgba(0, 0, 0, 0.08);
  --header-grad: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

/* Tmavé schéma (Dark) */
body.scheme-dark {
  --bg: #0f172a;
  --paper: #1e293b;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --border: #334155;
  --panel-shadow: rgba(0, 0, 0, 0.3);
  --header-grad: linear-gradient(135deg, #0f172a, #1e293b);
}

/* Oceánská modř (Blue) */
body.scheme-blue {
  --bg: #0f172a;
  --paper: #1e3a8a;
  --ink: #f0f4f8;
  --muted: #93c5fd;
  --border: #1e40af;
  --panel-shadow: rgba(0, 0, 0, 0.25);
  --header-grad: linear-gradient(135deg, #1e3a8a, #2563eb);
}

/* Lesní zeleň (Green) */
body.scheme-green {
  --bg: #022c22;
  --paper: #064e3b;
  --ink: #f0fdf4;
  --muted: #6ee7b7;
  --border: #065f46;
  --panel-shadow: rgba(0, 0, 0, 0.25);
  --header-grad: linear-gradient(135deg, #022c22, #059669);
}

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

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: var(--bg);
  overflow: hidden;
  transition: all 0.3s ease;
}

#app {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100%;
}

aside {
  background-color: var(--paper);
  border-right: 1px solid var(--border);
  box-shadow: 0 0 24px var(--panel-shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 1000;
  overflow: hidden;
}

header {
  padding: 24px 20px 16px;
  background: var(--header-grad);
  color: #ffffff;
}

header h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

header p {
  font-size: 13px;
  opacity: 0.85;
}

header .intro-desc {
  font-size: 13px;
  margin-top: 10px;
  line-height: 1.45;
  opacity: 0.9;
}

.toolbar {
  padding: 12px;
  background-color: var(--paper);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar button {
  font-family: inherit;
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 6px;
  background-color: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar button:hover {
  background-color: var(--border);
}

.days-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-card {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-left: 6px solid var(--c);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.day-head input {
  margin-top: 3px;
  accent-color: var(--c);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.day-info {
  flex: 1;
  cursor: pointer;
}

.day-name {
  font-size: 14px;
  font-weight: 700;
}

.day-title {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.day-summary {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  padding-left: 26px;
  opacity: 0.95;
}

/* Náhledy fotek u jednotlivých dnů */
.day-photos {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-left: 26px;
  margin-top: 6px;
  scrollbar-width: thin;
}

.day-photos img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.day-photos img:hover {
  transform: scale(1.05);
}

.footer-note {
  padding: 12px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--border);
  background-color: var(--paper);
}

#map {
  height: 100%;
  width: 100%;
}

/* Custom Leaflet Pins */
.pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid white;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin > span {
  transform: rotate(45deg);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.pin.stay {
  width: 34px;
  height: 34px;
  border-width: 3px;
}

.pin.stay::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
  right: -2px;
  top: -2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

/* Popup design */
.leaflet-popup-content-wrapper {
  background-color: var(--paper) !important;
  color: var(--ink) !important;
  border-radius: 8px !important;
  border: 1px solid var(--border);
  font-family: inherit;
}

.leaflet-popup-tip {
  background-color: var(--paper) !important;
}

.popup-content h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.popup-content .meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.popup-content p {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 8px;
}

.popup-photos {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 6px;
}

.popup-photos img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
  cursor: pointer;
}

.popup-links a {
  font-size: 11px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.popup-links a:hover {
  text-decoration: underline;
}

/* Login box style */
#login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #12181f;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.login-box {
  background-color: #1a222d;
  border: 1px solid #2d3b4e;
  padding: 40px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.login-box .icon {
  font-size: 40px;
  margin-bottom: 15px;
}

.login-box h2 {
  font-size: 20px;
  color: #f0f4f8;
  margin-bottom: 10px;
}

.login-box p {
  font-size: 13px;
  color: #8b9bb4;
  margin-bottom: 20px;
}

.login-box input {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #2d3b4e;
  background-color: #242f3e;
  color: #f0f4f8;
  font-size: 14px;
  outline: none;
  margin-bottom: 15px;
  text-align: center;
}

.login-box button {
  width: 100%;
  padding: 12px;
  background-color: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.login-box button:hover {
  background-color: #3b82f6;
}

/* Gallery Modal style */
#gallery-modal {
  display: none;
  position: fixed;
  z-index: 15000;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
}

.gallery-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 1000px;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

#gallery-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 1000px;
  text-align: center;
  color: #ccc;
  padding: 15px 0;
  font-size: 15px;
}

.close-gallery {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.close-gallery:hover {
  color: #bbb;
}

/* Navigační tlačítka v galerii */
.nav-gallery {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 32px;
  padding: 12px;
  cursor: pointer;
  border-radius: 50%;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
  z-index: 16000;
}

.nav-gallery:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.08);
}

.nav-gallery.prev {
  left: 25px;
}

.nav-gallery.next {
  right: 25px;
}

/* Responsivita na mobilu */
@media (max-width: 768px) {
  .nav-gallery {
    font-size: 20px;
    width: 46px;
    height: 46px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  .nav-gallery.prev {
    left: 10px;
  }
  .nav-gallery.next {
    right: 10px;
  }
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 40% 60%;
  }

  aside {
    border-right: none;
    border-bottom: 1px solid var(--border);
    height: 100%;
  }

  #map {
    height: 100%;
  }

  header {
    padding: 14px 16px 10px;
  }

  header h1 {
    font-size: 18px;
  }

  header .intro-desc {
    display: none;
  }

  .day-summary {
    display: none; /* Skrýt dlouhé texty na mobilu pro úsporu místa */
  }

  .day-photos {
    padding-left: 0;
  }
}

/* Color Options on Web */
.web-color-options {
  display: flex;
  gap: 6px;
}

.web-color-option {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.web-color-option:hover {
  transform: scale(1.2);
}

.web-color-option.active {
  border-color: var(--ink) !important;
  transform: scale(1.1);
  box-shadow: 0 0 0 1.5px var(--border);
}

.web-color-option.light { background-color: #ffffff; border-color: #cbd5e1; }
.web-color-option.dark { background-color: #12181f; border-color: #3b4252; }
.web-color-option.blue { background-color: #1e3a8a; border-color: #3b82f6; }
.web-color-option.green { background-color: #064e3b; border-color: #10b981; }

/* Legend Styles */
.map-legend {
  position: absolute;
  bottom: 25px;
  right: 10px;
  z-index: 1000;
  background-color: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  max-width: 280px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.legend-toggle-btn {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background 0.2s;
}

.legend-toggle-btn:hover {
  background: var(--border);
}

.legend-content {
  display: none;
  width: 260px;
  padding: 12px;
  border-top: 1px solid var(--border);
  max-height: 250px;
  overflow-y: auto;
}

.map-legend.expanded .legend-content {
  display: block;
}

.legend-content h4 {
  font-size: 13px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--ink);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--ink);
  text-align: left;
}

.legend-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}

.legend-day-num {
  font-weight: 700;
  color: var(--ink);
}
