:root {
  --bg-dark: #0B0E11;
  --bg-card: rgba(255, 255, 255, 0.05);
  --primary: #6C5CE7;
  --primary-hover: #5A4FCF;
  --secondary: #A29BFE;
  --accent: #00CEC9;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --danger: #FF7675;
  --warning: #FDCB6E;
  --success: #55E6C1;
  
  --radius: 12px;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 14, 17, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-right { display: flex; gap: 1rem; }

.btn {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.btn.active { background: var(--primary); border-color: var(--primary-hover); }

.app {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.input-section {
  position: relative;
}

.url-input {
  width: 100%;
  padding: 1.25rem 1.5rem;
  font-size: 1.1rem;
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
}

.url-input.invalid {
  border-color: var(--danger);
}

/* Warnings */
#warnings {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.warning-msg {
  background: rgba(253, 203, 110, 0.1);
  color: var(--warning);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--warning);
  font-size: 0.9rem;
  font-weight: 500;
}
.error-msg {
  background: rgba(255, 118, 117, 0.1);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--danger);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Components */
.components {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.component-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: var(--radius);
  position: relative;
  transition: transform 0.2s;
}
.component-card:hover { transform: translateY(-2px); }

.comp-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.comp-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}
.component-card:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); }

/* Card Sections */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--secondary);
}

/* Table */
.params-table {
  width: 100%;
  border-collapse: collapse;
}

.params-table th, .params-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.params-table th {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
}

.params-table td {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
}
.val-cell { color: var(--accent); }

/* Build URL */
.build-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fg {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus { border-color: var(--primary); }

.build-output {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
#build-result {
  font-family: var(--font-mono);
  word-break: break-all;
  color: var(--success);
}

@media (max-width: 600px) {
  .header { flex-direction: column; gap: 1rem; padding: 1rem; }
  .build-grid { grid-template-columns: 1fr; }
}
