@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  --bg-gradient-1: #0f172a;
  --bg-gradient-2: #1e1b4b;
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  padding: 20px;
  overflow-x: hidden;
  position: relative;
}

/* Background glowing decoration */
.background-decor {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: var(--primary-color);
  top: -100px;
  right: -50px;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: #ec4899;
  bottom: -50px;
  left: -50px;
}

/* Main Card */
.card {
  width: 100%;
  max-width: 580px;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

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

/* Header */
.header {
  text-align: center;
  margin-bottom: 28px;
}

.header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a5b4fc, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.header .subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 300;
}

/* Generator Controls */
.generator-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-row label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-left: 2px;
}

/* Param row side by side */
.param-row {
  flex-direction: row;
  gap: 12px;
}

.param-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.param-box.hidden {
  display: none !important;
}

/* Styled select */
select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 18px;
  padding-right: 45px;
}

select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background-color: rgba(15, 23, 42, 0.8);
}

select option {
  background: #1e293b;
  color: var(--text-primary);
}

/* Number inputs */
input[type="number"] {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
  width: 100%;
}

input[type="number"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.8);
}

/* Generate Button */
button#generate-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  letter-spacing: 0.3px;
}

button#generate-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

button#generate-btn:active {
  transform: translateY(1px);
}

/* Pattern Output */
.pattern-output-container {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.pattern-output-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
}

#pattern-display {
  font-family: 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #38bdf8;
  white-space: pre;
  overflow-x: auto;
  max-height: 340px;
  overflow-y: auto;
}

/* Custom Scrollbar */
#pattern-display::-webkit-scrollbar { height: 6px; width: 6px; }
#pattern-display::-webkit-scrollbar-track { background: transparent; }
#pattern-display::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
#pattern-display::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
