/* Base */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  transition: background 0.3s, color 0.3s;
}
body.light { background: #f4f4f4; color: #000; }
body.dark { background: #121212; color: #fff; }

/* Toolbar */
.toolbar {
  position: fixed;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 10px;
  z-index: 1001;
}
.toolbar button {
  background: #444;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 22px;
  cursor: pointer;
  padding: 8px 12px;
}
.toolbar button:hover { background: #666; }

/* Containers */
.hidden { display: none; }
.container {
  width: 100%;
  max-width: 500px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  text-align: center;
  position: relative;
}
body.dark .container {
  background: #2a2a2a;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255,255,255,0.1);
}

/* Input */
input[type="text"], input[type="password"] {
  width: 90%;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}
body.dark input {
  background: #3a3a3a;
  color: #fff;
  border: 1px solid #666;
}

/* Pulsanti principali */
button {
  padding: 14px 28px;
  margin: 12px;
  border: none;
  border-radius: 10px;
  background: #0077cc;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: 0.3s;
}
button:hover { background: #005fa3; }

.logout-btn {
  background: #cc0000;
  display: block;
  margin: 30px auto 0;
  width: 180px;
}
.logout-btn:hover { background: #a30000; }

/* Pulsanti navigazione */
.nav-btn {
  position: absolute;
  top: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: #cc0000;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.nav-btn:hover { background: #a30000; }
.home-btn { left: 20px; }
.back-btn { left: 20px; } /* spostato a sinistra per non coprire il titolo */

/* Folders & Gallery */
.folders, .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-top: 40px;
  justify-items: center;
}

.folder, .photo {
  width: 140px;
  height: 140px;
  background: #0077cc;
  color: white;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  text-align: center;
  padding: 10px;
}
.folder:hover { background: #005fa3; }
.photo img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  cursor: pointer;
}

/* Modal */
.modal {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.9);
  padding-top: 50px;
}
.modal img {
  max-width: 90%;
  max-height: 70%;
  border-radius: 12px;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
}
.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
}
.controls button {
  padding: 10px 18px;
  font-size: 18px;
  background: #0077cc;
  border-radius: 8px;
}
.controls button:hover { background: #005fa3; }
.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}
.modal.hidden { display: none !important; }

/* Errori */
.error { color: red; font-size: 14px; margin-top: 10px; }
