/* Variabili CSS per una facile personalizzazione */
:root {
  --primary-color: #4a90e2;
  --secondary-color: #f5a623;
  --background-color: #f8f9fa;
  --text-color: #333333;
  --border-color: #e0e0e0;
}

/* Stili di base */
body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  margin: 0;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  box-sizing: border-box;
}

h1, h2 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 30px;
}

/* Stili per i form */
form {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

input[type="text"],
input[type="number"],
input[type="submit"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
}

input[type="submit"] {
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
  background-color: #3a7bc0;
}

/* Stili per le tabelle */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

th, td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--primary-color);
  color: white;
}

tr:hover {
  background-color: #f5f5f5;
}

/* Stili per i pulsanti */
.btn {
  display: inline-block;
  padding: 8px 16px;
  margin: 5px;
  border-radius: 4px;
  text-decoration: none;
  color: white;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
}

.btn-danger {
  background-color: #e74c3c;
}

.btn:hover {
  background-color: #3a7bc0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-edit {
  background-color: var(--secondary-color);
}

.btn-edit:hover {
  background-color: #d48e1d;
}

/* Stili per i risultati della ricerca */
.search-results {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-top: 20px;
}

.search-results h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
}

.table-responsive {
  overflow-x: auto;
}

.no-results {
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Assicuriamo che le immagini siano responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Media Queries per la responsività */

/* Stili per tablet */
@media (max-width: 1024px) {
  .container {
    padding: 15px;
  }
  
  input[type="text"],
  input[type="number"],
  input[type="submit"] {
    font-size: 16px;
  }
}

/* Stili per dispositivi mobili */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 10px;
  }
  
  h1, h2 {
    font-size: 24px;
  }

  form {
    padding: 15px;
  }
  
  input[type="text"],
  input[type="number"],
  input[type="submit"] {
    font-size: 14px;
    padding: 10px;
  }

  .table-responsive {
    border: 0;
  }

  table {
    font-size: 14px;
    border: 0;
  }

  table thead {
    display: none;
  }

  table tr {
    margin-bottom: 10px;
    display: block;
    border-bottom: 2px solid var(--border-color);
  }

  table td {
    display: block;
    text-align: right;
    font-size: 13px;
    border-bottom: 1px dotted #ddd;
  }

  table td:last-child {
    border-bottom: 0;
  }

  table td:before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    text-transform: uppercase;
  }

  .btn {
    display: inline-block;
    width: auto;
    margin: 5px;
  }
}

/* Stili per dispositivi molto piccoli */
@media (max-width: 480px) {
  h1, h2 {
    font-size: 20px;
  }

  form {
    padding: 10px;
  }

  input[type="text"],
  input[type="number"],
  input[type="submit"] {
    font-size: 12px;
    padding: 8px;
  }

  .btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
  }
}