/*Design tokens*/
:root{
  --ink: #2c2c2c;
  --ink-sub: #252020;
  --accent: #DBB777;
  --radius-lg: 1rem;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  background: #f8f7f4;
  color: var(--ink);
}

/*Sidebar contents*/
.app-sidebar {
  padding: 1rem;
}
.app-main {
  padding: 1rem;
}
.sidebar-menu {
  background: #EFEBE1;
  margin: 0;
  padding: 1.25rem 1rem;
  border-right: 1px solid rgba(0,0,0,.04);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}
.app-title {
  margin-bottom: 1rem;
  padding-top: .5rem;
  text-align: center;
}
.app-title img {
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto .5rem auto;
  display: block;
}
.app-title h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .2px;
  margin-bottom: .25rem;
}
.app-title p {
  font-size: 1.2rem;
  color: var(--ink-sub);
  margin-bottom: .75rem;
}
.menu-link {
  display: block;
  font-size: 1.8rem;
  padding: .75rem 1rem;
  margin: .6rem 0;
  border-radius: .9rem;
  background: transparent;
  color: #4a3c1a;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
}
.menu-link:hover,
.menu-link:focus {
  color: #4a3c1a !important;
  background: rgba(0,0,0,.06);
  text-decoration: none !important;
}
.menu-link.active{
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(212,175,55,.25);
  border-color: transparent;
}

/*Page header*/
.page-header-bar{
  position: relative;
  padding-right: 1rem;
  margin-bottom: .5rem;
  z-index: 10;
}
.page-header-bar label {
  padding-left: 0 !important;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: 1.35rem;
  line-height: 1.05;
  font-weight: 500;
}
.header-right {
  position: absolute;
  right: 0;
  top: .25rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .45rem;
  z-index: 50;
}

/*Language dropdown*/
.lang-dropdown{ 
  position: relative;
  display: inline-block;
  user-select: none;
  margin-top: 0;
}
.selected-lang{
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem;
  border-radius: .6rem;
  transition: background .15s;
  padding-top: .3rem;
}
.selected-lang:hover{ 
  background: rgba(0,0,0,.05);
}
.lang-text{ 
  font-size: 1.4rem;
  font-weight: 600;
  position: relative;
  top: 1px;
}
.flag{ 
  width: 30px;
  height: 30px;
  object-fit: cover;
  vertical-align: middle;
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,.08);
}
.lang-menu{
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: .35rem;
  list-style: none;
  padding: .25rem;
  background: #ffffff;
  border-radius: .7rem;
  box-shadow: var(--shadow-md);
  z-index: 3000;
  min-width: 170px;
}
.lang-menu li{ 
  padding: .55rem .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: .5rem;
}
.lang-menu li:hover{
  background: #f2f2f2;
}
.lang-menu.show{
  display: block;
}

/*Map/Cards*/
.leaflet-container{
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
/*Rodrigue*/
.plot-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 10px 15px;
  margin-bottom: 20px;
  overflow: visible;
}

.map-checkboxes-row{
  display: flex;
  justify-content: flex-end;
  margin: 0 0 .25rem 0;
}
.map-checkboxes{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .15rem;
  width: max-content;
}
.map-checkboxes label{
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
}
.checkbox, .form-group{
  margin-bottom: .6rem;
}
h4{
  margin-top: 0;
  font-weight: 700;
  letter-spacing: .2px;
}

/*Info/Chart overlay*/
.info-chart-container{
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  margin-bottom: 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
#bearStatsText .stat-line {
  font-size: 1.3rem;
  line-height: 1.8;
  width: 200px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#bearStatsText .stat-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
#bearChart {
  max-width: 350px !important;
  max-height: 250px !important;
  display: block;
}

#bearStatsText .bear-header {
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  display: block !important;
  margin-bottom: 8px !important;
  color: var(--ink) !important;
}

/* Disclaimer section */
.disclaimer-box {
  position: relative;
  background: #EFEBE1;
  border: 1px solid #e5e6a1;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 20px;
  max-width: 830px;
}
.disclaimer-box a {
  color: #727227;
  text-decoration: none;
  font-weight: 500;
}
.disclaimer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.disclaimer-body {
  margin-top: 6px;
}
.disclaimer-close {
  position: absolute;
  top: 5px;
  right: 10px;
  border: none;
  background: transparent;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.disclaimer-close:hover {
  color: #000;
}
#discToggle {
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}
.disclaimer-box.is-collapsed .disclaimer-body,
.disclaimer-box.is-collapsed .disclaimer-close {
  display: none;
}
.disclaimer-box.is-open #discToggle {
  display: none;
}
/*Rodrigue*/
.date-filter-mode-select {
  margin-top: 5px;
}
.date-filter-inline{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 8px 10px 3px 10px;
}

/*Info/Filter button*/
.plain-icon-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  line-height: 0;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  cursor: pointer;
}
.plain-icon-btn .map-btn-icon {
  width: 25px;
  height: 25px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.plain-icon-btn:hover .map-btn-icon {
  filter: brightness(0.9);
}
#btnWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
}

/*Filter-Feld Panel*/
#filterContainer {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: auto !important;
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  z-index: 2000;
  max-width: 150px;
  max-height: 70vh;
  overflow-y: auto;
}
#filterContainer .shiny-input-checkboxgroup label {
  display: block;
  margin-bottom: 4px;
}

/*Rodgriue*/
.filter-type-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-type-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}


/*cluster style*/
.leaflet-marker-icon.marker-cluster {
  background-color: rgba(200,200,200,0.4) !important;
}
.leaflet-marker-icon.marker-cluster > div {
  background-color: rgba(240,240,240,0.8) !important;
}

/* Definiert die feste Positionierung */
.fixed-bottom-right {
    position: fixed; /* Fixiert relativ zum Browser-Fenster */
    bottom: 20px;    /* 20 Pixel Abstand vom unteren Rand */
    right: 20px;     /* 20 Pixel Abstand vom rechten Rand */
    z-index: 1000;   /* Stellt sicher, dass das Popup über anderen Elementen liegt */
    max-width: 300px; /* Begrenzt die Breite */
    background: rgba(255, 255, 255, 0.95); /* Leicht transparente weiße Hintergrundfarbe */
  border: 1px solid #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 15px;
  border-radius: 8px;
}

/* Optional: Styling für das Popup selbst, falls nicht schon in .layer-info-popup definiert */
.layer-info-popup h4 {
  margin-top: 5px;
  margin-bottom: 8px;
  font-size: 1.1em;
}
.layer-info-popup p {
  font-size: 0.9em;
  margin-bottom: 5px;
}

/* Stil für den Schließen-Button */
.layer-info-popup .close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  line-height: 1;
}

/*Ticker*/
.ticker-box {
  background: rgba(255, 255, 255, 0.95); 
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin: 12px 0 18px 0;

  box-shadow: var(--shadow-sm);

  max-height: 100%;
  overflow-y: auto;
}
.ticker-header {
  font-size: 1.8rem;
  color: #4a3c1a;
  font-weight: 700;
  text-decoration: none;
}
.ticker-item {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  color: var(--ink);
  font-size: 1.25rem; 
  line-height: 1.35;
}
.ticker-item:last-child {
  border-bottom: none;
}
.ticker-date {
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ticker-location {
  font-size: 1.1rem;
  color: var(--ink-sub);
}

/*Submenu*/
.submenu {
  margin-top: -0.2rem;
  margin-bottom: 0.7rem;
  padding-left: 0.6rem;
}
.menu-sublink{
  display: block;
  font-size: 1.4rem;
  padding: .45rem .9rem;
  margin: .25rem 0 .25rem .75rem;
  border-radius: .75rem;
  text-decoration: none;
  color: #4a3c1a;
  font-weight: 600; 

}
.menu-sublink:hover,
.menu-sublink:focus{
  background: rgba(0,0,0,.07);
  text-decoration: none !important;
  color: #4a3c1a !important;
}
.menu-sublink.active{
  background: var(--accent);
  color: #fff;
}
.menu-link-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.submenu-caret{
  font-size: 1.6rem;
  font-weight: 900;
  color: #4a3c1a;
  text-decoration: none;
  padding: .2rem .6rem;
  border-radius: .6rem;
}
.submenu-caret:hover{
  background: rgba(0,0,0,.06);
  text-decoration: none;
}
.submenu{
  position: relative;
  margin-top: -0.2rem;
  margin-bottom: 0.7rem;
  padding-left: 1.2rem;
  margin-left: 0.3rem;
}
.submenu::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0.25rem;
  bottom: 0.25rem;

  width: 8px;
  background: var(--accent);  
  border-radius: 999px;
}
.menu-link.stats-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.menu-link.stats-header .stats-label{
  flex: 1;
  color: inherit;
  text-decoration: none;
}
.menu-link.stats-header .submenu-caret{
  font-size: 1.6rem;
  font-weight: 900;
  color: inherit;         
  text-decoration: none;
  padding: .2rem .6rem;
  border-radius: .6rem;
  line-height: 1;
}
.menu-link.stats-header .submenu-caret:hover{
  background: rgba(0,0,0,.08);
  text-decoration: none;
}

.plot-container {
  position: relative !important; 
}

.last-sighting-container {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 99999;
  pointer-events: auto;
}
.last-sighting-btn {
  background: white !important;
  border-radius: 50% !important;
  border: 1px solid #ccc !important;
  width: 48px !important;
  height: 48px !important;
  padding: 3px 6px 4px 4px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.last-sighting-btn img {
  width: 40px;
  height: 40px;
}

.last-sighting-container .ticker-box {
  margin-top: 8px;
  background: rgba(255,255,255,0.95);
  padding: 12px;
  border-radius: 12px;
  width: 260px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.ticker-box {
  position: absolute;
  bottom: 60px; 
  left: 0;
  width: 260px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 0x;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  display: none; 
}

.last-sighting-container .ticker-header {
  font-weight: bold;
  margin-bottom: 10px;
}
