/* Estilos para Upload de OFX */

/* Zona de Drop */
.ofx-drop-zone {
  border: 3px dashed #26a69a;
  border-radius: 12px;
  padding: 60px 20px;
  text-align: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ofx-drop-zone::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg);
  transition: all 0.5s;
  opacity: 0;
}

.ofx-drop-zone:hover::before {
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

.ofx-drop-zone:hover {
  border-color: #00897b;
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(38, 166, 154, 0.2);
}

.ofx-drop-zone.drag-over {
  border-color: #00897b;
  background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
  transform: scale(1.02);
  box-shadow: 0 12px 24px rgba(38, 166, 154, 0.3);
}

.ofx-drop-zone-icon {
  font-size: 64px;
  color: #26a69a;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Lista de Arquivos Selecionados */
.ofx-files-list {
  margin-top: 20px;
}

.ofx-file-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-left: 4px solid #26a69a;
}

.ofx-file-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateX(5px);
}

.ofx-file-item.uploading {
  border-left-color: #ff9800;
  background: #fff3e0;
}

.ofx-file-item.success {
  border-left-color: #4caf50;
  background: #e8f5e9;
}

.ofx-file-item.error {
  border-left-color: #f44336;
  background: #ffebee;
}

.ofx-file-icon {
  font-size: 32px;
  color: #26a69a;
  margin-right: 15px;
}

.ofx-file-info {
  flex: 1;
  min-width: 0;
}

.ofx-file-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  word-break: break-word;
}

.ofx-file-size {
  font-size: 12px;
  color: #666;
}

.ofx-file-remove {
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  margin-left: 10px;
}

.ofx-file-remove:hover {
  background: #d32f2f;
  transform: scale(1.1);
}

/* Barra de Progresso */
.ofx-progress-container {
  margin-top: 10px;
  width: 100%;
}

.ofx-progress-bar-wrapper {
  position: relative;
  background: #e0e0e0;
  border-radius: 10px;
  height: 24px;
  overflow: hidden;
  margin-bottom: 5px;
}

.ofx-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #26a69a 0%, #00897b 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ofx-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.ofx-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 600;
  color: #333;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.ofx-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

/* Modal de Upload */
.ofx-upload-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ofx-upload-modal-content {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  transition: all 0.3s ease;
}

.ofx-upload-modal-content.expanded {
  max-width: 800px;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ofx-upload-modal-header {
  padding: 16px 20px;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
  color: white;
  border-radius: 16px 16px 0 0;
}

.ofx-upload-modal-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.ofx-upload-modal-close,
.ofx-upload-modal-expand,
.ofx-upload-modal-cancel,
.ofx-upload-modal-minimize {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  margin-left: 8px;
}

.ofx-upload-modal-close:hover,
.ofx-upload-modal-expand:hover,
.ofx-upload-modal-cancel:hover,
.ofx-upload-modal-minimize:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.ofx-upload-modal-expand.expanded {
  transform: rotate(180deg);
}

.ofx-upload-modal-cancel {
  background: rgba(244, 67, 54, 0.8);
}

.ofx-upload-modal-cancel:hover {
  background: rgba(244, 67, 54, 1);
}

.ofx-upload-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

.ofx-upload-modal-content:not(.expanded) .ofx-modal-files-list {
  display: none;
}

/* Progresso Geral */
.ofx-overall-progress {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.ofx-overall-progress-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ofx-overall-progress-bar {
  height: 32px;
  background: #e0e0e0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}

.ofx-overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #26a69a 0%, #00897b 50%, #26a69a 100%);
  background-size: 200% 100%;
  animation: progressFlow 2s linear infinite;
  transition: width 0.3s ease;
  border-radius: 16px;
}

@keyframes progressFlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.ofx-overall-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.ofx-overall-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .ofx-overall-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ofx-stat-item {
  background: white;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ofx-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #26a69a;
  margin-bottom: 3px;
}

.ofx-stat-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Lista de Arquivos no Modal */
.ofx-modal-files-list {
  max-height: 400px;
  overflow-y: auto;
  margin-top: 16px;
}

.ofx-modal-file-item {
  background: #f5f5f5;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  border-left: 4px solid #26a69a;
}

.ofx-modal-file-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ofx-modal-file-name {
  font-weight: 600;
  color: #333;
  flex: 1;
  word-break: break-word;
}

.ofx-modal-file-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.ofx-modal-file-status.pending {
  background: #ff9800;
  color: white;
}

.ofx-modal-file-status.uploading {
  background: #2196f3;
  color: white;
}

.ofx-modal-file-status.success {
  background: #4caf50;
  color: white;
}

.ofx-modal-file-status.error {
  background: #f44336;
  color: white;
}

/* Animações */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.uploading .ofx-file-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Scrollbar personalizado */
.ofx-upload-modal-content::-webkit-scrollbar,
.ofx-modal-files-list::-webkit-scrollbar {
  width: 8px;
}

.ofx-upload-modal-content::-webkit-scrollbar-track,
.ofx-modal-files-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.ofx-upload-modal-content::-webkit-scrollbar-thumb,
.ofx-modal-files-list::-webkit-scrollbar-thumb {
  background: #26a69a;
  border-radius: 10px;
}

.ofx-upload-modal-content::-webkit-scrollbar-thumb:hover,
.ofx-modal-files-list::-webkit-scrollbar-thumb:hover {
  background: #00897b;
}

/* Modal Minimizado */
.ofx-upload-modal.minimized {
  background: transparent;
  pointer-events: none;
}

.ofx-upload-modal.minimized .ofx-upload-modal-content {
  display: none;
}

/* Widget Flutuante de Upload */
.floating-upload-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  animation: slideInUp 0.3s ease;
  overflow: hidden;
  transition: all 0.3s ease;
}

.floating-upload-widget:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.floating-upload-widget.completed {
  border-left: 4px solid #4caf50;
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.floating-widget-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 12px 12px 0 0;
}

.floating-widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.floating-widget-title i {
  font-size: 20px;
}

.floating-widget-actions {
  display: flex;
  gap: 4px;
}

.floating-widget-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  padding: 0;
}

.floating-widget-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.floating-widget-btn i {
  font-size: 18px;
}

.floating-widget-body {
  padding: 12px 16px;
}

.floating-widget-progress {
  margin-bottom: 8px;
}

.floating-widget-progress-bar {
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.floating-widget-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #26a69a 0%, #00897b 100%);
  transition: width 0.3s ease;
  border-radius: 3px;
}

.floating-widget-progress-text {
  font-size: 11px;
  color: #666;
  text-align: right;
}

.floating-widget-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #666;
  flex-wrap: wrap;
}

.floating-widget-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.floating-widget-stats .uploading {
  color: #ff9800;
}

.floating-widget-stats .uploading i {
  animation: spin 1s linear infinite;
}

.floating-widget-stats .success {
  color: #4caf50;
}

.floating-widget-stats .error {
  color: #f44336;
}

.floating-widget-stats i.tiny {
  font-size: 14px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsivo */
@media (max-width: 600px) {
  .floating-upload-widget {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
  }
}

/* Relatório OFX na página e erros no modal */
.ofx-transaction-table-wrap {
  max-height: min(70vh, 560px);
  overflow: auto;
  margin-top: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

.ofx-transaction-table tr.ofx-row-invalid {
  background-color: #ffebee !important;
}

.ofx-import-error-banner {
  border-left: 4px solid #c62828;
}

.ofx-collapsible-item--error > .collapsible-header {
  background-color: #ffebee;
  border-left: 4px solid #c62828;
}

.ofx-modal-file-item--error {
  border-left: 4px solid #c62828;
  background: #fff8f8;
}

.ofx-modal-file-error-msg {
  margin-top: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #b71c1c;
  background: #ffebee;
  border-radius: 6px;
  border: 1px solid #ef9a9a;
}

.ofx-modal-file-error-msg--visible {
  box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.15);
}

