/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Larger modal for game creation */
#add-game-modal .modal-content {
  max-width: 900px;
  width: 95%;
  max-height: 95vh;
}

.modal-header {
  background: linear-gradient(135deg, #c8102e 0%, #13294b 100%);
  color: #ffffff;
  padding: 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.close-button {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.modal-body {
  padding: 30px;
}

.modal-form {
  padding: 30px;
}

.modal-form h3 {
  color: #13294b;
  font-size: 1.5rem;
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
}

.modal-form input {
  width: 100%;
  padding: 12px;
  border: 2px solid #b1b3b3;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 15px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.modal-form input:focus {
  outline: none;
  border-color: #c8102e;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.modal-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-form .form-group label {
  font-weight: 600;
  color: #13294b;
  font-size: 0.9rem;
}

.modal-form .form-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-form .save-button,
.modal-form .cancel-button {
  flex: 1;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-form .save-button {
  background: linear-gradient(135deg, #c8102e 0%, #13294b 100%);
  color: #ffffff;
  border: none;
}

.modal-form .save-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-form .save-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.modal-form .cancel-button {
  background: #b1b3b3;
  color: #ffffff;
  border: none;
}

.modal-form .cancel-button:hover {
  background: #909090;
  transform: translateY(-1px);
}

/* Delete Modal Styles */
.delete-warning {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 12px;
  margin: 15px 0;
  color: #856404;
  font-weight: 600;
  text-align: center;
  border-left: 4px solid #ffc107;
}

.delete-confirm-button {
  background: linear-gradient(135deg, #dc3545 0%, #a71e2a 100%);
  color: #ffffff;
  border: none;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.delete-confirm-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Loading Overlay for Modals */
.modal-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}

.modal-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #b1b3b3;
  border-top: 3px solid #c8102e;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Modal Animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-content {
  animation: modalFadeIn 0.3s ease-out;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    margin: 20px;
  }

  .modal-header {
    padding: 15px;
  }

  .modal-header h3 {
    font-size: 1.2rem;
  }

  .modal-body,
  .modal-form {
    padding: 20px;
  }

  .close-button {
    font-size: 1.5rem;
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    max-width: 98%;
    margin: 10px;
  }

  .modal-form .form-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .modal-form .save-button,
  .modal-form .cancel-button {
    width: 100%;
  }
}