:root {
  --primary-color: #ed1c24;
  --text-dark: #222;
  --text-light: #555;
  --bg-light: #f8f9fa;
  --white: #fff;
  --gray-border: #ddd;
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-border);
}

.logo {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--primary-color);
}

.nav-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

/* Hero Section */
.tool-hero {
  text-align: center;
  padding: 4rem 1rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.tool-hero h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.tool-hero p {
  font-size: 1.1rem;
  color: var(--text-light);
}

/* Homepage Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.tool-card {
  background-color: white;
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--gray-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.tool-card a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.tool-card h3 {
  margin: 0 0 0.5rem;
  color: var(--primary-color);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-card p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: var(--primary-color);
}

/* Merge Page Layout */
.merge-wrapper {
  max-width: 700px;
  margin: 2rem auto;
  padding: 1rem;
}

.upload-box {
  border: 2px dashed var(--gray-border);
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  text-align: center;
}

.upload-box.dragging {
  border-color: var(--primary-color);
  background-color: #fff8f8;
}

.upload-label {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

#pdf-upload {
  display: none;
}

.upload-subtext {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* File List */
.file-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.file-list li {
  background-color: white;
  border: 1px solid var(--gray-border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: move;
}

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

.file-info {
  font-size: 0.85rem;
  color: var(--text-light);
}

.file-thumb {
  width: 50px;
  height: auto;
  object-fit: contain;
}

.file-list li.dragging {
  opacity: 0.5;
}

.file-list li.over {
  border: 2px dashed var(--primary-color);
}

/* Buttons */
.action-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.merge-button,
.clear-button,
.download-link {
  padding: 0.75rem 1.5rem;
  font-weight: bold;
  border-radius: 6px;
  border: none;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: opacity 0.2s ease;
}

.merge-button {
  background-color: var(--primary-color);
  color: white;
  opacity: 0.6;
  cursor: not-allowed;
}

.merge-button.enabled {
  opacity: 1;
  cursor: pointer;
}

.clear-button {
  background-color: #666;
  color: white;
  opacity: 1;
  cursor: pointer;
}

.clear-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-link {
  background-color: var(--primary-color);
  color: white;
  font-weight: bold;
}

.download-link:hover {
  background-color: #c5131a;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  background-color: #eee;
  border-radius: 4px;
  margin: 1rem 0;
  height: 16px;
  position: relative;
  overflow: hidden;
}

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

.progress-label {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 600px) {
  .tool-hero h1 {
    font-size: 1.75rem;
  }

  .tool-card h3 {
    font-size: 1.15rem;
  }

  .tool-card p {
    font-size: 0.9rem;
  }

  .icon {
    width: 18px;
    height: 18px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .merge-button,
  .clear-button,
  .download-link {
    width: 100%;
  }
}
