body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
}

body p {
  font-size: 0.85em;

  margin-left: 0.8em;
  color: #555;
/*font-family: sans-serif;
  margin: 0;
  padding: 0;*/
}

header#main-header {
  background: #f8f8f8;
  padding: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #ccc;
}

header h1 {
  font-size: 1.3em;
  margin: 3px 0;
}

header h2 {
  font-size: 1.1em;
  margin: 3px 0;
}

header p {
  font-size: 0.85em;
  margin: 6px 0;
    margin-left: 0.9em;
  color: #555;
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sticky-hour-index {
  position: sticky;
  top: 105px;
  background: white;
  padding: 5px;
  overflow-x: auto;
  white-space: nowrap;
  z-index: 9;
  border-bottom: 1px solid #ccc;
}

.sticky-hour-index button {
  margin-right: 5px;
  padding: 4px 8px;
  font-size: 0.8em;
}

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

.thumb-container {
  text-align: center;
}

.thumb-container img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s;
}

.thumb-container img:hover {
  transform: scale(1.05);
}

.thumb-container label {
  display: block;
  font-size: 0.75em;
  margin-top: 4px;
  cursor: pointer;
}

#viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#viewer-content {
  position: relative;
  min-width: 300px;
  min-height: 200px;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#viewer-img {
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 80vh;
  object-fit: contain;
  display: none; /* pokazywane po załadowaniu */
}

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2em;
  color: white;
  cursor: pointer;
  user-select: none;
  padding: 0 10px;
  opacity: 0.2;
}


.viewer-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20%;
  height: 80vh;
    cursor: pointer;
  z-index: 100;
}
.viewer-left {
  left: 0;
}

.viewer-right {
  right: 0;
}
.viewer-nav:hover {
  opacity: 0.8;
}

.viewer-nav.left {
  left: 0;
}

.viewer-nav.right {
  right: 0;
}
.viewer-arrow {
  position: absolute;
  top: 80%;
  font-size: 3em;
  color: white;
  opacity: 0.5;
  pointer-events: none;
  z-index: 101;
  transform: translateY(-50%);
}



.viewer-arrow-left {
  left: 10px;
}
.viewer-arrow-right {
  right: 10px;
}

#viewer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  font-size: 2em;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 201;
}

#viewer-info {
  color: white;
  margin-top: 10px;
  font-size: 0.9em;
  z-index: 1010;
}
#viewer-info input[type="checkbox"] {
  position: relative;
  z-index: 1200;
}
#viewer-error {
  display: none;
  color: white;
  margin-top: 1em;
  font-style: italic;
}
#result-box {
  max-width: 600px; /* lub np. 80% jeśli chcesz procentowo */
  margin: 20px auto;
  padding: 1em;
  background: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

#result-text {
  width: 100%;
  box-sizing: border-box;
  font-family: monospace;
  font-size: 0.9em;
  white-space: pre; /* nie zawija tekstu */
}

#hour-index {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  justify-content: flex-start; 
}

#hour-index button {
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.85em;
  transition: background-color 0.2s;
}

#hour-index button:hover {
  background-color: #ddd;
}


.thumb-container.selected {
  background-color: #e0f7fa;
  border: 2px solid #00796b;
  border-radius: 8px;
}

#viewer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  position: relative;
}



#viewer-error {
  color: white;
  font-style: italic;
  margin-top: 1em;
  display: none;
}

#viewer-error {
  color: white;
  font-style: italic;
  margin-top: 1em;
  display: none;
}

#gallery-subtitle select {
  font-size: 1.1em;
  font-weight: bold;
  font-family: inherit;
  background: none;
  border: none;
  color: #333;
  padding: 0;
  margin: 0;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.menu-icon {
  font-weight: bold;
  font-size: 1.2em;
  margin-right: 8px;
  color: #555;
  vertical-align: middle;
}

#gallery-subtitle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.dropdown-label {
  display: flex;
  align-items: center;
  background: #eee;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.9em;
  border: 1px solid #ccc;
  cursor: pointer;
}

.menu-icon {
  font-size: 1.2em;
  margin-right: 6px;
  user-select: none;
}



#page-footer {
  text-align: center;
  padding: 1em;
  font-size: 0.9em;
  color: #777;
  border-top: 1px solid #ddd;
  margin-top: 2em;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1em;
  text-align: center;
}

#reload-button {
  order: -1; /* Przycisk najpierw po lewej */
  align-self: flex-start;
  margin-right: auto;
  background: none;
  border: none;
  color: #0077cc;
  cursor: pointer;
  font-size: 0.9em;
  padding: 0;
}

#reload-button:hover {
  text-decoration: underline;
}

#footer-text {
  flex: 1 1 auto;
}
.top-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid #ccc;
  background: #f8f8f8;
  font-size: 0.9em;
}

#selected-count {
  font-size: 0.9em;
  color: #333;
}



.hour-button {
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.85em;
  line-height: 1.2;
  margin: 0.2em;
  cursor: pointer;
  transition: background-color 0.2s;
  appearance: none;
  box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
}

.hour-button:hover {
  background-color: #ddd;
}
.separator {
  margin: 0 0.6em;
  color: #ccc;
  font-weight: normal;
  font-size: 1.5em;
  user-select: none;
  vertical-align: middle;
}
#gallery-select {
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.85em;
  cursor: pointer;
  transition: background-color 0.2s;
  appearance: none;
  box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='16' viewBox='0 0 24 24' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6em center;
  background-size: 1em;
  padding-right: 2em; /* miejsce na ikonę */
}

#gallery-select:hover {
  background-color: #f0f0f0;
}

#gallery-select:focus {
  outline: none;
  border-color: #999;
}