/* ============================================
   STILI MODALI - css/modal.css
   ============================================ */

/* Overlay scuro di sfondo */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7)!important;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* Box della modale */
.modal-box {
  background: #2C2225;
  border: 2px solid #523F45;
  border-radius: 8px;
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

/* Header della modale */
.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #523F45;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  margin: 0;
}

/* Bottone chiusura X */
.modal-close {
  cursor: pointer;
  font-size: 28px;
  line-height: 20px;
  color: #aaa;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  flex-shrink: 0;
}

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

/* Contenuto della modale */
.modal-content {
  padding: 20px;
  color: #ddd;
  overflow-y: auto;
}

.modal-content p {
  margin: 10px 0;
  line-height: 1.6;
}

.modal-content label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  color: #fff;
  font-weight: bold;
}

.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="number"],
.modal-content textarea,
.modal-content select {
  width: 100%;
  padding: 8px 10px;
  background: #1a1518;
  border: 1px solid #523F45;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="email"]:focus,
.modal-content input[type="number"]:focus,
.modal-content textarea:focus,
.modal-content select:focus {
  outline: none;
  border-color: #7a5a65;
  background: #221b1e;
}

.modal-content textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

/* Footer con bottoni */
.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #523F45;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.1);
}

/* Stili bottoni */
.modal-btn {
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
  min-width: 80px;
}

.modal-btn-primary {
  background: #5a4;
  color: #fff;
}

.modal-btn-primary:hover {
  background: #6b5;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(85, 170, 68, 0.4);
}

.modal-btn-primary:active {
  transform: translateY(0);
}

.modal-btn-secondary {
  background: #555;
  color: #fff;
}

.modal-btn-secondary:hover {
  background: #666;
  transform: translateY(-1px);
}

.modal-btn-secondary:active {
  transform: translateY(0);
}

.modal-btn-danger {
  background: #c44;
  color: #fff;
}

.modal-btn-danger:hover {
  background: #d55;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(204, 68, 68, 0.4);
}

.modal-btn-danger:active {
  transform: translateY(0);
}

/* Responsive: su mobile */
@media (max-width: 768px) {
  .modal-box {
    max-width: 95vw;
    max-height: 95vh;
    margin: 10px;
  }
  
  .modal-header {
    padding: 12px 15px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  .modal-content {
    padding: 15px;
  }
  
  .modal-footer {
    padding: 12px 15px;
    flex-wrap: wrap;
  }
  
  .modal-btn {
    flex: 1;
    min-width: 100px;
  }
}