/* --- css/upload.css --- */

/* Fundo Escuro */
body {
  background-color: #0b0b0b;
  color: #f7f7f7;
}

.ef-upload-layout {
  display: grid;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Painel de Config */
.ef-config-panel {
  background: #141414;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: end;
  margin-bottom: 10px;
}

.ef-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.ef-label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 700;
  text-transform: uppercase;
}

.ef-custom-input {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  width: 100%;
  height: 45px;
  outline: none;
  box-sizing: border-box;
}
.ef-custom-input:focus {
  border-color: #ff2d55;
}

/* Dropzone */
.ef-dropzone {
  border: 2px dashed #333;
  border-radius: 16px;
  background: linear-gradient(180deg, #121212 0%, #0a0a0a 100%);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 25px;
  transition: 0.2s;
}
.ef-dropzone:hover {
  border-color: #ff2d55;
  background: #161616;
}
.ef-drop-icon {
  font-size: 48px;
  margin-bottom: 10px;
  opacity: 0.5;
  color: #ff2d55;
}
.ef-drop-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}
.ef-drop-sub {
  font-size: 0.85rem;
  color: #666;
  margin-top: 5px;
  text-align: center;
  padding: 0 20px;
}

/* Action Bar */
.ef-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  padding: 15px 20px;
  border-radius: 10px;
  border: 1px solid #333;
  margin-bottom: 25px;
  gap: 15px;
}

/* Grid Preview */
.ef-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 20px;
}
.ef-card-preview {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1/1;
  border: 1px solid #333;
}
.ef-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  display: block;
}

/* Status */
.ef-status-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: 0.2s;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
.ef-card-preview:hover .ef-status-overlay,
.st-uploading .ef-status-overlay,
.st-done .ef-status-overlay,
.st-err .ef-status-overlay {
  opacity: 1;
}
.st-done .ef-status-overlay {
  background: rgba(76, 175, 80, 0.9);
}
.st-err .ef-status-overlay {
  background: rgba(244, 67, 54, 0.9);
}

.ef-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(255, 50, 50, 0.9);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 12px;
  opacity: 0;
}
.ef-card-preview:hover .ef-remove-btn {
  opacity: 1;
}

.ef-mini-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #ff2d55;
  width: 0%;
  z-index: 5;
}
.ef-spin {
  display: inline-block;
  animation: spin 1s linear infinite;
  font-size: 20px;
  margin-bottom: 4px;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* === RESPONSIVIDADE MOBILE === */
@media (max-width: 768px) {
  /* Painel vira coluna única */
  .ef-config-panel {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* Barra de ação fixa embaixo */
  .ef-action-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    position: sticky;
    bottom: 20px;
    z-index: 100;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  }
  .ef-action-bar div {
    justify-content: center;
    margin-bottom: 10px;
  }

  /* Botões full width no mobile */
  .ef-action-bar button {
    width: 100%;
    height: 45px;
  }
}
/* --- css/upload.css --- */

/* Ajuste de Padding para compensar barra fixa no mobile */
.ef-upload-layout {
  display: grid;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 100px; /* Importante para o mobile */
}

/* Painel de Config */
.ef-config-panel {
  background: #141414;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: end;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.ef-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* Dropzone (Compacta no mobile) */
.ef-dropzone {
  border: 2px dashed #333;
  border-radius: 16px;
  background: linear-gradient(180deg, #121212 0%, #0a0a0a 100%);
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  margin-top: 10px;
}
.ef-dropzone:active {
  background: #1a1a1a;
  border-color: var(--primary);
}
.ef-drop-icon {
  font-size: 48px;
  margin-bottom: 10px;
  opacity: 0.5;
  color: var(--primary);
}
.ef-drop-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
}
.ef-drop-sub {
  font-size: 0.85rem;
  color: #666;
  margin-top: 5px;
  text-align: center;
  max-width: 250px;
}

/* Barra de Ação (Fixa no rodapé para mobile) */
.ef-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1a1a;
  padding: 15px 20px;
  border-radius: 12px;
  border: 1px solid #333;
  gap: 15px;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

/* Grid Preview */
.ef-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.ef-card-preview {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 1/1;
  border: 1px solid #333;
}
.ef-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  display: block;
}

/* Status */
.ef-status-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: 0.2s;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
}
.ef-card-preview:hover .ef-status-overlay,
.st-uploading .ef-status-overlay,
.st-done .ef-status-overlay,
.st-err .ef-status-overlay {
  opacity: 1;
}
.st-done .ef-status-overlay {
  background: rgba(76, 175, 80, 0.9);
}
.st-err .ef-status-overlay {
  background: rgba(244, 67, 54, 0.9);
}

.ef-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(255, 50, 50, 0.9);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 10px;
  opacity: 0.8;
}

.ef-mini-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #ff2d55;
  width: 0%;
  z-index: 5;
}
.ef-spin {
  display: inline-block;
  animation: spin 1s linear infinite;
  font-size: 18px;
  margin-bottom: 2px;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
  /* No mobile, campos um embaixo do outro */
  .ef-config-panel {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }

  /* Dropzone menor no mobile */
  .ef-dropzone {
    min-height: 180px;
  }

  /* Barra de ação vira rodapé fixo */
  .ef-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    z-index: 100;
    padding: 15px 20px;
    box-sizing: border-box;
    border: none;
    border-top: 1px solid #333;
    flex-direction: row; /* Mantém lado a lado */
  }

  /* Botão principal full width se preferir, ou mantem layout */
  .ef-action-bar button {
    flex: 1;
    height: 48px;
  }

  /* Esconde contador se ficar apertado */
  #efTotalSize {
    display: none;
  }
}
