/* Gerald Setup - Premium Dark Mode */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-card: #111118;
  --border-card: rgba(255, 255, 255, 0.06);
  --accent-primary: #00ff87;
  --accent-secondary: #00b4d8;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --input-bg: #14141c;
  --input-border: rgba(255, 255, 255, 0.08);
  --radius-card: 12px;
  --radius-input: 10px;
  --radius-pill: 999px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
}

.header-icon {
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

.header-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Card Styles */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
  opacity: 0;
  animation-fill-mode: forwards;
}

.card:hover {
  border-color: rgba(0, 255, 135, 0.15);
  box-shadow: 0 8px 32px rgba(0, 255, 135, 0.08);
}

.card-fade-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.card-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Step Badge */
.step-badge {
  width: 32px;
  height: 32px;
  background: rgba(0, 255, 135, 0.1);
  border: 1.5px solid var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-primary);
}

/* Optional Badge */
.optional-badge {
  background: rgba(0, 180, 216, 0.1);
  color: var(--accent-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
  margin-right: 0.5rem;
}

/* Collapsible Sections */
.card-header-collapsible {
  cursor: pointer;
  user-select: none;
}

.collapse-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 6px;
}

.collapse-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-primary);
}

.collapse-toggle svg {
  transition: transform 0.3s ease;
}

.card-header-collapsible.active .collapse-toggle svg {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 1;
}

.collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.input-field {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-field:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 255, 135, 0.1);
}

.input-field:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.textarea-field {
  resize: vertical;
  min-height: 100px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Select Wrapper */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text-secondary);
  pointer-events: none;
  transition: border-top-color 0.2s ease;
}

.select-wrapper:hover::after {
  border-top-color: var(--accent-primary);
}

select.input-field {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 3rem;
  cursor: pointer;
}

/* Input Group */
.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group-field {
  flex: 1;
}

/* Buttons */
.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-input);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-primary);
  color: #0a0a0f;
  box-shadow: 0 4px 12px rgba(0, 255, 135, 0.2);
}

.btn-primary:hover {
  background: #00e67a;
  box-shadow: 0 6px 20px rgba(0, 255, 135, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--accent-primary);
  color: var(--accent-primary);
}

.btn-secondary:hover {
  background: rgba(0, 255, 135, 0.1);
  box-shadow: 0 0 20px rgba(0, 255, 135, 0.2);
}

.btn-tertiary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--input-border);
}

.btn-tertiary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-compact {
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Field Hints */
.field-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.field-hint strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.field-hint a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.field-hint a:hover {
  color: #00e67a;
  text-decoration: underline;
}

/* Code */
code {
  background: rgba(0, 255, 135, 0.08);
  color: var(--accent-primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Info Box */
.info-box {
  background: rgba(0, 180, 216, 0.05);
  border: 1px solid rgba(0, 180, 216, 0.2);
  border-radius: var(--radius-input);
  padding: 1rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}

.info-box svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.info-box div {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-box strong {
  color: var(--accent-secondary);
}

.info-box a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.info-box a:hover {
  color: #00d4ff;
  text-decoration: underline;
}

/* Status Section */
.status-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.status-text {
  font-size: 1rem;
  color: var(--text-primary);
  padding: 1rem;
  background: rgba(0, 255, 135, 0.05);
  border: 1px solid rgba(0, 255, 135, 0.15);
  border-radius: var(--radius-input);
  min-height: 60px;
  display: flex;
  align-items: center;
}

.status-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.status-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.status-link:hover {
  color: #00e67a;
  gap: 0.75rem;
}

.link-divider {
  color: var(--text-muted);
}

/* Log Output */
.log-output {
  background: #0d1117;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-input);
  padding: 1.25rem;
  margin-top: 1.5rem;
  color: var(--accent-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  min-height: 100px;
  max-height: 500px;
  overflow-y: auto;
}

.log-output::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.log-output::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 135, 0.3);
  border-radius: 4px;
}

.log-output::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 135, 0.5);
}

.log-output:empty::before {
  content: 'Output will appear here...';
  color: var(--text-muted);
  font-style: italic;
}

/* Skeleton Loaders */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 20px;
  width: 60%;
}

.skeleton-select {
  height: 48px;
  width: 100%;
  border-radius: var(--radius-input);
}

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

.footer strong {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .header-title {
    font-size: 2rem;
  }

  .header-subtitle {
    font-size: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  button {
    width: 100%;
    min-height: 44px;
  }

  .input-group {
    flex-direction: column;
  }

  .btn-compact {
    width: 100%;
  }

  .status-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .link-divider {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-title {
    font-size: 1.75rem;
  }

  .card-header h2 {
    font-size: 1.25rem;
  }
}

/* GitHub OAuth User Code Display */
.user-code {
  font-size: 2rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;
  font-weight: bold;
  letter-spacing: 0.3em;
  padding: 1.5rem 2rem;
  background: rgba(0, 255, 135, 0.1);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-input);
  margin: 1rem 0;
  text-align: center;
  color: var(--accent-primary);
  user-select: all;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-code:hover {
  background: rgba(0, 255, 135, 0.15);
  border-color: var(--accent-primary);
  transform: scale(1.02);
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  .card {
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  button {
    display: none;
  }
}
