/* Upload card - fills container */

.ab-upload-card { 
  border-radius: 12px; 
  box-shadow: 0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06); 
  transition: box-shadow .2s ease, transform .15s ease; 
  background: #ffffff;
  border: 1px solid #f1f3f4;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%; /* Fill parent */
}

.ab-upload-card.ab-clickable-card {
  cursor: pointer;
}

.ab-upload-card.ab-clickable-card:hover { 
  box-shadow: 0 6px 20px rgba(0,0,0,.15), 0 3px 8px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

.ab-upload-card.ab-clickable-card:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* Card body */
.ab-upload-card .card-body {
  padding: 1rem;
  padding-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Status circle */
.ab-upload-percent-circle { 
  width: 48px; 
  height: 48px; 
  border-radius: 50%; 
  background: #e5f0ff; 
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.625rem;
}

.ab-upload-status-text { 
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-upload-status-icon { 
  font-size: 0.95rem;
  flex-shrink: 0;
}

.ab-upload-card .spinner-border { 
  width: 0.875rem; 
  height: 0.875rem; 
}

/* File info section */
.ab-upload-card .mt-3 {
  margin-top: 0.5rem !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ab-upload-card .small.text-muted {
  font-size: 0.75rem;
  margin-bottom: 0.25rem !important;
  flex-shrink: 0;
}

.ab-upload-filename { 
  font-size: 0.85rem; 
  font-weight: 600;
  word-break: break-word; 
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  margin-bottom: 0.375rem !important;
  flex-shrink: 0;
}

.ab-upload-card .ab-last-updated {
  margin-top: auto;
  padding-right: 1.875rem;
  flex-shrink: 0;
}

/* Action buttons - ALWAYS absolute positioning */
.ab-btn-upload-actions,
.ab-btn-export-actions {
  background: transparent !important;
  border: none !important;
  padding: 0.25rem !important;
  color: #6b7280 !important;
  border-radius: 0.25rem;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
}

/* Dropdown for import - absolute bottom right */
.ab-import-actions-dropdown {
  position: absolute !important;
  bottom: 0.5rem !important;
  right: 0.5rem !important;
  z-index: 20;
}

.ab-import-actions-dropdown .ab-btn-upload-actions {
  position: static !important;
}

/* Export button - absolute bottom right */
.ab-btn-export-actions {
  position: absolute !important;
  bottom: 0.5rem !important;
  right: 0.5rem !important;
  z-index: 20;
}

.ab-btn-upload-actions:hover,
.ab-btn-export-actions:hover {
  background: rgba(107, 114, 128, 0.1) !important;
}

.ab-btn-upload-actions i,
.ab-btn-export-actions i {
  font-size: 0.875rem;
}

/* Status colors */
.ab-upload-card[data-status="done"] .ab-upload-percent-circle,
.ab-upload-card[data-status="success"] .ab-upload-percent-circle { 
  background: #d1f7d9; 
}

.ab-upload-card[data-status="failed"] .ab-upload-percent-circle { 
  background: #f9dfe1; 
}

.ab-upload-card[data-status="processing"] .ab-upload-percent-circle,
.ab-upload-card[data-status="inprogress"] .ab-upload-percent-circle,
.ab-upload-card[data-status="pending"] .ab-upload-percent-circle { 
  background: #e5f0ff; 
}

/* Dropdown menu */
.ab-card-dropdown-menu {
  min-width: 150px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  border: 1px solid #e5e7eb;
  padding: 0.25rem 0;
}

.ab-card-dropdown-menu .dropdown-item {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}

.ab-card-dropdown-menu .dropdown-item:hover {
  background-color: #f3f4f6;
}

.ab-card-dropdown-menu .dropdown-item.text-danger:hover {
  background-color: #fef2f2;
}

/* Responsive */
@media (max-width: 575px) {
  .ab-upload-card .card-body {
    padding: 0.75rem;
    padding-bottom: 2rem;
  }
  
  .ab-upload-percent-circle { 
    width: 42px; 
    height: 42px; 
    font-size: 0.75rem;
  }
  
  .ab-upload-filename {
    font-size: 0.8rem;
  }
}

@media (min-width: 1200px) {
  .ab-upload-card .card-body {
    padding: 1.125rem;
    padding-bottom: 2.625rem;
  }
  
  .ab-upload-percent-circle { 
    width: 50px; 
    height: 50px; 
    font-size: 0.875rem;
  }
  
  .ab-upload-status-text {
    font-size: 0.9rem;
  }
  
  .ab-upload-filename {
    font-size: 0.875rem;
  }
}

/* Project badge (Import/Export) */
.ab-project-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  white-space: nowrap;
  gap: 0.25rem;
}

.ab-project-badge .ab-badge-text {
  display: inline;
}
