body {
  font-family: Ubuntu, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f4f8;
  background: #f4f6fb;
  margin: 0;
  color: #333;
}

.container.attendance-section {
  width: 640px;
  height: 620px;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 10px #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.container.map-section {
  width: 640px;
  height: 620px; /* Fixed height to match #map */
  max-width: 100vw;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 10px #eee;
  padding: 22px 18px 18px 18px;
  text-align: center;
  box-sizing: border-box;
  overflow: visible; /* Prevent clipping */
}

.webapp-content-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 20px;
}

.webapp-content-flex > div {
  flex: 1 1 48%;
  max-width: 600px;
  background: #fff;
  padding: 22px 18px 18px 18px;
  border-radius: 18px;
  box-shadow: 0 2px 10px #eee;
  text-align: center;
  transition: box-shadow 0.2s;
  box-sizing: border-box;
}

.container {
  background: #fff;
  margin: 32px auto 0 auto;
  max-width: 420px;
  width: 96vw;
  padding: 22px 18px 18px 18px;
  border-radius: 18px;
  box-shadow: 0 2px 10px #eee;
  text-align: center;
  transition: box-shadow 0.2s;
}

.logo {
  height: 63px;
  margin-bottom: 18px;
}

h1 {
  color: #3d72b4;
  font-size: 29px;
  margin-bottom: 18px;
  margin-top: 0;
}

.info-section {
  margin-bottom: 35px;
  text-align: left;
}

.info-section p {
  margin: 20px 10px;
  font-size: 18px;
  display: flex;
  align-items: center;
  word-break: break-all;
}

.info-section p i {
  margin-right: 18px;
  color: #3d72b4;
  font-size: 18px;
  min-width: 18px;
}

.checkin-button {
  background: #3d72b4;
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-size: 18px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.checkin-button i {
  margin-right: 12px;
}

.checkin-button:hover {
  background: #1d4ed8;
}

.checkin-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.message {
  margin-top: 18px;
  font-size: 18px;
  display: block;
}

.message i {
  margin-right: 18px;
}

.error {
  color: #dc2626;
}

.success {
  color: #059669;
}

.loading {
  color: #3d72b4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.loading::before {
  content: '';
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3d72b4;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


.filter-bar {
  text-align: center;
  margin: 16px 0 12px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
}

.filter-bar label {
  margin-bottom: 2px;
  margin-right: 2px;
  display: flex;
  align-items: center;
  font-size: 15px;
}

.filter-bar select, .filter-bar input[type=month] {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #d3d3d3;
  min-width: 110px;
  max-width: 200px;
  margin-left: 7px;
  font-size: 15px;
}

#container {
  min-width: 340px;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  transition: opacity 0.2s;
}

#map {
  width: 100%;
  height: 480px;
  border: 1px solid #ddd;
  border-radius: 8px;
  z-index: 10; /* Increased z-index */
}

.static-map-placeholder {
  width: 100%;
  height: 480px;
  background-color: #f0f0f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #666;
  font-size: 16px;
  text-align: center;
  overflow: hidden;
  z-index: 5; /* Lower than #map */
}

.static-map-placeholder.loading .fa-spinner {
  display: none;
}

.static-map-placeholder.error .fa-exclamation-triangle {
  font-size: 30px;
  color: #dc2626;
  margin-bottom: 10px;
}

.loading-gif {
  width: 380px;
  height: 380px;
  margin-bottom: 10px;
  object-fit: contain;
}

#staticMapImage {
  width: 100%;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: none;
}


@media (max-width: 700px) {
  .container {
    max-width: 100vw;
    border-radius: 0;
    margin-top: 16px;
    padding: 13px 3vw 14px 3vw;
  }
  .container.attendance-section {
    width: 98vw;
    height: auto;
    min-height: 320px;
    padding: 12px 4vw;
  }
  .container.map-section {
    width: 98vw;
    height: 320px; /* Match #map */
    padding: 12px 4vw;
  }
  #map {
    height: 320px;
  }
  .static-map-placeholder {
    height: 320px;
  }
  .heatmap-section {
    margin: 20px 0 0 0;
    max-width: 100vw;
    border-radius: 0;
    padding: 12px 2vw 4px 2vw;
  }
  #container {
    min-width: 240px;
    width: 99vw;
    max-width: 100vw;
  }
  .highcharts-description {
    font-size: 10px;
  }
  .filter-bar label, .filter-bar select, .filter-bar input[type=month] {
    font-size: 14px;
  }
}

@media (max-width: 500px) {
  h1 { font-size: 16px; }
  .info-section p { font-size: 12px; }
  .checkin-button { font-size: 12px; padding: 9px 8px; }
  .filter-bar select, .filter-bar input[type=month] {
    font-size: 13px;
    min-width: 85px;
    max-width: 120px;
  }
}
.heatmap-section {
  background: #fff;
  margin: 38px auto 0 auto;
  max-width: 950px;
  width: 98vw;
  border-radius: 18px;
  box-shadow: 0 2px 10px #eee;
  padding: 22px 12px 8px 12px;
  box-sizing: border-box;
}

#container {
  min-width: 340px;
  width: 100%;
  height: 400px;
  max-width: 100vw;
  box-sizing: border-box;
}

#heatmap-loading {
  display: none;
  text-align: center;
  margin: 20px 0;
  font-size: 1.08em;
  color: #02796b;
}

.heatmap-scroll {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.highcharts-description {
  text-align: center;
  margin-bottom: 0;
  color: #555;
  font-size: 10px;
}
