/* General Styles & Light Mode */
body {
  font-family: 'Sarabun', sans-serif;
  background-color: #f0f2f5;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

/* Header Animation */
header {
  animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  border-radius: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  font-weight: 600;
}

#drop-zone {
  cursor: pointer;
  transition: all 0.3s ease, transform 0.2s ease;
  border-style: dashed !important;
  background-color: #f8f9fa;
  position: relative;
  overflow: hidden;
}

#drop-zone::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

#drop-zone:hover::before {
  left: 100%;
}

#drop-zone.dragover {
  background-color: #e9ecef;
  border-color: #0d6efd !important;
  transform: scale(1.02);
}

.btn {
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
  z-index: -1;
}

.btn:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

.list-group-item {
  background-color: #fff;
  border: 1px solid #dee2e6;
  margin-bottom: -1px;
  transition: all 0.3s ease;
}

.list-group-item:hover {
  background-color: #f8f9fa;
  transform: translateX(5px);
}

#result-area a {
  margin: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
}

#result-area a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Pulse animation for action buttons */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.btn-primary {
  animation: pulse 2s infinite;
}

.btn-primary:hover {
  animation: none;
}

/* File list drag and drop styles */
#file-list li {
  cursor: grab;
  transition: all 0.2s ease-in-out;
  position: relative;
  padding: 0.75rem 1.25rem;
}

#file-list li.dragging {
  opacity: 0.5;
  background-color: #f8d7da;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#file-list li.drag-over-top::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #007bff, #00b4ff);
  z-index: 1;
  border-radius: 2px;
}

#file-list li.drag-over-bottom::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #007bff, #00b4ff);
  z-index: 1;
  border-radius: 2px;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Floating action button */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 1000;
}

.fab:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Tooltip styles */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 5px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card {
    border-radius: 0.75rem;
  }
  
  .btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
  }
  
  #drop-zone {
    padding: 2rem;
  }
}

/* dark pdf*/
#pdf-type-select {
  margin-bottom: 1rem;
}

/* ปรับแต่ง Dropdown */
.dropdown-menu {
  transform: translateX(-50%) !important;
  left: 50% !important;
}

#confirm-convert-btn {
  margin-top: 10px;
}

/* ปรับขนาดตัวเลือก */
#pdf-type-select {
  width: 100%;
}

/* Style for removing item */
#file-list li.removing-item,
#result-area .d-flex.align-items-center.mb-2.removing-item {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}