.random-generator-app {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
}

.config-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-color);
}

.config-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.config-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  min-width: 100px;
}

.config-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-input-group input[type="number"] {
  width: 100px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1f2937;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05) inset;
}

.dark-theme .config-input-group input[type="number"] {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #f3f4f6;
}

.config-input-group input[type="number"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.range-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-input-group input[type="number"] {
  width: 100px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1f2937;
  font-size: 14px;
  outline: none;
}

.dark-theme .range-input-group input[type="number"] {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #f3f4f6;
}

.range-separator {
  color: var(--text-color);
  font-weight: 600;
}

.checkbox-group, .radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.checkbox-item, .radio-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  user-select: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.checkbox-item:hover, .radio-item:hover {
  background-color: var(--hover-bg-color);
}

.checkbox-item input[type="checkbox"], .radio-item input[type="radio"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.config-input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1f2937;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dark-theme .config-input {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #f3f4f6;
}

.config-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

textarea.config-input {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.separator-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.random-output-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 0;
  border: none;
  background: transparent;
  overflow-y: auto;
}

.random-output-area {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  resize: none;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #e5e7eb;
  padding: 12px 16px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  margin: 0;
}

.code-output {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

.number-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  transition: all 0.3s ease;
  animation: numberCardIn 0.4s ease forwards;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  cursor: pointer;
  overflow: hidden;
}

.number-card:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

@keyframes numberCardIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.number-value {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-weight: 700;
  color: #10b981;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  word-break: break-all;
  text-align: center;
  line-height: 1.2;
  font-size: clamp(20px, 6vw, 48px);
}

.light-theme .random-output-container,
.light-theme .random-output-area {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.light-theme .random-output-area {
  color: #1f2937;
}

.light-theme .number-card {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

.light-theme .number-card:hover {
  background: rgba(16, 185, 129, 0.12);
}

.light-theme .number-value {
  color: #059669;
}

.mode-switcher-in-controls {
  display: flex;
  gap: 8px;
}

.mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: transparent;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.mode-btn:hover {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.mode-btn.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #10b981;
  font-weight: 600;
}

.mode-icon {
  font-size: 14px;
}

.config-input-group.full-width {
  width: 100%;
}

.random-config-panel,
.picker-config-panel,
.number-config-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 16px;
}

.light-theme .mode-btn {
  border-color: rgba(148, 163, 184, 0.6);
  color: #334155;
}

.light-theme .mode-btn:hover {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.light-theme .mode-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.5);
  color: #059669;
}

.hidden {
  display: none !important;
}

.range-mode-switch {
  display: flex;
  gap: 4px;
  background: rgba(15, 23, 42, 0.35);
  padding: 4px;
  border-radius: 10px;
}

.range-mode-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.range-mode-btn:hover {
  color: #e5e7eb;
}

.range-mode-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  font-weight: 600;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal {
  background: #0f172a;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f8fafc;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(148, 163, 184, 0.18);
  color: #f8fafc;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-empty {
  text-align: center;
  color: #9ca3af;
  padding: 40px 20px;
}

.history-item {
  padding: 16px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.history-item-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.history-item-type.number {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.history-item-type.picker {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.history-item-time {
  font-size: 12px;
  color: #cbd5e1;
  flex-shrink: 0;
}

.history-item-content {
  font-size: 14px;
  color: #f1f5f9;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}

.history-item-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.history-item-actions button {
  padding: 8px 16px;
  font-size: 12px;
}

.light-theme .modal {
  background: #ffffff;
  border-color: #e2e8f0;
}

.light-theme .modal-header {
  border-bottom-color: #e2e8f0;
}

.light-theme .modal-header h3 {
  color: #1f2937;
}

.light-theme .modal-close {
  color: #64748b;
}

.light-theme .modal-close:hover {
  color: #1f2937;
  background: rgba(15, 23, 42, 0.05);
}

.light-theme .modal-footer {
  border-top-color: #e2e8f0;
}

.light-theme .history-empty {
  color: #64748b;
}

.light-theme .history-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.light-theme .history-item-time {
  color: #475569;
}

.light-theme .history-item-content {
  color: #000000;
}

.light-theme .history-item-actions {
  border-top-color: #e2e8f0;
}
