button,
.settings-button,
.delete-button {
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.settings-button-wrapper {
  display: inline-block;
  margin-left: 8px;
}

.settings-button {
  background-color: #f0f0f0 !important;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  position: fixed;
  top: 13px;
  left: 100px;
  z-index: 1100;
  padding: 8px;
}

.settings-button:hover {
  background-color: #e0e0e0 !important;
}

.settings-button svg {
  width: 20px;
  height: 20px;
}

.modal,
#settingsModal,
#addUserModal,
#addMapModal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 1000;
  overflow-y: auto;
}

.modal > div,
#settingsModal .modal-content,
#addUserModal > div,
#addMapModal > div {
  background: #fff;
  max-width: 500px;
  margin: 5% auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  position: relative;
  animation: fadeIn 0.3s ease-in-out;
  font-size: 14px;
  color: #333;
  padding: 24px;
}

.modal-content {
  position: relative; 
  padding-top: 56px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 24px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
}

.modal-close:hover,
#addUserModal > div > span:hover,
#addMapModal > div > span:hover {
  color: #000;
}

.tab-buttons {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.tab-button {
  flex: 1 0 auto;
  padding: 12px 16px;
  text-align: center;
  min-width: 0;
  font-size: 16px;
  cursor: pointer;
  color: #555;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: none;
  background: #f0f0f0;
  border-radius: 6px;
}

.tab-button:hover {
  color: black;
  font-weight: bold;
}

.tab-button.active {
  font-weight: 600;
  color: #007BFF;
}

.tab-content {
  display: none;
  margin-top: 16px;
}

.tab-content.active {
  display: block;
}

.tab-content h3 {
  margin-top: 0;
  font-size: 20px;
}

.modal-button,
#addUserModal button,
#addMapModal button,
.add-button {
  background-color: #f0f0f0;
  color: black;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  min-width: 120px;
  height: 40px;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.modal-button:hover,
#addUserModal button:hover,
#addMapModal button:hover,
.add-button:hover {
  background-color: #e0e0e0;
  font-weight: bold;
}

.delete-button {
  background-color: #f0f0f0;
  border: 1px solid #bbb;
  color: #555;
  padding: 4px 6px;
  width: 40px;
  border-radius: 4px;
  font-size: 16px;
}

.delete-button:hover {
  background-color: #e57373;
  color: white;
  transform: scale(1.05);
}

#mapList,
#userList {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.4;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}

.data-table th {
  background-color: #f0f0f0;
  font-weight: 600;
}

.active-true { color: green; font-weight: 500; }
.active-false { color: #999; font-style: italic; }

.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="datetime-local"],
.modal-content input[type="file"],
.modal-content textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.modal-content input:focus,
.modal-content textarea:focus {
  border-color: #007BFF;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.modal-content label {
  font-size: 14px;
  margin-bottom: 4px;
  display: block;
  color: #333;
}

.modal-content input[type="checkbox"] {
  transform: scale(1.2);
  margin-right: 6px;
  cursor: pointer;
}

#laadimiseModal {
	display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#laadimiseContent {
    background: white;
    padding: 30px 50px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

#laadimiseSpinner {
    font-size: 40px;
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ----------------------------
   MOBIILIVAATED
-------------------------------*/
/* =======================================================
   Väga kitsad ekraanid – 320px ja väiksemad
======================================================= */
@media (max-width: 320px) {

  .settings-button {
    width: 38px;
    height: 38px;
    padding: 4px;
    left: 100px;
    top: 13px;
  }
  .settings-button svg { width: 20px; height: 20px; }

  #settingsModal .modal-content,
  #addUserModal > div,
  #addMapModal > div {
    max-width: 95%;
    padding: 12px;
    margin: 6% auto;
  }

  .tab-buttons {
    display: block !important;
  }

  .tab-button {
    display: block;
    width: 100%;
    font-size: 13px;
    padding: 10px 6px;
    white-space: normal;
    margin-bottom: 6px;
    text-align: center;
    box-sizing: border-box;
  }

  .modal-button,
  #addUserModal button,
  #addMapModal button,
  .add-button,
  .tab-content button {
    width: 100%;
    font-size: 14px;
    padding: 10px 0;
  }

  .delete-button {
    width: 28px;
    height: 28px;
    padding: 2px 4px;
    font-size: 13px;
  }

  #mapList,
  #userList {
    font-size: 12px;
    padding: 8px;
    max-height: 150px;
  }

  .data-table { font-size: 12px; }

  .modal-content input,
  .modal-content textarea {
    font-size: 13px;
    padding: 8px 10px;
  }

  .modal-close {
    top: 8px;
    right: 8px;
    font-size: 20px;
  }

  .tab-content h3 {
    font-size: 16px;
  }
}

/* =======================================================
   360–399px (standard Android telefonid)
======================================================= */
@media (min-width: 321px) and (max-width: 399px) {

  .settings-button {
    width: 36px;
    height: 36px;
    padding: 6px;
    left: 100px;
    top: 13px;
  }

  .tab-buttons {
    display: block;
  }

  .tab-button {
    width: 100%;
    font-size: 14px;
    padding: 12px 6px;
    margin-bottom: 6px;
    white-space: normal;
    text-align: center;
  }

  .modal-content {
    max-width: 92%;
    padding: 16px;
  }

  .tab-content button,
  .modal-button { width: 100%; }

  .modal-content input,
  .modal-content textarea {
    font-size: 14px;
  }
}

#runner.animate {
  animation: run 5s linear infinite;
}

@keyframes run {
  0%   { left: 0; }
  100% { left: 250px; }
}

/* =======================================================
   400–480px (suurem mobiilivaade)
======================================================= */
@media (min-width: 400px) and (max-width: 480px) {

  .settings-button {
    width: 38px;
    height: 38px;
    left: 100px;
    top: 13px;
  }

  .tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tab-button {
    flex: 1 1 calc(50% - 8px);
    font-size: 15px;
    padding: 12px 10px;
    white-space: normal;
  }

  .modal-content {
    max-width: 90%;
  }
}

/* =======================================================
   Tab-nupud alati täislaiuses ja vertikaalsed < 480px
======================================================= */
@media (max-width: 480px) {

  .tab-buttons {
    display: block !important;
    width: 100% !important;
  }

  .tab-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 100% !important;
    max-width: 100% !important;

    padding: 10px 12px !important;
    margin: 0 0 8px 0 !important;

    white-space: normal !important;
    line-height: 1.2 !important;
    font-size: 14px !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
}



