/* ==========================================
   FILE CONVERTER - app.css
   Uses main.css CSS variables for consistency
   ========================================== */

/* ---- Upload / Drop Area ---- */
#drop-area {
  border: 2.5px dashed var(--primary);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  background: var(--primary-glass);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

#drop-area:hover,
#drop-area.drag-over {
  background: var(--primary-transparent);
  border-color: var(--primary-dark);
  transform: scale(1.01);
  box-shadow: 0 8px 30px var(--primary-transparent);
}

#drop-area .upload-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
  display: block;
  animation: float 3s ease-in-out infinite;
}

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

#drop-area p {
  color: var(--text-secondary, #666);
  font-size: 1rem;
  margin-bottom: 1.2rem;
  font-family: 'Inter', sans-serif;
}

/* ---- Select Files Button ---- */
#fileSelect {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 15px var(--primary-transparent);
}

#fileSelect:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-transparent);
}

/* ---- Convert To Select ---- */
#convertTo,
select.form-select,
select {
  border: 1.5px solid var(--primary-lighter, #c8c4ff);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  color: var(--text-color, #333);
  background: var(--bg-color, #fff);
  margin-top: 0.5rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

#convertTo:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glass);
}

/* ---- File Cards (per file result) ---- */
.card {
  background: var(--bg-color, #fff);
  border: 1px solid var(--border-color, #eee);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ---- Progress Bar ---- */
.progress {
  height: 8px;
  background: var(--primary-lighter, #c8c4ff);
  border-radius: 50px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 50px;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ---- Processing Spinner ---- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--primary-lighter);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Alert Boxes ---- */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  margin: 0.75rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-info {
  background: var(--primary-glass);
  color: var(--primary-dark);
  border: 1px solid var(--primary-lighter);
}

.alert-success {
  background: #f0fff4;
  color: #276749;
  border: 1px solid #9ae6b4;
}

.alert-danger {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
}

.alert-warning {
  background: #fffbeb;
  color: #b7791f;
  border: 1px solid #f6e05e;
}

/* ---- Download Button ---- */
.download-btn,
.alert-success a,
#uploadResults a[href*="download"] {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary) !important;
  color: #fff !important;
  padding: 0.65rem 1.5rem;
  border-radius: 50px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--primary-transparent);
  margin-top: 0.5rem;
  border: none;
}

.download-btn:hover,
.alert-success a:hover,
#uploadResults a[href*="download"]:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--primary-transparent);
  color: #fff !important;
}

/* ---- Convert button / label ---- */
label[for="convertTo"] {
  font-weight: 600;
  color: var(--text-color, #333);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}

/* ---- Related Conversions Section ---- */
hr {
  border: none;
  border-top: 1px solid var(--border-color, #eee);
  margin: 1.5rem 0;
}

.related-conversions,
h3 + ul,
strong + ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.related-conversions li a,
#drop-area ~ ul li a {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--primary-glass);
  color: var(--primary);
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid var(--primary-lighter);
}

.related-conversions li a:hover,
#drop-area ~ ul li a:hover {
  background: var(--primary);
  color: #fff;
}

/* ---- Page wrapper ---- */
.converter-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ---- Page title ---- */
.converter-page h1,
.container > h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-color, #1a1a2e);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.converter-page h1 span,
.container > h1 span {
  color: var(--primary);
}

/* ---- Intro paragraph ---- */
.converter-page p,
.container > p:first-of-type {
  color: var(--text-secondary, #555);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-family: 'Inter', sans-serif;
}

/* ---- Bootstrap utility replacements ---- */
.mt-4 { margin-top: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.p-5 { padding: 3rem !important; }
.text-center { text-align: center; }
.border { border: 1px solid var(--border-color, #eee); }

/* Premium converter: upload progress + success (mirrors converter-premium.css when that file is read-only) */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.conversion-success-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 14px;
  padding: 20px 24px;
  margin-top: 16px;
  animation: slideUp 0.35s ease;
}

.success-icon-wrap {
  width: 48px;
  height: 48px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-icon-wrap i {
  font-size: 1.5rem;
  color: #16a34a;
}

.success-info {
  flex: 1;
  min-width: 0;
}

.success-title {
  font-weight: 700;
  font-size: 1rem;
  color: #15803d;
  margin-bottom: 2px;
}

.success-filename {
  font-size: 0.85rem;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.success-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 50px;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(79,70,229,0.35);
}

.success-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79,70,229,0.45);
  color: #fff !important;
}

.upload-progress-card {
  background: var(--primary-light, #eef2ff);
  border: 1.5px solid var(--primary-lighter, #c7d2fe);
  border-radius: 14px;
  padding: 20px 24px;
  margin-top: 16px;
  animation: slideUp 0.35s ease;
}

.upload-progress-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary, #4f46e5);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-track {
  height: 8px;
  background: rgba(79,70,229,0.15);
  border-radius: 50px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #7c3aed);
  border-radius: 50px;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

[data-theme='dark'] .conversion-success-card {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(134, 239, 172, 0.35);
}

[data-theme='dark'] .success-title {
  color: #86efac;
}

[data-theme='dark'] .success-filename {
  color: var(--text-light, #cbd5e0);
}

[data-theme='dark'] .upload-progress-card {
  background: rgba(79, 70, 229, 0.12);
  border-color: var(--border, #4a5568);
}

[data-theme='dark'] .upload-progress-title {
  color: var(--primary-light, #a29bfe);
}

@media (max-width: 768px) {
  #drop-area {
    padding: 24px 14px;
  }

  .upload-progress-card,
  .conversion-success-card {
    flex-direction: column;
    gap: 12px;
  }

  .success-download-btn,
  .download-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    display: flex;
  }

  .alert {
    padding: 12px 14px;
    font-size: 0.875rem;
  }

  .card {
    padding: 12px;
  }
}
