/* === Modern Frontend Form Styling === */
.ilovepdf-form {
  max-width: 520px;
  margin: 30px auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 25px 20px;
  box-shadow: 0 6px 20px #3257a7;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.ilovepdf-form:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(105, 167, 218, 0.856);
}

.ilovepdf-form h3 {
  margin-bottom: 18px;
  font-weight: 600;
  color: #222;
  font-size: 1.35em;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Hide file input label completely */
.ilovepdf-form label[for^="ilovepdf_file"] {
  display: none;
}

/* Hide original file input */
.ilovepdf-form input[type="file"] {
  display: none;
}

/* Submit Button */
.ilovepdf-form button[type="submit"],
.ilovepdf-form input[type="submit"] {
  background: linear-gradient(90deg, #473fb1, #2a1ed6);
  color: #fff;
  font-weight: 600;
  padding: 12px 0;
  width: 100%;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.ilovepdf-form button[type="submit"]:hover,
.ilovepdf-form input[type="submit"]:hover {
  background: linear-gradient(90deg, #5a4fd8, #3b2ae2);
  transform: scale(1.02);
}

/* === Optimized Drop Zone (Tight Spacing) === */
.file-drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 20px 15px;
  text-align: center;
  margin: 10px 0;
  background: #fafbfc;
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-drop-zone:hover {
  border-color: #473fb1;
  background: #f0f4ff;
}

.select-files-btn {
  background: linear-gradient(90deg, #473fb1, #2a1ed6);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.select-files-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(71, 63, 177, 0.3);
}

.or-divider {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin: 8px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.file-drop-zone p {
  margin: 5px 0;
  color: #666;
  font-size: 14px;
}

/* === Files Selected State === */
.files-selected {
  background: #d4edda;
  border: 2px solid #28a745;
  border-radius: 6px;
  padding: 12px;
  text-align: left;
}

.file-count {
  display: block;
  font-weight: 600;
  color: #155724;
  margin-bottom: 5px;
  font-size: 15px;
}

.file-names {
  font-size: 13px;
  color: #155724;
  margin-bottom: 8px;
  word-break: break-word;
  max-height: 40px;
  overflow: hidden;
  line-height: 1.4;
}

.clear-files-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  float: right;
  transition: background 0.2s ease;
}

.clear-files-btn:hover {
  background: #c82333;
}

/* === Form-wide Drag Highlight === */
.ilovepdf-form.drag-over {
  border: 3px solid #473fb1;
  box-shadow: 0 0 15px rgba(71, 63, 177, 0.2);
  background: linear-gradient(145deg, rgba(233, 246, 255, 0.5), #f8f9fa);
}

/* === Success & Error Messages === */
.ilovepdf-form .ilovepdf-message {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 500;
  display: none;
}

.ilovepdf-form .ilovepdf-message.error {
  background: #fdecea;
  color: #b02a37;
  border: 1px solid #f5c2c7;
}

.ilovepdf-form .ilovepdf-message.success {
  background: #eafaf1;
  color: #0f5132;
  border: 1px solid #badbcc;
}

.ilovepdf-form .ilovepdf-message.success a {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 600;
}

.ilovepdf-form .ilovepdf-message.success a:hover {
  text-decoration: underline;
}

/* Split PDF Page Range Input */
.split-ranges-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  margin: 8px 0 5px 0;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.split-ranges-input:focus {
  outline: none;
  border-color: #473fb1;
  box-shadow: 0 0 0 3px rgba(71, 63, 177, 0.1);
}

.ilovepdf-form small {
  display: block;
  color: #666;
  font-size: 12px;
  margin-top: 5px;
  font-style: italic;
}

/* OCR Language Select Styling */
.ocr-lang-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  margin: 8px 0 15px 0;
  transition: border-color 0.3s ease;
}

.ocr-lang-select:focus {
  outline: none;
  border-color: #473fb1;
  box-shadow: 0 0 0 3px rgba(71, 63, 177, 0.1);
}

/* === Responsive Design === */
@media (max-width: 600px) {
  .ilovepdf-form {
    padding: 20px 15px;
    margin: 20px 10px;
  }
  
  .file-drop-zone {
    padding: 15px 10px;
  }
  
  .select-files-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
}