body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: #f3f4f6;
  color: #333;
  padding: 20px;
  transition: background 0.3s ease, color 0.3s ease;
}

.converter-container {
  max-width: 700px;
  margin: auto;
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  text-align: center;
  position: relative;
}

h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

p {
  font-size: 15px;
  color: #555;
  margin-bottom: 25px;
}

.upload-area {
  border: 2px dashed #bbb;
  padding: 30px;
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

.upload-area:hover {
  transform: scale(1.02);
  background: #eef6ff;
  border-color: #007bff;
}

.upload-area label {
  color: #007bff;
  font-weight: bold;
  cursor: pointer;
}

input[type=file] {
  display: none;
}

.options {
  margin-bottom: 20px;
}

select, button {
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-left: 10px;
}

button {
  background: #007bff;
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: #0056b3;
}

.preview img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 10px;
  border: 4px solid #007bff30;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

#downloadBtn {
  display: inline-block;
  margin-top: 12px;
  background: #28a745;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 8px;
}

#downloadBtn:hover {
  background: #218838;
}

.hidden {
  display: none;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid #eee;
  border-top: 5px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

/* Success Check Animation */
.success-check {
  font-size: 18px;
  color: #28a745;
  font-weight: bold;
  animation: fadeIn 0.8s ease-in-out;
  margin: 10px 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark Mode Toggle */
.switch {
  position: absolute;
  top: 20px;
  right: 20px;
}

.switch input { display: none; }

.slider {
  width: 50px;
  height: 24px;
  background: #ccc;
  border-radius: 30px;
  display: block;
  position: relative;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .slider {
  background: #007bff;
}

input:checked + .slider::before {
  transform: translateX(26px);
}

/* Dark mode */
body.dark {
  background: #121212;
  color: #eee;
}

body.dark .converter-container {
  background: #1e1e1e;
  color: #fff;
}

body.dark .upload-area {
  background: #2a2a2a;
  border-color: #555;
}

body.dark .preview img {
  border-color: #007bff50;
}
