:root {
  --bg: #f5f7fa;
  --primary: #2f80ed;
  --text: #333;
  --border: #ddd;
  --radius: 8px;
  --spacing: 1rem;
}

body {
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background: var(--primary);
  color: white;
  padding: 1rem 2rem;
  text-align: center;
}

main {
  max-width: 800px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
}

input[type="text"],
input[type="file"],
input[type="email"],
input[type="password"],
textarea,
select {
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  box-sizing: border-box;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

button {
  padding: 0.7rem 1.2rem;
  background-color: var(--primary);
  color: white;
  font-weight: bold;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #1c6fd3;
}

h2, h3 {
  color: var(--primary);
}

.img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 1rem;
}

.autoComplete_wrapper {
  position: relative;
}

footer {
  text-align: center;
  padding: 2rem 0;
  color: #666;
  font-size: 0.9rem;
}

.leaflet-tile{
  border: 0px!important;
}

/* .leaflet-container img{
  border-radius: 0px!important;
  border-color: transparent!important;
} */


/* sidebar */
#hamburger-btn {
    position: absolute;
    top: 1px;
    left: 10px;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1101; /* più alto della sidebar */
    transition: transform 0.3s ease;
}

#hamburger-btn.open {
    font-size: 2rem;
    transform: translateX(250px) rotate(360deg); /* sposta a destra di 250px, stessa larghezza sidebar */
    transition: transform 0.3s ease;
    /* puoi togliere la rotazione se vuoi */
    /* rimuovi o commenta la linea transform: rotate(90deg); se presente */
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #ddd;
    padding: 2rem 1rem;
    box-sizing: border-box;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1100; /* deve stare sopra tutto */
    transform: translateX(-100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#sidebar.sidebar-open {
    transform: translateX(0);
}

#sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar nav ul li {
    margin-bottom: 1rem;
}

#sidebar nav ul li a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

#sidebar nav ul.ul-small li{
    margin-bottom: 0.2rem;
}
#sidebar nav ul.ul-small li a{
    font-size: small;
}

#sidebar nav ul li a:hover {
    color: #007bff;
}

/* Overlay trasparente per catturare click fuori */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 1099; /* sotto la sidebar ma sopra tutto il resto */
    display: block;
}

#overlay.hidden {
    display: none;
}

/* Sposta il contenuto principale a destra quando sidebar aperta */
.sidebar-open + main,
.sidebar-open + footer {
    margin-left: 250px;
    transition: margin-left 0.3s ease;
}


/* icona utente nella navbar */

.user-avatar {
    height: 40px;
    width: 40px;
    margin-top: 0px;
    position: absolute;
    top: 10px;
    right: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid #ccc;
}

.user-dropdown {
    position: absolute;
    right: 5px;
    top: 65px;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0.5rem;
    border-radius: 6px;
    z-index: 10000;
    min-width: 100px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.user-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.user-dropdown a {
    display: block;
    text-decoration: none;
    padding: 0.25rem 0;
    color: #333;
}

.user-dropdown a:hover {
    background-color: #f0f0f0;
}

.hidden {
    display: none;
}

.login-link {
    font-weight: bold;
    text-decoration: none;
    
}

.login-container {
    position: absolute;
    top: 2px;
    right: 10px;
}

.login-link {
    /* display: flex;
    align-items: center; */
    background-color: #007bff;
    color: white;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
    display: inline-block;
    text-align: center;
}

.login-link svg {
    margin-right: 6px;
    fill: white;
}

.login-link:hover {
    background-color: #0056b3;
}



/* Pagina di login */

.login-page,
.register-page {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2rem;
  border-radius: 12px;
  background: #f9f9f9;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
}


.login-page h2,
.register-page h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.btn-login {
    width: 100%;
    background-color: #007bff;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-login:hover {
    background-color: #0056b3;
}

.register-hint,
.login-hint {
    text-align: center;
    margin-top: 1rem;
}

.error-message {
    background-color: #ffe6e6;
    color: #c00;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #c00;
}
/*
.alternative-login {
    text-align: center;
    margin-top: 20px;
}

.alternative-login p {
    margin-bottom: 10px;
    color: #666;
}

.btn-social {
    display: inline-block;
    margin: 5px;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    min-width: 250px;
}

.btn-social.google {
    background-color: #db4437;
}

.btn-social.drone {
    background-color: #007bff;
}

*/
.alternative-login {
    text-align: center;
    margin-top: 30px;
}

.alternative-login p {
    margin-bottom: 10px;
    font-weight: bold;
    color: #666;
}

.btn-social {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 4px;
    margin: 8px auto;
    width: 90%;
    max-width: 260px;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.btn-social img {
    position: absolute;
    left: 10px;
    width: 20px;
    height: 20px;
}

.btn-social span {
    text-align: center;
}

/* Google style based on official guidelines */
.btn-social.google {
    background: #fff;
    color: #555;
    border: 1px solid #ddd;
    font-weight: 500;
}

.btn-social.google:hover {
    border-color: #aaa;
}

/* DroneSimulator custom style */
.btn-social.drone {
    background: #0e3c49;
    color: #fff;
    border: 1px solid #004a99;
    font-weight: 500;
}

.btn-social.drone:hover {
    background: #07262e;
}


/* modale di benvenuto */

.welcome-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    color: black;
    font-weight: 400;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 1rem;
    animation: fadeInOut 4s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -10px); }
    10% { opacity: 1; transform: translate(-50%, 0); }
    90% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* stellina favorites */

.star {
    cursor: pointer;
    font-size: 1.5em;
    color: #ccc;
    transition: color 0.3s;
}
.star.filled, .star.active {
    color: gold;
}


/* badge con fontawesome per segui, favorites, likes */

.toggle-box {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.4em 0.6em;
    border: 1px solid #ccc;
    border-radius: 0.6em;
    font-size: 0.95rem;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.toggle-box:hover {
    background-color: #eee;
    transform: scale(1.03);
}

.toggle-label {
    font-weight: 500;
}

.toggle-icon i {
    font-size: 1.2rem;
}

/* Stato attivo */
.toggle-box.active {
    background-color: #e0f2ff;
    border-color: #007acc;
    color: #007acc;
}

.toggle-box.active .toggle-icon i {
    color: #007acc;
}

/* Personalizzazione per tipo */
.toggle-box.like.active {
    background-color: #ffe6e6;
    border-color: #cc2b2b;
    color: #cc2b2b;
}
.toggle-box.like.active .toggle-icon i {
    color: #cc2b2b;
}
.toggle-box.favorite.active {
    background-color: #fff5d1;
    border-color: #e0a800;
    color: #e0a800;
}
.toggle-box.favorite.active .toggle-icon i {
    color: #e0a800;
}
.toggle-box.follow.active {
    background-color: #d4f4dd;
    border-color: #28a745;
    color: #28a745;
}
.toggle-box.follow.active .toggle-icon i {
    color: #28a745;
}
