body {
  background-color: var(--bg-white);
}

.hero {
  /* display: flex; */
  background-color: white;
  max-width: 1180px;
  margin: 25px auto;
  padding: 2.5rem;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.hero-content {
  max-width: 80%;
  margin: 0 auto;
}

.hero-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* 
          MAIN LAYOUT
      */

.container {
  display: flex;
  max-width: 1200px;
  margin: 25px auto;
  padding: 0 10px;
}

.output_container {
  display: flex;
  justify-content: center;
  max-width: 1175px;
  margin: 25px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* Sidebar */
.sidebar {
  width: 280px;
  margin-right: 30px;
  padding: 25px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.sidebar h2 {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.sidebar p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* 
          UPLOAD AREAS
      */

.upload-area {
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 25px;
  border-radius: 8px;
  background-color: var(--bg-light);
  border: 2px dashed var(--border-color);
  transition: background-color 0.3s, border-color 0.3s, transform 0.3s ease;
}

.upload-area:hover {
  border-color: var(--accent-color);
}

.upload-area p {
  font-size: 1.1rem;
  margin: 15px 0;
  color: var(--text-muted);
}

.upload-area button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.upload-area button:hover,
.upload-area button:focus {
  background-color: var(--primary-color-darker);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#uploadAreaPdf.dragover {
  background-color: rgba(40, 167, 69, 0.1); /* Light green */
  border-color: var(--accent-color);
  transform: scale(1.03);
}

#uploadAreaDocx.dragover {
  background-color: rgba(255, 193, 7, 0.1); /* Light yellow */
  border-color: #ffc107;
  transform: scale(1.03);
}

.file-input {
  display: none;
}

/* 
          PREVIEW AREAS
      */

.preview_area {
  display: flex;
  gap: 25px;
  margin-top: 30px;
}

.preview_area div {
  flex: 1;
  min-height: 50px;
  max-height: 350px;
  padding: 20px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow-y: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.preview_area div::-webkit-scrollbar {
  width: 10px;
}

.preview_area div::-webkit-scrollbar-thumb {
  background-color: var(--secondary-color);
  border-radius: 5px;
}

.preview_area div::-webkit-scrollbar-track {
  background: var(--bg-light);
}

/* Check Button */
button {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 14px 30px;
  font-size: 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  display: block;
  margin: 30px auto;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover,
button:focus {
  background-color: var(--accent-color-darker);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 
          OUTPUT AREA
      */

#output {
  justify-self: center;
  text-align: justify;
  width: 95%;
  padding: 25px;
  /* background: var(--bg-light); */
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: auto;
  font-size: 0.95rem;
  color: var(--text-muted);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  word-wrap: break-word;
}

#output .error {
  color: #dc3545;
  background-color: #ffe6e6;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #ffcccc;
  margin-bottom: 20px;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
}

/* Table styles inside output */
#output table {
  width: 100%;
  table-layout: fixed;
  margin-top: 10px;
}

#output th,
#output td {
  word-break: break-word;
  padding: 10px;
}

#output a {
  max-width: 100%;
  display: inline-block;
  word-break: break-word;
}

/* 
          PROCESSING DIALOG
      */

.processing-dialog {
  align-self: center;
  justify-self: center;
  border: none;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  width: 80%;
  min-width: 320px;
  text-align: center;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-spinner {
  border: 10px solid rgba(0, 0, 0, 0.1);
  border-top: 10px solid var(--primary-color);
  border-radius: 50%;
  width: 70px;
  height: 70px;
  animation: spin 1.2s linear infinite;
  margin-bottom: 25px;
}

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

.processing-dialog p {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.processing-dialog progress {
  width: 100%;
  height: 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  background-color: var(--bg-light);
  border-radius: 10px;
  overflow: hidden;
}

.processing-dialog progress::-webkit-progress-bar {
  background-color: var(--bg-light);
  border-radius: 10px;
}

.processing-dialog progress::-webkit-progress-value {
  background-color: var(--primary-color);
  border-radius: 10px;
}

.processing-dialog progress::-moz-progress-bar {
  background-color: var(--primary-color);
  border-radius: 10px;
}

table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  background-color: #fff;
  margin-top: 20px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

th,
td {
  border: 1px solid var(--border-color);
  padding: 15px;
  text-align: left;
}

th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:nth-child(even) {
  background-color: var(--bg-light);
}

tr:hover {
  background-color: rgba(0, 0, 0, 0.04);
  transition: background-color 0.3s ease;
}

.output a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  word-wrap: break-word;
  max-width: 100%;
  display: inline-block;
  transition: color 0.3s ease;
}

.output a:hover,
.output a:focus {
  text-decoration: underline;
  color: #2563eb;
}

/* 
          IMAGES
      */

img {
  max-width: 85%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Utility Classes */
.word-wrap {
  word-break: break-word;
  white-space: normal;
}

.font-bold {
  font-weight: bold;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 0 10px;
  }

  .hero {
    padding: 1rem;
    margin: 5px;
  }

  .sidebar {
    width: 100%;
    margin-right: 0;
    margin-bottom: 20px;
  }

  .main-content {
    width: 100%;
  }

  .preview_area {
    flex-direction: column;
    gap: 15px;
  }

  .preview_area div {
    min-height: 120px;
  }

  .sidebar h2 {
    font-size: 1.3rem;
  }

  .sidebar p,
  .upload-area p,
  .upload-area button,
  #checkplagiarism,
  #output,
  .processing-dialog p,
  footer p {
    font-size: 1rem;
  }

  .upload-area {
    padding: 30px 15px;
  }

  .preview_area div {
    padding: 15px;
  }

  .processing-dialog {
    padding: 25px;
  }

  .processing-dialog .loading-spinner {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    border-width: 8px;
  }

  .processing-dialog progress {
    height: 10px;
  }
}

@media print {
  *,
  .output_container {
    margin: 0%;
    padding: 0%;
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .header,
  .mobile-menu,
  .hero,
  .container,
  .processing-dialog,
  .save-btn,
  footer {
    display: none;
  }

  @page {
    size: A4 portrait; /* or landscape */
    margin: none;
  }
}
