/* Modern, clean design for URLGate */

:root {
  --primary: #0066ff;
  --primary-dark: #0052cc;
  --secondary: #6c757d;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --background: #f8f9fa;
  --card-bg: #ffffff;
  --text: #212529;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 3rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo svg {
  color: var(--primary);
}

.logo h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.card .description {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.form-group input {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
  font-family: var(--font-sans);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input[type="text"],
.form-group input[type="url"] {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

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

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary:disabled {
  background: var(--secondary);
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-copy {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-copy:hover {
  background: var(--primary-dark);
}

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fff5f5;
  color: var(--danger);
  border: 1px solid #feb2b2;
}

/* Result */
.result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}

.result h3 {
  color: var(--success);
  margin-bottom: 1rem;
}

.result-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.result-item code {
  background: var(--background);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
}

.result-item code.highlight {
  background: #d4edda;
  color: var(--success);
  font-weight: 600;
}

.copy-field {
  display: flex;
  gap: 0.5rem;
}

.copy-field input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--background);
}

/* How It Works */
.how-it-works .steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.step {
  text-align: center;
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.step h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.step p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.feature {
  text-align: center;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
}

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

.footer .small {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* Utilities */
.hidden {
  display: none;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 1rem 0.5rem;
  }

  .card {
    padding: 1.5rem;
  }

  .logo h1 {
    font-size: 1.5rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .how-it-works .steps,
  .features {
    grid-template-columns: 1fr;
  }
}
