/* Variáveis Globais */
:root {
  --primary-color: #1a4d6a;
  --secondary-color: #f37d33;
  --tertiary-color: #009cb2;
  --error-color: #f45;
  --success-color: #2A6;
  --warning-color: #ff9900;
  --info-color: #00a6ed;
  --text-color: #333;
  --background-color: #f9f9f9;
  --font-size: 16px;
}

/* Reset Básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  font-size: var(--font-size);
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: #fff;
  box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
}

nav {
  width: 100%;
  display: flex;
  align-items: center;
}

/* nav item circular */
.nav-item {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.2rem;
  margin: 0 auto;
  transition: background-color 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-item:hover {
  background-color: var(--secondary-color);
}

#navbar a {
  position: relative;
  
  span.badge {
    position: absolute;
    background-color: var(--error-color);
    color: var(--background-color);
    width: 15px;
    height: 15px;
    font-size: 10px;
    border-radius: 50%;
    font-weight: bold;
    text-align: center;
    line-height: 15px;
    top: -5px;
    right: -5px;
  }
}

/* Conteúdo Principal */
.content {
  justify-content: center;
  padding: 20px;
  margin-bottom: 20px; /* Espaço para a navbar */
}

/* Logo Centralizado */
div.centralized-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

img.centralized-logo {
  max-width: 200px;
  height: auto;
}

.form-section {
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-flex-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  align-content: flex-start;
  margin-bottom: 20px;
}

.form-flex-wrap > div {
  flex-grow: 3;
  margin: 0 5px;
}

.form-flex-wrap > div:nth-last-child(1) {
  align-self: flex-end;
  padding-bottom: 10px;
}

label {
  display: block;
  margin: 5px 0 0;
  font-weight: bold;
}

.text-error {
  color: var(--error-color);
}


input, select, textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin-right: 8px;
}

select {
  background-color: white;
  font: inherit;
  padding: 10px 20px 10px 10px !important;
  height: 38px;
}

/* Botões */
.btn {
  display: inline-block;
  width: 100%;
  background-color: var(--primary-color);
  color: #fff;
  padding: 10px;
  margin: 5px 0;
  text-align: center;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.btn-sm {
  font-size: 0.8rem !important;
  padding: 2px 5px !important;
  width: auto !important;
  margin: 0px !important;
  text-decoration: none !important;;
}

#submit-btn  {
  margin-bottom: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#get_location  {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background-color: var(--secondary-color);
}

.btn-update {
  background-color: var(--tertiary-color);
}

.btn-error {
  background-color: var(--error-color);
}

.btn-success {
  background-color: var(--success-color);
}

/* Footer */
.footer {
  text-align: center;
  padding: 10px;
  font-size: 0.9rem;
  color: #aaa;
}

footer p {
  display: flex;
  justify-content: center;
  align-items: center;
}

footer img {
  margin-left: 20px;
  text-align: right;
  width: 36px;
  height: auto;
  float: left;
}

/* Media Queries (Tablet e Desktop) */
@media (min-width: 768px) {
  .navbar {
      position: static;
      justify-content: center;
  }

  .form-section {
      max-width: 700px;
  }
}

.nav-item[disabled] {
  pointer-events: none;
  opacity: 0.5;
}

#registros-lista{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  margin-bottom: 20px;
}

#registros-lista .registro{
  margin: 10px;
  flex-grow: 3;
  flex-basis: 250px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.card {
  /* Add shadows to create the "card" effect */
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
  transition: 0.3s;
  padding: 2px 16px;
  border-radius: 5px;
  margin: 20px 0px;
}

.record p{
  display: inline-flex;
  color: #333;
  margin-right: 10px;
}

.bg-success {
  background-color: #c6efce
}

.bg-danger {
  background-color: #f2dede
}

.bg-alert {
  background-color: #eee9ce
}

.bg-primary {
  background-color: #c2d4e4
}

.center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* no displayed */
.hidden {
  display: none
}

/* File input */
#image-preview {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

#image-preview img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border: 1px solid #ccc;
  border-radius: 5px;
  position: relative;
}

#image-preview .remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--error-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
}

.toggle-switcher {
  display:flex;
  justify-content: right;
  align-items: center;
  margin-right: 10px;

  .switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 24px;
    margin: 0 10px;
  }
  
  .switch input { 
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 2px;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
  }
  
  input:checked + .slider {
    background-color: var(--primary-color);
  }
  
  input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
  }
  
  input:checked + .slider:before {
    -webkit-transform: translateX(12px);
    -ms-transform: translateX(12px);
    transform: translateX(12px);
  }
  
  /* Rounded sliders */
  .slider.round {
    border-radius: 24px;
  }
  
  .slider.round:before {
    border-radius: 50%;
  }
}

.separate {
  text-align: center;
  font-weight: bold; 
  margin: 0.5rem 0;
}

.loader {
  display: none;
  border: 5px solid rgba(100, 255, 255, 0.1);
  border-top: 5px solid var(--tertiary-color);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin-left: 20px;
}

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

.loading {
  background-color: #ccc;
  pointer-events: none;
}

table, th, td {
  align-self: center;
  border: 1px solid var(--primary-color);
  border-collapse: collapse;
  padding: 5px;
  text-align: center;
  font-size: 0.8rem;
  text-transform: capitalize;
}

table {
  width: 100%;
  margin-bottom: 20px;
}

th {
  background-color: var(--primary-color);
  color: white;
}

/* Custom Alerts */
/* Alert with close button */
.alert {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 999;
  width: 100%;
  max-width: 600px;
  padding: 10px;
  opacity: 0.8;
  transition: opacity 0.5s ease-in-out;
  border-radius: 5px;
  box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
  background-color: var(--primary-color);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: fade-in-out 1s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-in-out;
  font-family: Arial, sans-serif;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-success {
  background-color: var(--success-color);
  color: white;
}

.alert-danger {
  background-color: var(--error-color);
  color: white;
}

.alert-warning {
  background-color: var(--warning-color);
  color: white;
}

.alert-info {
  background-color: var(--info-color);
  color: white;
}

.alert.show {
  opacity: 1;
}

.alert .close {
  position: absolute;
  right: 10px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.3s ease-in-out;
  width: 30px;
  height: 30px;
  background-color: transparent;
  border: none;
  outline: none;
}

.alert.close:hover {
  color: var(--error-color);
}
