/* Walter_IJak — Professional UI/UX Styles */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #1f1f35;
  --border: #2a2a40;
  --border-glow: #6c5ce7;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555570;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-dark: #4834d4;
  --success: #00cec9;
  --success-dark: #00b894;
  --error: #ff6b6b;
  --warning: #ffa502;
  --gradient-1: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  --gradient-2: linear-gradient(135deg, #00cec9 0%, #55efc4 100%);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(108, 92, 231, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background animated grid */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 206, 201, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(162, 155, 254, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── HEADER ─── */
.header {
  position: relative;
  z-index: 10;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: white;
  letter-spacing: -1px;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--accent-light);
}

.header-badge {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ─── MAIN CONTAINER ─── */
.main {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

.hero {
  text-align: center;
  margin-bottom: 56px;
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero h1 .gradient-text {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── UPLOAD CARD ─── */
.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.upload-card:hover {
  border-color: rgba(108, 92, 231, 0.3);
  box-shadow: var(--shadow-glow);
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-1);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.05);
}

.drop-zone.dragover::before {
  opacity: 0.05;
}

.drop-zone-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  position: relative;
  z-index: 1;
  opacity: 0.6;
}

.drop-zone h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 14px;
  position: relative;
  z-index: 1;
}

.drop-zone .browse-link {
  color: var(--accent-light);
  text-decoration: underline;
  cursor: pointer;
}

.file-input {
  display: none;
}

/* File preview */
.file-preview {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 20px;
}

.file-preview.show {
  display: flex;
}

.file-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.file-icon.pdf {
  background: rgba(255, 107, 107, 0.15);
  color: var(--error);
}

.file-icon.docx {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent-light);
}

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

.file-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.file-remove {
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255, 107, 107, 0.1);
  color: var(--error);
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.file-remove:hover {
  background: rgba(255, 107, 107, 0.2);
}

/* ─── OPTIONS ─── */
.options {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.options label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.intensity-selector {
  display: flex;
  gap: 8px;
  flex: 1;
}

.intensity-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  text-align: center;
}

.intensity-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.intensity-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

/* ─── PROCESS BUTTON ─── */
.process-btn {
  width: 100%;
  margin-top: 28px;
  padding: 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gradient-1);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.process-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
}

.process-btn:active:not(:disabled) {
  transform: translateY(0);
}

.process-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── PROCESSING STATE ─── */
.processing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.processing-overlay.show {
  display: flex;
}

.processing-box {
  text-align: center;
  padding: 48px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

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

.processing-box h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.processing-box p {
  color: var(--text-muted);
  font-size: 14px;
}

/* ─── RESULTS ─── */
.results-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--success-dark);
  border-radius: var(--radius);
  padding: 40px;
  margin-top: 32px;
  box-shadow: 0 0 30px rgba(0, 206, 201, 0.08);
}

.results-card.show {
  display: block;
  animation: fadeSlideUp 0.5s ease;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.results-check {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 206, 201, 0.15);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.results-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.results-header p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-light);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Download buttons */
.download-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.download-btn:hover {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.download-btn .dl-icon {
  font-size: 20px;
}

.download-btn.pdf-btn .dl-icon { color: var(--error); }
.download-btn.docx-btn .dl-icon { color: var(--accent-light); }

/* ─── FOOTER ─── */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ─── ERRORS ─── */
.error-toast {
  display: none;
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--error);
  color: white;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(255, 107, 107, 0.3);
  animation: fadeSlideUp 0.3s ease;
}

.error-toast.show {
  display: block;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .header {
    padding: 16px 20px;
  }

  .header-badge {
    display: none;
  }

  .main {
    padding: 32px 16px 80px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero p {
    font-size: 15px;
  }

  .upload-card {
    padding: 28px 20px;
  }

  .drop-zone {
    padding: 36px 20px;
  }

  .options {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .download-row {
    grid-template-columns: 1fr;
  }
}
