/* ========================================
   MODAL DE CRIAÇÃO DE PERSONAGEM
   ======================================== */

/* Overlay do Modal */
#createCharacterModal.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(5px);
  padding: 20px;
}

/* Container do Modal */
.create-character-modal {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 3px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(245, 158, 11, 0.5);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* Scrollbar customizada */
.create-character-modal::-webkit-scrollbar {
  width: 8px;
}

.create-character-modal::-webkit-scrollbar-track {
  background: #fef3c7;
}

.create-character-modal::-webkit-scrollbar-thumb {
  background: #7c3aed;
  border-radius: 4px;
}

/* Header do Modal */
.create-character-modal .modal-header {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #5b21b6;
  position: sticky;
  top: 0;
  z-index: 10;
}

.create-character-modal .modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botão fechar */
.create-character-modal .modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  line-height: 1;
  flex-shrink: 0;
}

.create-character-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Body do Modal */
.create-character-modal .modal-body {
  padding: 25px;
  background: transparent;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #7c2d12;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 13px;
}

.form-group label svg {
  color: #7c3aed;
  flex-shrink: 0;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
  background: white;
  color: #000000;
}

.form-control::placeholder {
  color: #6b7280;
  opacity: 0.7;
}

.form-hint {
  display: block;
  color: #92400e;
  font-size: 11px;
  margin-top: 5px;
  font-style: italic;
}

/* ========================================
   GENDER SELECTION
   ======================================== */

.gender-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 10px;
}

.gender-option {
  position: relative;
}

.gender-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.gender-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  background: linear-gradient(135deg, #fffef5 0%, #fef9e7 100%);
  border: 3px solid #f59e0b;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 190px;
  box-sizing: border-box;
}

.gender-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(109, 40, 217, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.gender-card:hover {
  border-color: #7c3aed;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.gender-card:hover::before {
  opacity: 1;
}

.gender-card.selected {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3), 0 6px 20px rgba(124, 58, 237, 0.4);
}

.gender-card.selected::before {
  opacity: 1;
}

/* Sprite do gênero */
.gender-sprite {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
  border-radius: 8px;
}

.gender-sprite img {
  width: 96px !important;
  height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  object-fit: contain !important;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
  display: block !important;
}

/* Info do gênero */
.gender-info {
  text-align: center;
  position: relative;
  z-index: 1;
}

.gender-info h4 {
  margin: 0;
  color: #7c2d12;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Checkmark */
.gender-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  background: #7c3aed;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.gender-card.selected .gender-check {
  opacity: 1;
  transform: scale(1);
}

.gender-check svg {
  color: white;
  width: 16px;
  height: 16px;
}

/* ========================================
   INFO CARD
   ======================================== */

.character-creation-info {
  margin-top: 18px;
  padding: 14px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #334155;
  border-radius: 10px;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #e2e8f0;
}

.info-card svg {
  flex-shrink: 0;
  color: #8b5cf6;
  margin-top: 2px;
}

.info-card strong {
  display: block;
  color: #e2e8f0;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 600;
}

.info-card p {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

/* ========================================
   MODAL ACTIONS (BUTTONS)
   ======================================== */

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  justify-content: flex-end;
  padding-top: 18px;
  border-top: 1px solid #334155;
}

.modal-actions .btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
  white-space: nowrap;
}

.modal-actions .btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.modal-actions .btn-secondary {
  background: #475569;
  color: white;
}

.modal-actions .btn-secondary:hover {
  background: #334155;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.modal-actions .btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  color: white;
}

.modal-actions .btn-primary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.6);
}

.modal-actions .btn:active {
  transform: translateY(0);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#createCharacterModal.modal-overlay {
  animation: modalFadeIn 0.3s ease;
}

#createCharacterModal .create-character-modal {
  animation: modalSlideIn 0.3s ease;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  #createCharacterModal.modal-overlay {
    padding: 0;
  }
  
  .create-character-modal {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  
  .create-character-modal .modal-header {
    padding: 18px 20px;
  }
  
  .create-character-modal .modal-header h2 {
    font-size: 19px;
  }
  
  .create-character-modal .modal-body {
    padding: 20px;
  }
  
  .gender-selection {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .gender-card {
    min-height: 180px;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .create-character-modal .modal-header {
    padding: 15px 18px;
  }
  
  .create-character-modal .modal-header h2 {
    font-size: 17px;
  }
  
  .create-character-modal .modal-body {
    padding: 18px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .gender-sprite {
    height: 100px;
  }
  
  .gender-sprite img {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
  }
  
  .gender-info h4 {
    font-size: 14px;
  }
}

/* ========================================
   MODAL DE DELETE CHARACTER
   ======================================== */

/* Overlay do Modal de Delete */
#deleteCharacterModal.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(5px);
  padding: 20px;
}

/* Container do Modal de Delete */
.delete-character-modal {
  background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
  border: 3px solid #dc2626;
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(220, 38, 38, 0.5);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

/* Scrollbar customizada */
.delete-character-modal::-webkit-scrollbar {
  width: 8px;
}

.delete-character-modal::-webkit-scrollbar-track {
  background: #fee2e2;
}

.delete-character-modal::-webkit-scrollbar-thumb {
  background: #dc2626;
  border-radius: 4px;
}

/* Header do Modal de Delete */
.delete-character-modal .modal-header {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #7f1d1d;
  position: sticky;
  top: 0;
  z-index: 10;
}

.delete-character-modal .modal-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botão fechar */
.delete-character-modal .modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  line-height: 1;
  flex-shrink: 0;
}

.delete-character-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Body do Modal de Delete */
.delete-character-modal .modal-body {
  padding: 25px;
  background: transparent;
}

/* Warning Box */
.delete-character-modal .warning-box {
  background: #fee2e2;
  border: 2px solid #dc2626;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.delete-character-modal .warning-box svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Form Groups */
.delete-character-modal .form-group {
  margin-bottom: 20px;
}

.delete-character-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #7f1d1d;
  font-size: 14px;
}

.delete-character-modal .form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid #fca5a5;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  color: #000 !important;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.delete-character-modal .form-control:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
  color: #000 !important;
}

.delete-character-modal .form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #991b1b;
}

/* Botões de Ação */
.delete-character-modal .modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid #fca5a5;
}

.delete-character-modal .btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  text-decoration: none;
}

.delete-character-modal .btn-secondary {
  background: #6b7280;
  color: white;
}

.delete-character-modal .btn-secondary:hover {
  background: #4b5563;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.delete-character-modal .btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
}

.delete-character-modal .btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.delete-character-modal .btn-danger:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Animação de Loading */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .delete-character-modal {
    max-width: 95%;
    margin: 10px;
  }
  
  .delete-character-modal .modal-actions {
    flex-direction: column;
  }
  
  .delete-character-modal .btn {
    width: 100%;
    justify-content: center;
  }
}
