:root {
  --sidebar-width: 340px;
  --accent: #4e7a45;
  --accent-dark: #35562f;
  --surface: #ffffff;
  --surface-muted: #f3f6f3;
  --border: #d6dfd4;
  --text: #24323d;
  --text-muted: #5f6d77;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--surface-muted);
}

a {
  color: #2a5d90;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: relative;
  z-index: 1000;
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition:
    transform 0.25s ease,
    margin-right 0.25s ease,
    box-shadow 0.25s ease;
}

.sidebar__inner {
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
  margin-right: calc(-1 * var(--sidebar-width));
}

.main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100vh;
  background: #dbe4dd;
}

.item-sidebar {
  margin-bottom: 18px;
}

.brand-card {
  border: none;
  box-shadow: none;
}

.brand-card__body {
  position: relative;
  padding: 6px 0 0;
}

#logo {
  display: block;
  width: 88%;
  max-width: 240px;
  margin: 0 auto;
}

.closebtn {
  position: absolute;
  top: -18px;
  right: -4px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  padding: 4px 8px;
}

.closebtn:hover,
.closebtn:focus {
  color: var(--accent);
  text-decoration: none;
  outline: none;
}

.status-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.status-text:empty {
  display: none;
}

.language-switch {
  display: flex;
  gap: 8px;
  align-items: center;
}

.language-switch__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.language-switch__button:hover,
.language-switch__button:focus {
  border-color: var(--accent);
  color: var(--accent-dark);
  outline: none;
  transform: translateY(-1px);
}

.language-switch__button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.language-switch__flag {
  font-size: 14px;
  line-height: 1;
}

.result-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
}

.result-secondary {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.preview-card {
  margin-bottom: 18px;
}

.preview-card img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.preview-name {
  color: var(--text-muted);
  font-style: italic;
}

.sidebar-footer .panel-body {
  padding: 14px 12px;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2a5d90;
}

.link-button:hover,
.link-button:focus {
  color: #1b4267;
  text-decoration: underline;
  outline: none;
}

.powered-by {
  margin-bottom: 0;
  color: #495851;
}

#refreshButton {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 14px 16px 14px 12px;
  border: 0;
  border-radius: 0 16px 16px 0;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 24px rgba(36, 50, 61, 0.22);
}

body.sidebar-collapsed #refreshButton {
  display: inline-flex;
}

#refreshButton::before {
  content: '\2630';
  font-size: 18px;
  line-height: 1;
}

#refreshButton:hover,
#refreshButton:focus {
  background: var(--accent-dark);
  outline: none;
}

.leaflet-control-layers-toggle {
  width: 42px;
  height: 42px;
  background: #ffffff !important;
  border-radius: 10px;
  position: relative;
  text-indent: -9999px;
  overflow: hidden;
}

.leaflet-control-layers-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 18px;
  height: 2px;
  margin-top: -1px;
  margin-left: -9px;
  background: var(--accent-dark);
  box-shadow:
    0 -6px 0 0 var(--accent-dark),
    0 6px 0 0 var(--accent-dark);
  border-radius: 999px;
  pointer-events: none;
}

.leaflet-touch .leaflet-control-layers-toggle {
  width: 46px;
  height: 46px;
}

.leaflet-touch .leaflet-control-layers-toggle::before,
.leaflet-retina .leaflet-control-layers-toggle::before {
  width: 20px;
  margin-left: -10px;
}

.list-group-item.active,
.list-group-item.active:focus,
.list-group-item.active:hover {
  border-color: var(--accent);
  background-color: var(--accent);
}

.my-tooltip-class {
  border: none;
  border-radius: 6px;
  background: rgba(23, 33, 27, 0.92);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
}

.leaflet-tooltip.my-tooltip-class::before {
  display: none;
}

.room-code-marker {
  position: relative;
  width: 0;
  height: 0;
  overflow: visible;
  background: transparent;
  border: none;
}

.room-code-marker__label {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(23, 33, 27, 0.92);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transform: translate(
    calc(-50% + var(--label-dx, 0px)),
    calc(-50% + var(--label-dy, 0px))
  );
  pointer-events: auto;
}

@media (max-width: 767px) {
  :root {
    --sidebar-width: min(88vw, 360px);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    box-shadow: 0 14px 36px rgba(16, 24, 18, 0.18);
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    margin-right: 0;
  }

  .sidebar__inner {
    padding: 16px;
  }

  .closebtn {
    top: -12px;
    right: -6px;
  }

  #refreshButton {
    min-height: 56px;
    padding: 16px 18px 16px 12px;
    font-size: 16px;
  }

  .leaflet-control-layers-toggle {
    width: 48px;
    height: 48px;
  }

  .leaflet-control-layers-toggle::before {
    width: 20px;
    margin-left: -10px;
  }
}
