/* ===== CSS Variables ===== */
:root {
  --primary-color: #ffc107;
  --primary-dark: #ffa000;
  --secondary-color: #4a5568;
  --success-color: #10b981;
  --error-color: #ef4444;
  --bg-dark: #1a1a1a;
  --bg-card: #2d2d2d;
  --bg-input: #3a3a3a;
  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --border-color: #404040;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

/* ===== Container ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease;
}

/* ===== Header ===== */
.header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: var(--primary-color);
}

.header h1 ion-icon {
  font-size: 3rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Main Content ===== */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.4s ease;
}

section h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-color);
}

section h3 ion-icon {
  font-size: 1.8rem;
}

/* ===== Drop Zone ===== */
.drop-zone {
  border: 3px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 50px 30px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: var(--bg-input);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary-color);
  background: rgba(255, 193, 7, 0.05);
  transform: scale(1.02);
}

.drop-icon {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.drop-zone h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-primary);
  text-align: center;
  width: 100%;
  display: block;
}

.drop-zone p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.file-info {
  display: block;
  margin-top: 15px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.format-instructions {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 25px;
  text-align: center;
  font-size: 0.9rem;
}

.format-instructions code {
  background: var(--bg-dark);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  color: var(--primary-color);
  font-weight: bold;
}

.format-instructions small {
  color: var(--text-secondary);
  font-size: 0.8rem;
  display: block;
  margin-top: 5px;
}

/* ===== File Card ===== */
.file-card {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 2px solid var(--border-color);
  animation: slideIn 0.3s ease;
}

.file-card-content {
  display: flex;
  align-items: center;
  gap: 15px;
}

.file-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.file-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.file-details strong {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.file-stats {
  display: flex;
  gap: 25px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.stat-item ion-icon {
  font-size: 1.3rem;
  color: var(--primary-color);
}

.stat-item strong {
  color: var(--primary-color);
  font-size: 1.2rem;
}

/* ===== Options Section ===== */
.option-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 20px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.radio-label:hover,
.checkbox-label:hover {
  border-color: var(--primary-color);
  background: rgba(255, 193, 7, 0.05);
}

.radio-label input,
.checkbox-label input {
  margin-top: 3px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.radio-content,
.checkbox-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.radio-content strong,
.checkbox-content strong {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.radio-content small,
.checkbox-content small {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ===== Biome Configuration ===== */
.biome-config {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
}

.biome-config h4 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 15px;
  line-height: 1.6;
}

.hint code {
  background: var(--bg-dark);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--primary-color);
}

.hint strong {
  color: var(--primary-color);
  font-weight: 700;
}

.biome-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  min-height: 40px;
}

.biome-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-color);
  color: var(--bg-dark);
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== Location Selection ===== */
.location-selection-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 15px;
  margin-bottom: 25px;
  color: var(--primary-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.location-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.location-option {
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.location-option:has(input:checked) {
  border-color: var(--primary-color);
  background: rgba(255, 193, 7, 0.05);
}

.location-radio-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.location-radio {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
  flex-shrink: 0;
}

.location-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.location-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 35px;
}

.location-tags .biome-tag {
  font-size: 0.85rem;
  padding: 6px 12px;
}

/* ===== Preview Section ===== */
.preview-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.preview-box {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.preview-box h4 {
  font-size: 1rem;
  margin-bottom: 15px;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-box pre {
  background: var(--bg-dark);
  padding: 15px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
}

/* ===== Buttons ===== */
.btn {
  padding: 14px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
  text-align: center;
  justify-content: center;
}

.btn ion-icon {
  font-size: 1.3rem;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--bg-dark);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #5a6a7a;
  transform: translateY(-2px);
}

.btn-small {
  padding: 10px 18px;
  font-size: 0.9rem;
}

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

.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--error-color);
  color: var(--text-primary);
}

.btn-icon ion-icon {
  font-size: 1.5rem;
}

/* ===== Action Section ===== */
.action-section {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== Error Display ===== */
.error-display {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid var(--error-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  gap: 15px;
  animation: shake 0.3s ease;
}

.error-display ion-icon {
  font-size: 2rem;
  color: var(--error-color);
  flex-shrink: 0;
}

.error-content strong {
  display: block;
  margin-bottom: 5px;
  color: var(--error-color);
}

.error-content p {
  color: var(--text-secondary);
  margin: 0;
}

/* ===== Loading Spinner ===== */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 26, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 1000;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-overlay p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--success-color);
  color: white;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  animation: slideInRight 0.3s ease;
  z-index: 1001;
}

.toast ion-icon {
  font-size: 1.8rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.footer p {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer p a {
  color: inherit;
  text-decoration: none;
}

.footer p a:hover {
  color: var(--text-primary);
}

.footer-link {
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .header h1 {
    font-size: 1.8rem;
  }

  .header h1 ion-icon {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  section {
    padding: 20px;
  }

  .drop-zone {
    padding: 30px 20px;
  }

  .file-stats {
    flex-direction: column;
    gap: 15px;
  }

  .preview-content {
    grid-template-columns: 1fr;
  }

  .action-section {
    flex-direction: column;
  }

  .action-section .btn {
    width: 100%;
    justify-content: center;
  }

  .toast {
    bottom: 20px;
    right: 20px;
    left: 20px;
  }
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-input);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.modal-content h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.4rem;
}

.modal-content p {
  color: var(--text-primary);
  margin-bottom: 25px;
  line-height: 1.6;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-buttons .btn {
  min-width: 180px;
}

.nucleotide-btn {
  min-width: 60px !important;
  padding: 12px 20px !important;
  font-size: 1.2rem !important;
  font-weight: bold !important;
}
