* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #1a3a52 0%, #2d5a7b 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
  color: white;
  padding: 25px 30px;
  text-align: center;
}

.header h1 {
  font-size: 2em;
  margin-bottom: 5px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.95em;
  opacity: 0.95;
  font-weight: 300;
}

.main-content {
  padding: 30px 30px;
}

.section-header {
  margin-bottom: 15px;
}

.section-header h2 {
  font-size: 1.3em;
  color: #333;
  margin-bottom: 5px;
  font-weight: 600;
}

.help-text {
  font-size: 0.9em;
  color: #666;
  font-weight: 400;
}

.input-section {
  margin-bottom: 25px;
}

textarea {
  width: 100%;
  height: 80px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  resize: vertical;
  transition: all 0.3s ease;
  background: #fafafa;
}

textarea:focus {
  outline: none;
  border-color: #0066cc;
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.ranges-section {
  margin-bottom: 25px;
}

.ranges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.range-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
  font-size: 0.9em;
}

.range-item:hover {
  background: #fafafa;
  border-color: #0066cc;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.range-item.fixed {
  background: #e6f2ff;
  border-color: #0066cc;
}

.base-label {
  font-weight: 700;
  font-size: 0.95em;
  min-width: 28px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
}

/* Color each base label according to visualization colors */
.range-item.fixed .base-label {
  background-color: #9e9e9e;
}

.range-item:nth-child(2) .base-label {
  background-color: #4caf50;
}

.range-item:nth-child(3) .base-label {
  background-color: #2196f3;
}

.range-item:nth-child(4) .base-label {
  background-color: #ff9800;
}

.range-item:nth-child(5) .base-label {
  background-color: #e91e63;
}

.range-value {
  color: #666;
  font-size: 0.85em;
}

.range-item input {
  width: 65px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.3s ease;
}

.range-item input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.button-container {
  display: flex;
  justify-content: center;
  margin-bottom: 25px;
}

.btn-generate {
  padding: 12px 35px;
  font-size: 0.95em;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 102, 204, 0.4);
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.6);
}

.btn-generate:active {
  transform: translateY(0);
}

.output-section {
  margin-top: 20px;
}

pre {
  margin-top: 12px;
  padding: 12px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  overflow-x: auto;
  line-height: 1.4;
}

table {
  border-collapse: collapse;
  margin-top: 15px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

td {
  width: 24px;
  height: 24px;
  border: 1px solid #ddd;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  transition: all 0.2s ease;
}

td:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Base colors */
.base-A { background-color: #4caf50; color: #fff; }
.base-C { background-color: #2196f3; color: #fff; }
.base-G { background-color: #ff9800; color: #000; }
.base-T { background-color: #e91e63; color: #fff; }
.base-N { background-color: #9e9e9e; color: #000; }

/* Improved visualization styles */
.improved-viz {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #f0f4f8 0%, #e0e8f0 100%);
  border: 2px solid #0066cc;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 102, 204, 0.15);
}

.improved-viz h3 {
  color: #0066cc;
  margin-bottom: 10px;
  font-size: 1.1em;
  font-weight: 600;
}

.viz-header {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 13px;
  color: #333;
  padding: 8px;
  background: white;
  border-radius: 6px;
  border-left: 4px solid #0066cc;
}

.viz-row {
  display: flex;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  line-height: 1.3;
  margin-bottom: 1px;
  padding: 4px 8px;
  background: white;
  border-radius: 4px;
}

.base-row {
  margin-bottom: 0;
}

.quality-row {
  margin-top: 0;
  margin-bottom: 0;
}

.quality-box-row {
  margin-top: 0;
}

/* Colored bases as text (no boxes) */
.colored-base {
  width: 1ch;
  text-align: center;
  font-weight: bold;
  padding: 0;
  margin: 0;
  color: white;
  display: inline-block;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.colored-base.base-A { background-color: #4caf50; }
.colored-base.base-C { background-color: #2196f3; }
.colored-base.base-G { background-color: #ff9800; }
.colored-base.base-T { background-color: #e91e63; }
.colored-base.base-N { background-color: #9e9e9e; }

/* Quality characters as plain text with hover */
.quality-char-text {
  width: 1ch;
  text-align: center;
  font-weight: normal;
  padding: 0;
  margin: 0;
  cursor: help;
  color: #333;
  position: relative;
}

/* Quality boxes (reusing Mohammed's liked colored boxes) */
.quality-box {
  width: 1ch;
  height: 1.2em;
  display: inline-block;
  text-align: center;
  margin: 0;
  cursor: help;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 3px;
  transition: all 0.2s ease;
  color: white;
  font-weight: bold;
  position: relative;
}

.quality-box:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.quality-green { background-color: #4caf50; color: white; }
.quality-orange { background-color: #ff9800; color: white; }
.quality-red { background-color: #f44336; color: white; }

/* Hover tooltip for both quality text and boxes */
.quality-char-text:hover::after,
.quality-box:hover::after {
  content: attr(data-accuracy) '%';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 5px;
  font-weight: 600;
}

.quality-char-text:hover::before,
.quality-box:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #333;
  z-index: 1000;
}

.footer {
  background: #f5f5f5;
  padding: 12px;
  text-align: center;
  color: #999;
  font-size: 0.85em;
  border-top: 1px solid #e0e0e0;
}