/* ============================================
   CHOOSE FILE — Premium Modern File Upload
   Redesigned with a sleek button-style approach
   Clean, minimal, with smooth micro-interactions
   ============================================ */

/* ─── File Upload Zone — Modern Button Style ─── */
.file-upload-zone {
  position: relative;
  cursor: pointer;
  width: 100%;
  padding: 28px 24px;
  background: var(--glass-bg, rgba(255,255,255,0.04));
  border: 1.5px dashed var(--glass-border, rgba(255,255,255,0.08));
  border-radius: var(--card-radius, 20px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  min-height: 180px;
}

/* Gradient border glow on hover (like tool cards) */
.file-upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius, 20px);
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent-violet, #7c6fff), var(--accent-cyan, #00d4ff), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}

.file-upload-zone:hover::before {
  opacity: 1;
}

/* Shine overlay on hover */
.file-upload-zone::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.03) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}

.file-upload-zone:hover::after {
  opacity: 1;
}

/* Ensure content is above pseudo-elements */
.file-upload-zone > * {
  position: relative;
  z-index: 1;
}

.file-upload-zone:hover {
  border-color: transparent;
  background: var(--glass-bg-hover, rgba(255,255,255,0.07));
  transform: translateY(-3px);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.25),
    0 0 30px var(--color-card-hover-shadow, rgba(124,111,255,0.1));
}

/* ─── Upload Icon ─── */
.file-upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124,111,255,0.1), rgba(0,212,255,0.08));
  border: 1px solid rgba(124,111,255,0.15);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  margin: 0 auto 4px;
  flex-shrink: 0;
}

.file-upload-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent-violet, #7c6fff);
  transition: transform 0.4s ease;
}

.file-upload-zone:hover .file-upload-icon {
  transform: scale(1.1) rotate(-4deg);
  background: linear-gradient(135deg, rgba(124,111,255,0.18), rgba(0,212,255,0.14));
  border-color: rgba(124,111,255,0.3);
  box-shadow: 0 0 25px rgba(124,111,255,0.12);
}

.file-upload-zone.drag-over .file-upload-icon {
  transform: scale(1.15) rotate(-6deg);
  background: linear-gradient(135deg, rgba(124,111,255,0.25), rgba(0,212,255,0.2));
  border-color: var(--accent-violet, #7c6fff);
  box-shadow: 0 0 35px rgba(124,111,255,0.2);
}

.file-upload-zone.has-file .file-upload-icon {
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.1));
  border-color: rgba(34,197,94,0.3);
}

.file-upload-zone.has-file .file-upload-icon svg {
  color: var(--accent-green, #00ffaa);
}

/* ─── Upload Text ─── */
.file-upload-text {
  text-align: center;
  transition: opacity 0.3s ease;
}

.file-upload-title {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #eeeeff);
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}

.file-upload-hint {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted, #6b6b8a);
  line-height: 1.5;
}

.file-upload-hint strong {
  color: var(--accent-violet, #7c6fff);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(124,111,255,0.3);
  transition: text-decoration-color 0.3s ease;
}

.file-upload-zone:hover .file-upload-hint strong {
  text-decoration-color: rgba(124,111,255,0.7);
}

/* ─── File Info Display ─── */
.file-upload-info {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin-top: 8px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.15);
  border-radius: 12px;
  animation: fileInfoSlideIn 0.35s ease forwards;
  width: 100%;
  max-width: 320px;
}

.file-upload-zone.has-file .file-upload-info {
  display: flex;
}

.file-upload-info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(34,197,94,0.12);
  flex-shrink: 0;
}

.file-upload-info-icon svg {
  width: 14px;
  height: 14px;
  color: var(--accent-green, #00ffaa);
}

.file-upload-info-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-primary, #eeeeff);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.file-upload-info-size {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  color: var(--text-muted, #6b6b8a);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Remove Button ─── */
.file-upload-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255,107,107,0.1);
  color: var(--accent-coral, #ff6b6b);
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  padding: 0;
}

.file-upload-remove:hover {
  background: rgba(255,107,107,0.25);
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(255,107,107,0.15);
}

.file-upload-remove:active {
  transform: scale(0.95);
}

/* ─── Multiple Files Count ─── */
.file-upload-count {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 18px;
  background: rgba(124,111,255,0.08);
  border: 1px solid rgba(124,111,255,0.15);
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: var(--accent-violet, #7c6fff);
  font-weight: 500;
  animation: fileInfoSlideIn 0.35s ease forwards;
}

.file-upload-zone.has-file.multi-file .file-upload-count {
  display: flex;
}

.file-upload-zone.has-file.multi-file .file-upload-info {
  display: none;
}

/* ─── Drag Over State ─── */
.file-upload-zone.drag-over {
  border-color: var(--accent-violet, #7c6fff) !important;
  background: rgba(124,111,255,0.06);
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 0 50px rgba(124,111,255,0.12),
    0 12px 40px rgba(0,0,0,0.25),
    inset 0 0 40px rgba(124,111,255,0.03);
}

.file-upload-zone.drag-over .file-upload-text {
  opacity: 0.7;
}

/* ─── Has File State ─── */
.file-upload-zone.has-file {
  border-style: solid;
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.03);
}

.file-upload-zone.has-file:hover {
  border-color: rgba(34,197,94,0.5);
}

/* ─── Focus Visible ─── */
.file-upload-zone:focus-within {
  outline: none;
  border-color: var(--accent-violet, #7c6fff);
  box-shadow: 0 0 0 3px rgba(124,111,255,0.15), 0 0 30px rgba(124,111,255,0.08);
}

.file-upload-zone:focus-within::before {
  opacity: 1;
}

/* ─── Disabled State ─── */
.file-upload-zone.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ─── Pulse Animation for Upload Prompt ─── */
@keyframes uploadPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(124,111,255,0);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(124,111,255,0.05);
  }
}

.file-upload-zone:not(.has-file):not(.drag-over) {
  animation: uploadPulse 3s ease-in-out infinite;
}

.file-upload-zone:not(.has-file):not(.drag-over):hover {
  animation: none;
}

/* ─── Slide In Animation ─── */
@keyframes fileInfoSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .file-upload-zone {
    padding: 24px 20px;
    min-height: 160px;
  }

  .file-upload-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .file-upload-icon svg {
    width: 24px;
    height: 24px;
  }

  .file-upload-title {
    font-size: 0.92rem;
  }

  .file-upload-hint {
    font-size: 0.78rem;
  }

  .file-upload-info-name {
    max-width: 140px;
  }
}

@media (max-width: 540px) {
  .file-upload-zone {
    padding: 20px 16px;
    min-height: 150px;
    border-radius: 16px;
  }

  .file-upload-zone::before {
    border-radius: 16px;
  }

  .file-upload-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .file-upload-icon svg {
    width: 22px;
    height: 22px;
  }

  .file-upload-title {
    font-size: 0.88rem;
  }

  .file-upload-hint {
    font-size: 0.74rem;
  }

  .file-upload-info {
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
  }

  .file-upload-info-name {
    max-width: 120px;
  }
}
