/* Estilos específicos para componentes da ficha */

/* Upload de imagem */
.upload-imagem-container {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  border: 2px dashed var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  margin-bottom: 10px;
  background-color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s;
}

.upload-label:hover {
  background-color: rgba(255, 255, 255, 0.8);
  border-color: var(--primary-color);
}

.upload-label.has-image {
  border-style: solid;
  border-color: var(--success);
}

.upload-label i {
  font-size: 48px;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.upload-label span {
  text-align: center;
  font-size: 14px;
}

.image-preview {
  max-width: 100%;
  max-height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border-radius: 8px;
  object-fit: contain;
}

#imagemPersonagem {
  display: none;
}

#removerImagem {
  display: none;
}

/* Ficha Cards com Imagem */
.ficha-card {
  position: relative;
  background-size: cover;
  background-position: center;
}

.ficha-card.com-imagem::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: inherit;
  z-index: 0;
}

.ficha-card.com-imagem .ficha-card-header,
.ficha-card.com-imagem .ficha-card-info,
.ficha-card.com-imagem .ficha-card-status,
.ficha-card.com-imagem .ficha-card-actions {
  position: relative;
  z-index: 1;
  color: #fff;
}

.ficha-card.com-imagem .ficha-card-nome {
  text-shadow: 0px 1px 2px rgba(223, 219, 195, 0.8);
}

/* Modal de Detalhes da Raça */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  background-color: #f8f0e3;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  width: 80%;
  max-width: 700px;
  animation: modalFadeIn 0.3s ease-out;
  position: relative;
}

@keyframes modalFadeIn {
  from {opacity: 0; transform: translateY(-50px);}
  to {opacity: 1; transform: translateY(0);}
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.modal-header h3 {
  margin: 0;
  color: var(--primary-color);
}

.modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.close {
  color: #aaa;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: var(--primary-color);
}

.detalhe-raca-item {
  margin-bottom: 15px;
}

.detalhe-raca-item div strong {
  font-size: 18px;
}
.detalhe-raca-item div p {
  margin-bottom: 10px;
  font-size: 14px;
}

.detalhe-raca-item h4 {
  color: var(--secondary-color);
  margin-bottom: 5px;
  border-bottom: 1px dotted #ddd;
  padding-bottom: 5px;
}

.detalhes-raca-btn {
  margin-left: 10px;
  font-size: 0.8em;
  padding: 3px 8px;
  cursor: pointer;
}

/* Abas para diferentes níveis de magia */
.magias-tabs {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.magia-tab {
  padding: 8px 15px;
  margin-right: 5px;
  margin-bottom: 5px;
  background-color: #e6d7b8;
  border-radius: 5px 5px 0 0;
  cursor: pointer;
  border: 1px solid #ddd;
  border-bottom: none;
}

.magia-tab.active {
  background-color: var(--primary-color);
  color: white;
}

.magia-nivel-content {
  display: none;
  padding: 15px;
  border: 1px solid #ddd;
  background-color: #fff;
  margin-bottom: 15px;
}

.magia-nivel-content.active {
  display: block;
}

/* Editor TinyMCE */
.tox-tinymce {
  border-radius: 6px !important;
  border: 1px solid var(--border-color) !important;
}

.tox-statusbar {
  border-top: 1px solid var(--border-color) !important;
}

/* Atributo customizado da raça */
.atributo-raca-custom {
  margin-top: 15px;
  padding: 12px;
  background-color: rgba(201, 169, 89, 0.1);
  border-radius: 8px;
  border: 1px dashed var(--secondary-color);
}

.atributo-raca-custom h4 {
  margin-top: 0;
  color: var(--secondary-color);
}

/* Rolagem de dados */
.dice {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  background-color: var(--primary-color);
  color: white;
  border-radius: 5px;
  margin: 0 5px;
  font-weight: bold;
  animation: dice-roll 0.5s ease-out;
}

@keyframes dice-roll {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0.5;
  }
  50% {
    transform: translateY(10px) rotate(180deg);
  }
  100% {
    transform: translateY(0) rotate(360deg);
    opacity: 1;
  }
}

.total-roll {
  font-size: 1.4em;
  font-weight: bold;
  margin-left: 10px;
  color: var(--primary-color);
}

/* Barra de rolagem personalizada */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--secondary-color);
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-color);
}

/* Animação de destaque para valores alterados */
@keyframes highlight {
  0% {
    background-color: rgba(201, 169, 89, 0.3);
  }
  100% {
    background-color: transparent;
  }
}

.highlight {
  animation: highlight 1.5s ease-in-out;
}

/* Estilo para os checkboxes */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 5px;
}

/* Fade in/out animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.fade-in {
  animation: fadeIn 0.3s forwards;
}

.fade-out {
  animation: fadeOut 0.3s forwards;
}

/* Pergaminho decorativo */
.pergaminho {
  position: relative;
  padding: 20px;
  background-color: #f8f0e3;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.pergaminho::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(#e6d7b8, #f8f0e3);
  border-radius: 10px 10px 0 0;
  z-index: -1;
}

.pergaminho::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(#f8f0e3, #e6d7b8);
  border-radius: 0 0 10px 10px;
  z-index: -1;
}

/* Flash notification */
.flash-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  background-color: #333;
  color: white;
  z-index: 1000;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s, transform 0.3s;
}

.flash-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.flash-success {
  background-color: var(--success);
}

.flash-error {
  background-color: var(--danger);
}

.flash-warning {
  background-color: var(--secondary-color);
}

/* Custom select styling */
.custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
}

.custom-select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
}

.custom-select::after {
  content: '▼';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--secondary-color);
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: #333;
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  margin: 20px auto;
  border: 4px solid rgba(0,0,0,0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}