/* Simplified CSS for PDF Tools Online */

/* CSS Variables for consistent color scheme */
:root {
  --primary-color: #ff0000; /* Red */
  --primary-dark: #cc0000; /* Darker red */
  --primary-light: #ffebee; /* Light red */
  --secondary-color: #ff5252; /* Secondary red */
  --accent-color: #ff9800; /* Accent color */
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --dark-color: #2b2d42;
  --light-color: #f8f9fa;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ddd;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  --transition: all 0.3s ease;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--light-color);
  padding-top: 0;
  margin: 0;
  min-height: 100vh;
  display: flex !important;
  flex-direction: column;
}

/* For tool pages with fixed footer */
body.tool-page {
  display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--gray-900);
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

h1.display-4 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

p.lead {
  font-size: 1.25rem;
  color: var(--gray-600);
}

/* Navbar styles */
.navbar {
  background-color: white !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 1rem 0;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.navbar-brand {
  color: var(--primary-color) !important;
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.navbar-brand:hover {
  color: var(--primary-dark) !important;
}

.navbar-brand img {
  max-height: 50px;
  width: auto;
  transition: var(--transition);
}

.navbar-brand img:hover {
  opacity: 0.8;
}

.navbar-nav .nav-link {
  color: var(--gray-700) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  transition: var(--transition);
  border-radius: var(--border-radius);
}

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

.dropdown-menu {
  border: none;
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

/* Desktop: Enable hover effect for dropdown menus */
@media (min-width: 992px) {
  .navbar .dropdown:hover .dropdown-menu,
  .navbar .dropdown-submenu:hover .dropdown-menu {
    display: block;
  }

  .navbar .dropdown .dropdown-menu {
    margin-top: 0;
  }
}

/* Mobile: Show dropdown menu by default when navbar collapse is visible on mobile devices */
@media (max-width: 991px) {
  /* Make dropdown menu visible by default when navbar is shown */
  .navbar-collapse.show .dropdown .dropdown-menu {
    display: block !important;
    position: static !important;
    float: none !important;
    width: 100% !important;
    margin-top: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
  }

  /* Hide the dropdown toggle arrow since it's always open */
  .navbar-collapse.show .dropdown-toggle::after {
    display: none !important;
  }
}

/* Main content container */
main.container {
  flex: 1;
  margin-bottom: 2rem;
}

/* Footer styles - dark on main page */
footer {
  background-color: #222 !important;
  color: white;
  padding: 2rem 0;
  margin-top: auto;
}

footer .container {
  color: white;
}

footer a {
  color: #ccc;
}

footer a:hover {
  color: #ff0000;
}

/* Card styles for tool grid */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  height: 100%;
  background-color: white;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--box-shadow-hover);
  transform: translateY(-5px);
}

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  color: var(--dark-color);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card-text {
  color: var(--gray-600);
  margin-bottom: auto;
  flex-grow: 1;
}

/* Button styles */
.btn {
  border-radius: var(--border-radius);
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  border: none;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
}

/* Rounded buttons (for file upload buttons) - REMOVED to make all buttons square */
/* .btn.rounded-pill {
  border-radius: 50px;
} */

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Standardized button variants */
.btn-adobe-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

.btn-adobe-primary:hover, .btn-adobe-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.btn-adobe-secondary {
  background-color: var(--dark-color);
  border-color: var(--dark-color);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-adobe-secondary:hover, .btn-adobe-secondary:focus {
  background-color: #1a1b2c;
  border-color: #1a1b2c;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Download buttons - BLACK */
.btn-adobe-accent {
  background-color: var(--dark-color);
  border-color: var(--dark-color);
  color: white;
  box-shadow: 0 2px 8px rgba(43, 45, 66, 0.2);
}

.btn-adobe-accent:hover, .btn-adobe-accent:focus {
  background-color: #1a1b2c;
  border-color: #1a1b2c;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(43, 45, 66, 0.3);
}

.btn-light {
  background-color: var(--light-color);
  border-color: var(--gray-300);
  color: var(--gray-700);
}

.btn-light:hover, .btn-light:focus {
  background-color: var(--gray-200);
  border-color: var(--gray-400);
  color: var(--gray-700);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover, .btn-outline:focus {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.2);
}

/* File upload buttons - RED */
.btn-file-upload {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

.btn-file-upload:hover, .btn-file-upload:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

/* Download buttons - BLACK */
.btn-download {
  background-color: var(--dark-color);
  border-color: var(--dark-color);
  color: white;
  box-shadow: 0 2px 8px rgba(43, 45, 66, 0.2);
}

.btn-download:hover, .btn-download:focus {
  background-color: #1a1b2c;
  border-color: #1a1b2c;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(43, 45, 66, 0.3);
}

/* Success/Done buttons */
.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.btn-success:hover, .btn-success:focus {
  background-color: #3d8b40;
  border-color: #3d8b40;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Warning buttons */
.btn-warning {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
  color: white;
}

.btn-warning:hover, .btn-warning:focus {
  background-color: #e68a00;
  border-color: #e68a00;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Info buttons */
.btn-info {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.btn-info:hover, .btn-info:focus {
  background-color: #e68a00;
  border-color: #e68a00;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Danger buttons */
.btn-danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
}

.btn-danger:hover, .btn-danger:focus {
  background-color: #d32f2f;
  border-color: #d32f2f;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* File upload area */
.file-drop-area {
  border: 4px dotted var(--primary-color) !important;
  border-radius: var(--border-radius);
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.file-drop-area:hover, .file-drop-area.dragover {
  border-color: var(--primary-dark);
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.upload-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
}

.upload-button:hover, .upload-button:focus {
  background: var(--primary-dark);
}

.upload-icon {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: 1rem;
}

.upload-subtext {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.file-input {
  display: none;
}

/* Thumbnail styles */
.pdf-thumbnails-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  min-height: 150px;
  padding: 1rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.thumbnail-item {
  position: relative;
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
  max-width: 150px;
  width: 100%;
  border: 1px solid var(--gray-300);
}

.thumbnail-item:hover {
  transform: scale(1.05);
  box-shadow: var(--box-shadow-hover);
}

.thumbnail-item img {
  max-width: 100%;
  height: auto;
  display: block;
  width: 100%;
  object-fit: contain;
}

.thumbnail-item .actions {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 5px;
  z-index: 10;
}

.thumbnail-item .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
}

.thumbnail-drag-handle {
  cursor: move;
  position: absolute;
  left: 5px;
  bottom: 5px;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Status messages */
.status-message {
  margin: 1.5rem 0;
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid transparent;
}

.status-success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}

.status-error {
  background-color: #ffebee;
  color: #c62828;
  border-color: #ffcdd2;
}

.status-info {
  background-color: #e1f5fe;
  color: #0277bd;
  border-color: #b3e5fc;
}

/* Result section */
.result-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* Card link styles for clickable tool cards */
.card-link {
  text-decoration: none !important;
  color: inherit !important;
  transition: var(--transition);
  display: block;
}

.card-link:hover, .card-link:active, .card-link:focus {
  text-decoration: none !important;
  color: inherit !important;
  outline: none !important;
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.card-link * {
  text-decoration: none !important;
  color: inherit !important;
}

.card-link *:hover, .card-link *:active, .card-link *:focus {
  text-decoration: none !important;
  color: inherit !important;
  outline: none !important;
}

/* Footer styles */
.main-page-footer {
  color: #e9ecef; /* Light gray-white, more gray than pure white */
}

.main-page-footer h5 {
  color: #e9ecef; /* Light gray-white */
  font-weight: 600;
}

.main-page-footer a {
  color: #adb5bd; /* More gray than before */
}

.main-page-footer a:hover {
  color: var(--primary-color);
}

.tool-page-footer {
  background-color: white !important;
  color: var(--dark-color);
  padding: 1.5rem 0;
  border-top: 1px solid var(--gray-200);
  width: 100%;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  margin: 0;
  border: none;
  margin-top: auto;
}

/* Ensure copyright text is visible in tool page footer */
.tool-page-footer p {
  color: var(--gray-600);
  font-size: 0.9rem;
}

/* Custom icon colors for main page tool cards */
.card-icon-remove {
  color: #e74c3c !important; /* Red */
}

.card-icon-jpg {
  color: #3498db !important; /* Blue */
}

.card-icon-pdf {
  color: #2ecc71 !important; /* Green */
}

.card-icon-merge {
  color: #f39c12 !important; /* Orange */
}

.card-icon-word {
  color: #3498db !important; /* Blue */
}

body:not(.tool-page) footer {
  position: relative;
  margin-top: auto;
}

/* Drag handle */
.drag-handle {
  cursor: move;
  padding: 0 5px;
}

/* Utility classes */
.text-primary {
  color: var(--primary-color) !important;
}

.bg-primary {
  background-color: var(--primary-color) !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

/* Responsive design */
@media (max-width: 992px) {
  .navbar-brand {
    font-size: 1.3rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem !important;
  }

  h1.display-4 {
    font-size: 2.2rem;
  }

  .card {
    margin-bottom: 1.25rem;
  }

  .file-drop-area {
    padding: 2.5rem 1rem;
  }
}

@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.25rem;
  }

  .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem !important;
  }

  h1.display-4 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  p.lead {
    font-size: 1.1rem;
  }

  .card {
    margin-bottom: 1rem;
  }

  .file-drop-area {
    padding: 2rem 1rem;
  }

  .thumbnail-item {
    flex: 1 1 calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
  }

  .tool-page main.container {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.1rem;
  }

  .navbar-brand i {
    font-size: 1.2rem;
  }

  h1.display-4 {
    font-size: 1.75rem;
  }

  p.lead {
    font-size: 1rem;
  }

  .file-drop-area {
    padding: 1.5rem 1rem;
  }

  .thumbnail-item {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .card {
    margin-bottom: 0.75rem;
  }

  .card-body {
    padding: 1.25rem;
  }

  .upload-icon {
    font-size: 3rem;
  }

  .pdf-thumbnails-container {
    padding: 0.75rem;
  }

  footer {
    padding: 2rem 0 1rem;
  }

  .tool-page main.container {
    padding: 1rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
  }
}

@media (max-width: 576px) {
  .navbar-toggler {
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 0.25rem 0.5rem;
  }

  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2813, 110, 253, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }

  .navbar-collapse {
    background-color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 1rem 0;
    margin-top: 0.5rem;
  }


  .navbar-nav .nav-link {
    padding: 0.75rem 1.5rem !important;
    margin: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
  }

  .dropdown-menu {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: none;
    padding: 0.5rem 0;
  }

  .dropdown-item {
    padding: 0.5rem 2rem !important;
  }
}

@media (max-width: 420px) {
  h1.display-4 {
    font-size: 1.5rem;
  }

  .card-body .fa-3x {
    font-size: 2.5rem;
  }

  .btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }
}

/* Enhanced progress bar styling */
.progress {
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--gray-300);
  height: 12px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  border-radius: 10px;
  transition: width 0.3s ease;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.progress-bar-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
}

.progress-bar-animated {
  animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
  0% {
    background-position: 1rem 0;
  }
  100% {
    background-position: 0 0;
  }
}