/* Stili per il contatore visite admin */

/* Badge nel navbar */
.admin-visit-badge {
  position: relative;
  margin-left: 20px;
}

.visit-counter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 6px 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.visit-counter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.visit-count {
  font-weight: 600;
  font-size: 14px;
}
/* Modal dettagli */
.visit-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1a1a1a;
  border-radius: 12px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #fff;
}

/* Grid statistiche */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
}

.stat-card h3 {
  margin: 0 0 10px 0;
  color: #999;
  font-size: 14px;
  font-weight: 400;
}

.stat-number {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #e11d48;
}

/* Pagine più visitate */
.top-pages {
  margin-bottom: 20px;
}

.top-pages h3 {
  color: #fff;
  margin-bottom: 15px;
}

.top-pages ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.top-pages li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.page-name {
  color: #ccc;
  font-weight: 500;
}

.page-visits {
  color: #999;
  font-size: 14px;
}

/* Azioni admin */
.admin-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

.admin-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reset-btn {
  background: #e11d48;
  color: white;
}
.reset-btn:hover {
  background: #be123c;
}

.logout-btn {
  background: #444;
  color: white;
}

.logout-btn:hover {
  background: #555;
}

/* Login Admin */
.admin-login-modal .modal-content {
  max-width: 400px;
}

.admin-login-modal h2 {
  text-align: center;
  margin-bottom: 25px;
  color: #fff;
}

.admin-login-modal input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 16px;
}

.admin-login-modal input:focus {
  outline: none;
  border-color: #e11d48;
  background: rgba(255, 255, 255, 0.08);
}
.error-msg {
  color: #ef4444;
  font-size: 14px;
  margin-bottom: 15px;
  text-align: center;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.form-actions button {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-actions button[type="submit"] {
  background: #e11d48;
  color: white;
}

.form-actions button[type="submit"]:hover {
  background: #be123c;
}

.form-actions button[type="button"] {
  background: #444;
  color: white;
}

.form-actions button[type="button"]:hover {
  background: #555;
}

/* Responsive */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .modal-content {
    padding: 20px;
  }
}
/* Sezione Reset Automatico */
.auto-reset-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.auto-reset-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 10px;
}

.auto-reset-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 20px;
  cursor: pointer;
  accent-color: #e11d48;
}

.toggle-label {
  color: #fff;
  font-weight: 500;
  font-size: 16px;
  user-select: none;
}

.reset-info {
  margin: 10px 0 0 32px;
  font-size: 14px;
  color: #999;
}

.auto-reset-section .reset-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Animazione per il checkbox */
.auto-reset-toggle input[type="checkbox"]:checked {
  background: #e11d48;
}

.auto-reset-toggle:hover .toggle-label {
  color: #e11d48;
}

/* Nota informativa */
.daily-reset-note {
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.2);
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 15px;
  font-size: 13px;
  color: #ff6b6b;
  display: flex;
  align-items: start;
  gap: 10px;
}

.daily-reset-note svg {
  flex-shrink: 0;
  margin-top: 2px;
}
/* Fix per evitare scroll nel modal */
.visit-details-modal .modal-content {
  overflow: hidden;
  max-height: 90vh;
}

/* Contenuto interno scrollabile solo se necessario */
.modal-body {
  overflow-y: auto;
  max-height: calc(90vh - 100px); /* Sottrae header e padding */
}

/* Per schermi piccoli, rendi tutto più compatto */
@media (max-height: 700px) {
  .modal-content {
    padding: 20px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .stat-number {
    font-size: 24px;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .stats-grid {
    gap: 10px;
    margin-bottom: 15px;
  }
  
  .top-pages {
    margin-bottom: 15px;
  }
  
  .auto-reset-section {
    padding: 12px;
    margin-bottom: 15px;
  }
}