* {
  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, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1600px;
  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, #000000 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  text-align: center;
}

header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  font-weight: 700;
}

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

.main-content {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 600px;
}

.diagram-panel {
  flex: 0 0 70%;
  background: #f8f9fa;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  border-right: 2px solid #e9ecef;
  flex-direction: column;
  gap: 16px;
}

#venn-diagram {
  width: 100%;
  height: 100%;
  min-height: 500px;
}

.diagram-tools {
  width: 100%;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.diagram-tools button {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  transition: background 0.2s;
}

.diagram-tools button:hover {
  background: #5a67d8;
}

.page-footer {
  padding: 16px 24px 22px;
  border-top: 1px solid #e9ecef;
  background: #ffffff;
  font-size: 0.95em;
  color: #2d3748;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-footer a {
  color: #2b6cb0;
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

.control-panel {
  flex: 0 0 30%;
  background: white;
  padding: 25px;
  overflow-y: auto;
  border-left: 1px solid #e9ecef;
}

.panel-section {
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e9ecef;
}

.panel-section:last-child {
  border-bottom: none;
}

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

.dataset-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dataset-color-note {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 8px;
}

.dataset-color-picker {
  width: 28px;
  height: 28px;
  border: none;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 10px;
}

.dataset-toggle-row {
  display: flex;
  align-items: center;
}

.user-input-controls {
  gap: 10px;
  margin-top: 10px;
}

.user-input-name {
  flex: 1;
  min-width: 220px;
  margin: 0;
  padding: 10px 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9em;
}

.user-input-name:focus {
  outline: none;
  border-color: #667eea;
}

.toggle-label {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.toggle-label:hover {
  background: #e9ecef;
  border-color: #667eea;
}

.toggle-label input[type="checkbox"] {
  margin-right: 12px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.toggle-label span {
  font-size: 0.95em;
  color: #333;
}

#user-input {
  width: 100%;
  min-height: 140px;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9em;
  resize: vertical;
  transition: border-color 0.2s;
}

#user-input:focus {
  outline: none;
  border-color: #667eea;
}

.file-upload {
  margin-top: 10px;
}

#file-input {
  width: 100%;
  padding: 8px;
  border: 2px dashed #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
}

#statistics {
  font-size: 0.9em;
  color: #555;
  line-height: 1.4;
}

.stat-item {
  margin-bottom: 8px;
}

.download-proteins-btn {
  margin-top: 12px;
  background: #4a5568;
  color: white;
  border: none;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  width: 100%;
  transition: background 0.2s;
}

.download-proteins-btn:hover {
  background: #2d3748;
}

.venn-label {
  font-size: 12px;
  font-weight: 600;
  fill: #333;
}

.venn-intersection-label {
  font-size: 12px;
  font-weight: 700;
  fill: #333;
  cursor: pointer;
}

.tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 9999;
  pointer-events: none;
  max-width: 280px;
}

@media (max-width: 1200px) {
  .main-content {
    flex-direction: column;
    height: auto;
  }

  .diagram-panel,
  .control-panel {
    flex: none;
    width: 100%;
  }
}
