/**
 * FileForge - SaaS Stylesheet
 * Brand colors: Primary: #2563EB, Secondary: #0F172A, Accent: #06B6D4, Bg: #F8FAFC
 */

:root {
  --ff-primary: #2563eb;
  --ff-primary-hover: #1d4ed8;
  --ff-primary-light: #eff6ff;
  --ff-secondary: #0f172a;
  --ff-secondary-light: #1e293b;
  --ff-accent: #06b6d4;
  --ff-accent-hover: #0891b2;
  --ff-bg: #f8fafc;
  --ff-card-bg: #ffffff;
  --ff-border: #e2e8f0;
  --ff-text: #1e293b;
  --ff-text-muted: #64748b;
  --ff-success: #10b981;
  --ff-warning: #f59e0b;
  --ff-danger: #ef4444;
  --ff-radius: 1rem;
  --ff-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --ff-shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --ff-shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

body {
  background-color: var(--ff-bg);
  color: var(--ff-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* Navbar */
.navbar-fileforge {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ff-border);
  padding: 0.85rem 0;
  transition: all 0.2s ease;
}

.brand-logo {
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--ff-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--ff-primary) 0%, var(--ff-accent) 100%);
  color: #fff;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.nav-link {
  font-weight: 500;
  color: #475569 !important;
  padding: 0.5rem 0.85rem !important;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--ff-primary) !important;
  background-color: var(--ff-primary-light);
}

/* Hero Section */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.07) 0%, rgba(248, 250, 252, 0) 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--ff-primary-light);
  color: var(--ff-primary);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ff-secondary);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--ff-text-muted);
  max-width: 680px;
  margin: 1.25rem auto 2rem;
  line-height: 1.6;
}

/* Upload Dropzone */
.dropzone-container {
  background: #ffffff;
  border: 2px dashed #93c5fd;
  border-radius: var(--ff-radius);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--ff-shadow-md);
  position: relative;
  overflow: hidden;
}

.dropzone-container:hover, .dropzone-container.dragover {
  border-color: var(--ff-primary);
  background-color: #f0f7ff;
  transform: translateY(-2px);
  box-shadow: var(--ff-shadow-lg);
}

.dropzone-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--ff-primary-light);
  color: var(--ff-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.25rem;
  transition: transform 0.2s ease;
}

.dropzone-container:hover .dropzone-icon {
  transform: scale(1.1);
}

/* Cards & Components */
.ff-card {
  background: var(--ff-card-bg);
  border: 1px solid var(--ff-border);
  border-radius: var(--ff-radius);
  box-shadow: var(--ff-shadow-sm);
  transition: all 0.2s ease;
}

.ff-card:hover {
  box-shadow: var(--ff-shadow-md);
  border-color: #cbd5e1;
}

.tool-card {
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.tool-card:hover {
  transform: translateY(-3px);
  color: inherit;
  border-color: #93c5fd;
  box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.12);
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  background: var(--ff-primary-light);
  color: var(--ff-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ff-secondary);
  margin-bottom: 0.4rem;
}

.tool-card-desc {
  font-size: 0.9rem;
  color: var(--ff-text-muted);
  line-height: 1.5;
  flex-grow: 1;
}

/* File Upload Item Cards */
.file-item-card {
  background: #ffffff;
  border: 1px solid var(--ff-border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--ff-shadow-sm);
}

.file-item-thumb {
  width: 54px;
  height: 54px;
  border-radius: 0.5rem;
  object-fit: cover;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--ff-primary);
  flex-shrink: 0;
}

.file-item-meta {
  flex-grow: 1;
  min-width: 0;
}

.file-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ff-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-info {
  font-size: 0.8rem;
  color: var(--ff-text-muted);
}

/* Result Card */
.result-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border: 1px solid #86efac;
  border-radius: var(--ff-radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.stat-badge {
  background: #dcfce7;
  color: #15803d;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Before / After Comparison */
.ba-compare-container {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  max-width: 600px;
  margin: 1.5rem auto;
  border: 1px solid var(--ff-border);
  box-shadow: var(--ff-shadow-md);
  user-select: none;
}

.ba-image-before, .ba-image-after {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.ba-image-after-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  border-right: 2px solid #ffffff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.3);
}

.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  margin-left: -18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--ff-primary);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--ff-primary);
  pointer-events: none;
}

/* Buttons */
.btn-primary {
  background-color: var(--ff-primary);
  border-color: var(--ff-primary);
  color: #ffffff;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 0.6rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--ff-primary-hover);
  border-color: var(--ff-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background-color: var(--ff-secondary);
  border-color: var(--ff-secondary);
  color: #ffffff;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 0.6rem;
}

.btn-secondary:hover {
  background-color: var(--ff-secondary-light);
  border-color: var(--ff-secondary-light);
}

/* Footer */
.footer-fileforge {
  background: var(--ff-secondary);
  color: #94a3b8;
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-fileforge a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-fileforge a:hover {
  color: #ffffff;
}

.footer-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.footer-fileforge .footer-readable-text,
.footer-fileforge .footer-readable-text.text-muted,
.footer-fileforge p.footer-readable-text,
.footer-fileforge .row.small.footer-readable-text,
.footer-fileforge .row.small.text-muted {
    color: #e2e8f0 !important;
    opacity: 1 !important;
}

.footer-fileforge .footer-readable-text span,
.footer-fileforge .footer-readable-text div {
    color: #e2e8f0 !important;
    opacity: 1 !important;
}

/* Search input */
.search-input-wrap {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}

.search-input-wrap i {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
}

.search-input-wrap input {
  padding-left: 3rem;
  padding-right: 1.25rem;
  height: 52px;
  border-radius: 9999px;
  border: 1px solid var(--ff-border);
  box-shadow: var(--ff-shadow-sm);
  font-size: 1rem;
}

.search-input-wrap input:focus {
  border-color: var(--ff-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.35rem;
  }
  .dropzone-container {
    padding: 2.25rem 1rem;
  }
}
