/* New Layout Styles - iLovePDF inspired */

/* ===== Base Styles ===== */
:root {
  --primary-color: #1877f2; /* Facebook blue */
  --primary-light: #e7f3ff;
  --primary-dark: #166fe5;
  --secondary-color: #455a64; /* Dark blue-gray */
  --accent-color: #42b72a; /* Facebook green */
  --text-primary: #333333;
  --text-secondary: #757575;
  --bg-light: #ffffff;
  --bg-off-white: #f5f5f5;
  --border-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --shadow-light: rgba(0, 0, 0, 0.05);
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  color: var(--text-primary);
}

/* ===== Navigation ===== */
.main-nav {
  background-color: var(--bg-light);
  box-shadow: 0 2px 4px var(--shadow-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.logo {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  margin-left: 0;
}

.logo a {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  text-align: center;
}

.logo span {
  color: var(--primary-color);
}

.nav-tools {
  display: flex;
  gap: 10px;
}

.nav-tool {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.nav-tool:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.nav-tool.active {
  color: var(--primary-color);
  font-weight: 700;
}

.nav-auth {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-login {
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.btn-login:hover {
  color: var(--primary-color);
}

.btn-signup {
  font-size: 14px;
  font-weight: 600;
  color: var(--bg-light);
  background-color: var(--primary-color);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-signup:hover {
  background-color: var(--primary-dark);
}

/* ===== Legacy Hero Section (deprecated) ===== */
.hero-legacy {
  background-color: var(--primary-color);
  color: var(--bg-light);
  padding: 50px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-legacy-container {
  max-width: 800px;
  margin: 0 auto;
}

.hero-legacy h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
  color: white;
  word-wrap: break-word;
  padding: 0 20px;
}

.hero-legacy p {
  font-size: 18px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
}

/* ===== Main Container ===== */
.main-container {
  /* max-width: 1000px;
  margin: 30px auto; */
  padding: 0 20px;
}

/* ===== Steps Container ===== */
.steps-container {
  margin-bottom: 40px;
  position: relative;
  max-width: 1000px;
  /* margin-left: auto;
  margin-right: auto; */
  padding: 0;
  margin: 30px auto;
}

.section-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
  color: var(--text-primary);
}

.steps-row {
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: relative;
  padding-bottom: 20px;
}

/* Add a progress line connecting the steps vertically */
.steps-row::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 30px;
  width: 4px;
  background-color: var(--primary-light);
  z-index: 0;
}

.step-card {
  background-color: var(--bg-light);
  border-radius: 8px;
  box-shadow: 0 2px 6px var(--shadow-light);
  overflow: visible;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
  margin-left: 45px;
  width: calc(100% - 45px);
  padding-bottom: 15px;
}

.step-card::before {
  content: "";
  position: absolute;
  top: 24px;
  left: -22px;
  width: 30px;
  height: 30px;
  background-color: var(--primary-color);
  border-radius: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

#step-1::before {
  content: "1";
}

#step-2::before {
  content: "2";
}

#step-3::before {
  content: "3";
}

.step-card.results-ready {
  border: 2px solid var(--primary-color);
  transform: translateY(-5px);
}

.step-header {
  background-color: var(--bg-off-white);
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.step-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--primary-color);
}

.step-header p {
  font-size: 16px;
  margin: 0;
  color: var(--text-secondary);
}

.step-content {
  padding: 24px;
}

.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-next,
.btn-back {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-next {
  background-color: var(--primary-color);
  color: white;
  border: none;
}

.btn-next:hover {
  background-color: var(--primary-dark);
}

.btn-back {
  background-color: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-back:hover {
  background-color: var(--bg-off-white);
}

/* Column Selection Styles */
.column-selection {
  max-width: 100%;
}

/* ===== Info Sections ===== */
.info-section {
  margin-bottom: 50px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.info-section h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-primary);
}

/* How It Works Cards */
.info-cards {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.info-card {
  flex: 1;
  min-width: 250px;
  background-color: var(--bg-light);
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 6px var(--shadow-light);
  text-align: center;
}

.info-icon {
  color: var(--primary-color);
  margin-bottom: 16px;
}

.info-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.info-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* Blog Cards */
.blog-cards {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.blog-card {
  flex: 1;
  min-width: 280px;
  background-color: var(--bg-light);
  border-radius: 8px;
  box-shadow: 0 2px 6px var(--shadow-light);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.blog-image {
  height: 160px;
  overflow: hidden;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-content {
  padding: 20px;
}

.blog-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.blog-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.blog-link {
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.blog-link:hover {
  text-decoration: underline;
}

/* FAQ Section */
.faq-container {
  max-width: 800px;
  margin: 1rem auto;
}

.faq-item {
  background-color: var(--bg-light);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.1);
  margin-bottom: 16px;
  overflow: hidden;
}

.faq-question {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.home-faqs {
  padding: 16px 24px;
}

.faq-question h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.faq-toggle {
  font-size: 24px;
  color: var(--primary-color);
}

.faq-answer {
  padding: 0 24px 16px;
  display: none;
}

.faq-answer p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
}

/* Footer container */
.main-footer {
  background-color: #ffffff; /* dark blue-gray */
  color: #000000; /* light text */
  padding: 40px 20px 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border-top: 1px solid #e2e8f0;
}

/* Inner container for flex layout */
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

/* Logo and tagline */
.footer-logo a {
  font-size: 28px;
  font-weight: 700;
  color: #000000;
  text-decoration: none;
}

.footer-logo a span {
  color: #3b82f6; /* bright blue accent */
}

.footer-logo p {
  margin-top: 6px;
  font-size: 14px;
  color: #a1a1a1; /* lighter gray text */
}

/* Newsletter section */
.newsletter-container {
  flex: 1;
  min-width: 280px;
  max-width: 450px;
}

.newsletter-container p {
  font-size: 15px;
  margin-bottom: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Newsletter input + button inline */
.newsletter-form {
  display: flex;
  gap: 10px;
}

.newsletter-form input[type="email"] {
  flex-grow: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: none;
  border-radius: 4px;
  outline: none;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

.newsletter-form input[type="email"]::placeholder {
  color: #94a3b8; /* placeholder color */
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: #2563eb;
}

/* Footer bottom text */
.footer-bottom {
  max-width: 1200px;
  margin: 30px auto 0;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  user-select: none;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
  }
  
  .newsletter-container {
    max-width: 100%;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .newsletter-form input[type="email"], .btn-primary {
    width: 100%;
  }
}

/* ===== Responsive Styles ===== */

/* Tablet (1024px) */
@media (max-width: 1024px) {
  .hero-legacy h1 {
    font-size: 32px;
  }
}

/* Small tablet (768px) */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    padding: 12px 16px;
    align-items: flex-start;
  }

  .logo {
    margin-bottom: 8px;
    margin-left: 0;
    padding-top: 0;
    padding-bottom: 0;
    align-self: flex-start;
  }

  .nav-tools {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0;
    margin-left: 0;
  }

  .nav-auth {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
  }

  .hero-legacy {
    padding: 40px 20px;
  }

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

  .info-cards,
  .blog-cards {
    flex-direction: column;
  }

  .steps-container {
    padding: 0 15px;
  }

  .step-card {
    margin-left: 35px;
    width: calc(100% - 35px);
  }

  .step-card::before {
    left: -17px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .steps-row::before {
    left: 25px;
  }

  .step-content {
    padding: 15px;
  }

  .column-section {
    padding: 10px 0;
  }

  .chip-container {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
  }

  .table-container {
    margin: 10px 0;
    max-width: calc(100vw - 70px);
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

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

  .input-group input {
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
  }

  .step-actions {
    justify-content: center;
  }

  .upload-area {
    padding: 20px 10px;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .image-item img {
    height: 80px;
  }
}

/* Mobile (600px) */
@media (max-width: 600px) {
  .hero-legacy h1 {
    font-size: 24px;
  }
}

/* Small mobile (480px) */
@media (max-width: 480px) {
  .hero-legacy h1 {
    font-size: 20px;
  }
  .step-card {
    margin-left: 25px;
    width: calc(100% - 25px);
  }

  .step-card::before {
    left: -12px;
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .steps-row::before {
    left: 20px;
  }

  .step-header {
    padding: 12px 15px;
  }

  .step-header h2 {
    font-size: 16px;
  }

  .step-header p {
    font-size: 14px;
  }

  .chip {
    width: 100%;
    justify-content: center;
    border-radius: 4px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Adjustments for specific card contents */
.column-section {
  margin-bottom: 20px;
}

.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
  max-width: 100%;
}

.table-container {
  overflow-x: auto;
  margin: 15px 0;
}

/* Field selection styling */
.section-subtitle {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.chip {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-off-white);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 5px;
}

.chip.selected {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.input-group input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
}

.btn-secondary {
  background-color: var(--bg-off-white);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.step-actions {
  margin-top: 30px;
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-primary:disabled {
  background-color: var(--border-color);
  cursor: not-allowed;
}

/* Table styling */
.table-container {
  overflow-x: auto;
  margin: 15px 0;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

#results-table {
  width: 100%;
  border-collapse: collapse;
}

#results-table th,
#results-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

#results-table th {
  background-color: var(--bg-off-white);
  font-weight: 600;
}

.image-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.results-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

/* File Upload Area */
.upload-container {
  width: 100%;
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--bg-off-white);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-light);
}

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon {
  color: var(--primary-color);
  margin-bottom: 10px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary-color);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
}

.btn-text:hover {
  color: var(--primary-dark);
}

.upload-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 5px;
}

.image-preview-container {
  background-color: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 20px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-off-white);
}

.preview-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.preview-actions {
  display: flex;
  gap: 10px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding: 16px;
}

.image-item {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.image-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.image-item .remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
}

/* Loading and Status Indicators */
.status-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.status-overlay p {
  color: white;
  font-size: 16px;
  margin: 10px 0;
}

.progress-container {
  width: 80%;
  max-width: 300px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  height: 10px;
  margin: 10px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.progress-text {
  color: white;
  font-size: 14px;
  margin: 5px 0;
}

.status-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 4px;
  background-color: var(--bg-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
  font-size: 14px;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
}

.status-message.error {
  background-color: #ffebee;
  color: #d32f2f;
}

.status-message.success {
  background-color: #e8f5e9;
  color: #388e3c;
}

.status-message.info {
  background-color: #e3f2fd;
  color: #1565c0;
}

/* Image modal for viewing extracted images */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.modal-image {
  max-width: 100%;
  max-height: 90vh;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.close-modal {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 30px;
  cursor: pointer;
}

/* PDF Preview Styles */
.pdf-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: var(--bg-off-white);
  border-radius: 4px;
  color: var(--primary-color);
}

.pdf-preview svg {
  margin-bottom: 8px;
}

.pdf-preview span {
  font-size: 14px;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .logo {
    padding-top: 0;
  }
}