/* ========================================================
   COCA-COLA SSD INTELLIGENCE PLATFORM — UPLOAD CSS
   ======================================================== */

.upload-tabs-container {
  display: flex;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 24px;
  max-width: 480px;
}

.upload-tab {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s var(--ease);
}

.upload-tab:hover:not(.active) {
  color: var(--text-1);
  background: var(--surface-3);
}

.upload-tab.active {
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-red);
}

.upload-panel {
  display: none;
  animation: fadeUp 0.35s var(--ease);
}

.upload-panel.active-panel {
  display: block;
}

.upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.upload-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, transparent 60%);
}

/* DRAG & DROP */
.drag-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  background: var(--bg-main);
  transition: all 0.3s var(--ease);
  cursor: pointer;
}

.drag-drop-zone.dragover {
  border-color: var(--red);
  background: var(--red-soft);
  transform: scale(1.01);
}

.zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.drag-drop-zone h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
}

.drag-drop-zone p {
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 20px;
}

.btn-primary {
  padding: 10px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.btn-primary:hover {
  background: var(--surface-2);
  border-color: var(--red);
  color: var(--red);
}

/* SELECTED FILE CARD */
.selected-file-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 24px;
  animation: fadeUp 0.3s var(--ease);
}

.file-icon {
  font-size: 28px;
}

.file-details {
  flex: 1;
}

.file-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-1);
}

.file-size {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.remove-file-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.remove-file-btn:hover {
  background: var(--surface-3);
  color: var(--red);
}

/* BUTTONS & ACTIONS */
.action-row {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.btn-submit {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-red);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230, 27, 35, 0.32);
}

.btn-secondary {
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-2);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text-1);
  border-color: var(--text-3);
}

/* Match the height of the "Existing Uploaded Files" select input */
.compact-action-btn {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
}

.existing-files-group {
  gap: 10px;
}

.existing-files-control-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: nowrap;
}

.existing-files-select {
  flex: 1 1 auto;
  min-width: 0;
}

.existing-files-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}

.existing-files-actions .compact-action-btn {
  white-space: nowrap;
}

.muted {
  color: var(--text-3);
  font-size: 12.5px;
}

@media (max-width: 900px) {
  .existing-files-control-row {
    flex-wrap: wrap;
  }

  .existing-files-select {
    flex-basis: 100%;
  }

  .existing-files-actions {
    width: 100%;
  }

  .existing-files-actions .compact-action-btn {
    flex: 1 1 160px;
  }
}

/* PROGRESS BAR */
.progress-container {
  margin-top: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  animation: fadeUp 0.3s var(--ease);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-status {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
}

.progress-pct {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--red);
}

.progress-bar-bg {
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--red);
  border-radius: 4px;
  transition: width 0.1s linear;
}

/* MESSAGES */
.message-banner {
  display: flex;
  gap: 16px;
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 24px;
  animation: fadeUp 0.3s var(--ease);
}

.message-banner.success {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.message-banner.error {
  background: rgba(230, 27, 35, 0.04);
  border: 1px solid rgba(230, 27, 35, 0.15);
}

.msg-icon {
  font-size: 22px;
  line-height: 1;
}

.msg-content strong {
  display: block;
  font-size: 14.5px;
  color: var(--text-1);
  margin-bottom: 4px;
}

.msg-content p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
}

/* FORM GRID */
.db-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.form-control {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  width: 100%;
}

.form-control:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(230, 27, 35, 0.08);
  background: var(--surface);
}

.form-control::placeholder {
  color: var(--text-3);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%234B5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2 4 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  padding-right: 40px;
}

.error-msg {
  display: none;
  font-size: 11.5px;
  color: var(--red);
  font-weight: 500;
}

.form-group.has-error .form-control {
  border-color: var(--red);
  background: rgba(230, 27, 35, 0.01);
}

.form-group.has-error .error-msg {
  display: block;
}

.db-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.disabled-blur {
  filter: blur(1px) !important;
  opacity: 0.75 !important;
  pointer-events: none !important;
  user-select: none !important;
}

@media (max-width: 480px) {
  .upload-tabs-container {
    flex-direction: column;
    max-width: 100%;
    gap: 4px;
  }
  .upload-tab {
    width: 100%;
  }
  .upload-card {
    padding: 20px 16px;
  }
  .drag-drop-zone {
    padding: 28px 16px;
  }
  .action-row,
  .db-action-row {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .btn-submit,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }
}
