.regex-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.regex-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.regex-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.regex-label {
  color: #e0e6ed;
  font-size: 0.938rem;
}

.regex-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.regex-input-group input[type="text"] {
  flex: 1;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: "Courier New", monospace;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e6ed;
  outline: none;
}

.regex-input-group input[type="text"]:focus {
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
}

#replacement {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: "Courier New", monospace;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e6ed;
  outline: none;
}

#replacement:focus {
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
}

.regex-flags {
  display: flex;
  gap: 0.5rem;
}

.flag-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.flag-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.flag-checkbox span {
  font-family: "Courier New", monospace;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s;
}

.flag-checkbox:hover {
  background: rgba(255, 255, 255, 0.08);
}

.flag-checkbox input:checked + span {
  color: #3b82f6;
}

.flag-checkbox input:checked {
  background: rgba(59, 130, 246, 0.1);
}

.regex-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  font-size: 0.875rem;
  color: #93c5fd;
}

.regex-info.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.regex-info.success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.info-icon {
  font-size: 1.125rem;
}

.regex-editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .regex-editors {
    grid-template-columns: 1fr;
  }
}

.regex-editor-panel {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #e0e6ed;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.match-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.625rem;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border-radius: 12px;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.5rem 0.875rem;
  font-size: 0.813rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e6ed;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-small.primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.btn-small.primary:hover {
  background: #2563eb;
  border-color: #2563eb;
}

#inputText {
  flex: 1;
  min-height: 400px;
  padding: 1.25rem;
  font-size: 0.938rem;
  line-height: 1.6;
  font-family: "Courier New", monospace;
  background: transparent;
  border: none;
  color: #e0e6ed;
  resize: vertical;
  outline: none;
}

.output-preview {
  flex: 1;
  min-height: 400px;
  padding: 1.25rem;
  font-size: 0.938rem;
  line-height: 1.6;
  font-family: "Courier New", monospace;
  color: #e0e6ed;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.output-preview.empty {
  color: rgba(255, 255, 255, 0.3);
  font-style: italic;
}

.match-highlight {
  background: rgba(34, 197, 94, 0.25);
  border-bottom: 2px solid #22c55e;
  padding: 2px 0;
  animation: highlightPulse 0.5s ease;
}

@keyframes highlightPulse {
  0%,
  100% {
    background: rgba(34, 197, 94, 0.25);
  }
  50% {
    background: rgba(34, 197, 94, 0.4);
  }
}

.regex-reference {
  margin-top: 1rem;
}

.regex-reference summary {
  cursor: pointer;
  padding: 0.5rem 0;
  color: #e0e6ed;
  user-select: none;
}

.regex-reference summary:hover {
  color: #3b82f6;
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ref-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ref-section {
  font-size: 0.875rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
}

.ref-section code {
  display: inline-block;
  min-width: 60px;
  padding: 0.125rem 0.375rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  font-family: "Courier New", monospace;
  color: #93c5fd;
  font-size: 0.813rem;
}
