/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f9fafb;
  color: #111827;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Navbar */
.navbar {
  background-color: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.logo-img {
  height: 2rem;
  width: 2rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, #2563eb, #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: none;
  gap: 1rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  transition: background-color 0.2s;
}

.nav-link:hover {
  background-color: #f3f4f6;
}

.nav-link.active {
  background-color: #dbeafe;
  color: #1d4ed8;
}

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
}

.nav-link-dropdown {
  position: relative;
}

.nav-link-dropdown::after {
  content: '▼';
  font-size: 0.625rem;
  margin-left: 0.25rem;
  display: inline-block;
  transition: transform 0.2s;
}

.nav-dropdown:hover .nav-link-dropdown::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 1000;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #374151;
  font-size: 0.875rem;
  transition: background-color 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background-color: #f3f4f6;
  color: #1d4ed8;
}

.dropdown-icon {
  font-size: 1.125rem;
  width: 1.5rem;
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
}

.page {
  min-height: calc(100vh - 4rem - 12rem);
}

.page.hidden {
  display: none;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(to bottom right, #2563eb, #9333ea, #ec4899);
  color: white;
  padding: 5rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.75rem;
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: #bfdbfe;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.5rem;
  }
}

.hero-description {
  font-size: 1.125rem;
  margin-bottom: 3rem;
  color: #93c5fd;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
  }
}

/* Buttons */
.btn-primary {
  background: linear-gradient(to right, #2563eb, #9333ea);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary-white {
  background-color: white;
  color: #9333ea;
  font-weight: 600;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}

.btn-secondary-white:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.btn-cta-secondary {
  background-color: #7c3aed;
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  border: 2px solid white;
}

.btn-cta-secondary:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

/* Features Section */
.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 4rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 4rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background-color: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  border: 1px solid #f3f4f6;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.feature-card {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: all 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-description {
  color: #4b5563;
}

/* Privacy Section */
.privacy-section {
  background-color: #f3f4f6;
  padding: 4rem 0;
}

.privacy-box {
  background-color: #f0fdf4;
  border-left: 4px solid #22c55e;
  padding: 1.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.privacy-icon {
  font-size: 1.875rem;
  color: #22c55e;
}

.privacy-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #14532d;
  margin-bottom: 0.5rem;
}

.privacy-text {
  color: #166534;
  font-size: 1.125rem;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(to right, #2563eb, #9333ea);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.cta-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.cta-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: #bfdbfe;
}

.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

@media (min-width: 640px) {
  .cta-buttons {
    flex-direction: row;
  }
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 3rem;
}

.page-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
}

.page-description {
  font-size: 1.125rem;
  color: #4b5563;
  max-width: 42rem;
  margin: 0 auto;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tool-card {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.tool-card:hover {
  transform: scale(1.05);
}

.tool-icon-wrapper {
  width: 4rem;
  height: 4rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.875rem;
  margin-bottom: 1rem;
  transition: transform 0.2s;
}

.tool-card:hover .tool-icon-wrapper {
  transform: scale(1.1);
}

.tool-icon-blue {
  background: linear-gradient(to bottom right, #3b82f6, #2563eb);
}

.tool-icon-green {
  background: linear-gradient(to bottom right, #22c55e, #16a34a);
}

.tool-icon-purple {
  background: linear-gradient(to bottom right, #a855f7, #9333ea);
}

.tool-icon-orange {
  background: linear-gradient(to bottom right, #f97316, #ea580c);
}

.tool-icon-pink {
  background: linear-gradient(to bottom right, #ec4899, #db2777);
}

.tool-icon-indigo {
  background: linear-gradient(to bottom right, #6366f1, #4f46e5);
}

.tool-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #111827;
}

.tool-description {
  color: #4b5563;
  margin-bottom: 1rem;
}

.tool-link {
  color: #2563eb;
  font-weight: 500;
}

.tool-card:hover .tool-link {
  text-decoration: underline;
}

/* Info Box */
.info-box {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 3rem;
}

.info-box p {
  color: #1e40af;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background-color: white;
}

.dropzone:hover {
  border-color: #60a5fa;
  background-color: #f9fafb;
}

.dropzone.dragging {
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.dropzone-icon {
  width: 3rem;
  height: 3rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.dropzone-text {
  font-size: 0.875rem;
  color: #4b5563;
}

.dropzone-text strong {
  color: #2563eb;
  font-weight: 600;
}

.dropzone-text strong:hover {
  color: #1d4ed8;
}

.dropzone-format {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.dropzone input[type="file"] {
  display: none;
}

/* Merge PDF Two Dropzones */
.merge-dropzones-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .merge-dropzones-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.merge-dropzone-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dropzone-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.merge-dropzone-single {
  min-height: 150px;
}

.merge-file-info {
  padding: 0.75rem;
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.merge-file-info span {
  font-weight: 500;
}

/* Files List */
.files-list {
  margin-top: 1rem;
}

.files-list-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.files-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.files-list li {
  font-size: 0.875rem;
  color: #4b5563;
  display: flex;
  align-items: center;
}

.files-list li span {
  margin-right: 0.5rem;
}

/* Error and Success Messages */
.error-message {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  color: #dc2626;
}

.success-message {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 0.5rem;
  color: #16a34a;
}

.hidden {
  display: none;
}

/* Action Buttons */
.action-buttons {
  margin-top: 1.5rem;
}

.action-buttons .btn-primary {
  width: 100%;
}

@media (min-width: 640px) {
  .action-buttons .btn-primary {
    width: auto;
  }
}

/* Split Layout */
.split-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .split-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.split-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.split-controls-content {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.input-group input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.input-group input:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-color: #3b82f6;
}

/* Angle Buttons */
.angle-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.angle-btn {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 2px solid #d1d5db;
  font-weight: 600;
  color: #374151;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.angle-btn:hover {
  border-color: #9ca3af;
}

.angle-btn.active {
  border-color: #2563eb;
  background-color: #eff6ff;
  color: #1d4ed8;
}

/* Preview */
.split-preview {
  display: flex;
  flex-direction: column;
}

.preview-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.preview-content {
  min-height: 400px;
}

.preview-placeholder {
  text-align: center;
  color: #6b7280;
  padding: 3rem 0;
}

/* PDF Preview */
.pdf-preview-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pdf-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.pdf-nav button {
  padding: 0.5rem 1rem;
  background-color: white;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pdf-nav button:hover:not(:disabled) {
  background-color: #f9fafb;
}

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

.pdf-page-info {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.pdf-canvas-container {
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  padding: 1rem;
  overflow: auto;
  max-height: 600px;
  display: flex;
  justify-content: center;
}

.pdf-canvas-container canvas {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  display: block;
}

/* Image Preview */
.image-preview-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-preview-item {
  background-color: #f3f4f6;
  border-radius: 0.5rem;
  padding: 1rem;
}

.image-preview-item img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.image-preview-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Loader */
.loader {
  display: inline-block;
  border: 4px solid #dbeafe;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.loader-md {
  width: 2rem;
  height: 2rem;
}

.loader-lg {
  width: 3rem;
  height: 3rem;
}

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

/* Footer */
.footer {
  background-color: #1f2937;
  color: white;
  margin-top: auto;
  padding: 2rem 0;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-content p {
  font-size: 0.875rem;
  color: #9ca3af;
}

.footer-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-content ul li a {
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-content ul li a:hover {
  color: white;
}

.privacy-footer-box {
  background-color: rgba(22, 163, 74, 0.3);
  border: 1px solid #16a34a;
  border-radius: 0.5rem;
  padding: 1rem;
}

.privacy-footer-box p {
  font-size: 0.875rem;
  color: #86efac;
}

.privacy-footer-box strong {
  color: #bbf7d0;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #9ca3af;
}

/* Rotate and Compress Controls */
.rotate-controls-content,
.compress-controls-content,
.pdf-to-image-controls-content {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rotate-controls-content label,
.compress-controls-content label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

/* Page Selection Styles */
.page-selection-container {
  margin-top: 1rem;
}

.page-selection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-selection-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.page-selection-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-select-pages {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2563eb;
  background-color: white;
  border: 1px solid #2563eb;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select-pages:hover {
  background-color: #eff6ff;
  border-color: #1d4ed8;
}

.pages-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.page-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background-color: white;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: all 0.2s;
}

.page-checkbox-item:hover {
  border-color: #2563eb;
  background-color: #eff6ff;
}

.page-checkbox-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: #2563eb;
}

.page-checkbox-item label {
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  flex: 1;
  margin: 0;
}

.selected-count {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2563eb;
  text-align: center;
}

