/**
 * Project: GitWarp
 * Description: Global styles, Glassmorphism effects, and responsive layout.
 * 
 * Author: B.A. Umberger (Old Man Umby)
 * Website: https://oldmanumby.com
 * GitHub: https://github.com/oldmanumby
 * 
 * Copyright (c) 2026 B.A. Umberger.
 * Released under the MIT License.
 */
:root {
  /* OKLCH Color Palette from Unsafe.Games */
  --bg-site: oklch(0.17 0.02 255); /* #151B23 */
  --bg-card: oklch(0.23 0.02 260); /* #212830 */
  --text-body: oklch(1 0 0); /* #ffffff */
  --text-heading: oklch(0.6 0.14 255); /* #478BE6 */
  --color-link: oklch(0.45 0.18 35); /* #b22c00 */
  --color-icon: oklch(0.3 0.06 255); /* #243C5A */
  --color-border: oklch(0.3 0.06 255); /* #243C5A */
  --color-muted: oklch(0.6 0.015 255); /* Lighter muted for readability */
  --color-success: oklch(0.6 0.15 150); /* Greenish for success toast */
  --color-error: oklch(0.6 0.18 25); /* Reddish for errors */

  --font-body: 'Geist', system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-site);
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-heading);
  margin-top: 0;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

/* Glassmorphism Utilities */
.glass {
  background: color-mix(in oklch, var(--bg-card) 60%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition:
    filter 0.2s ease,
    transform 0.1s ease;
  border: none;
  gap: 0.5rem;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--text-heading);
  color: var(--bg-site);
}

.btn-icon {
  background: transparent;
  color: var(--text-body);
  padding: 0.5rem;
  border: 1px solid transparent;
}
.btn-icon:hover {
  background: var(--color-border);
  border: 1px solid var(--color-border);
}

/* Layout */
.top-menu {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.menu-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.logo h1 {
  margin: 0;
  font-size: 1.8rem;
}
.logo .subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.main-container {
  flex: 1;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  width: 100%;
}

/* Input Section */
.input-section {
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 3rem;
  border: 1px solid var(--text-heading);
}

.input-wrapper {
  display: flex;
  max-width: 600px;
  margin: 1.5rem auto 0.5rem;
  gap: 0.5rem;
}

.input-wrapper input {
  flex: 1;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background-color: var(--bg-site);
  color: var(--text-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-wrapper input:focus {
  border-color: var(--text-heading);
}

.error-message {
  color: var(--color-error);
  font-size: 0.9rem;
  min-height: 1.5rem;
  margin: 0;
}

/* Cards Grid */
.cards-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  padding: 1.5rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  position: relative;
  border: 1px solid transparent;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.card.active {
  border: 1px solid var(--color-success);
}

.card.active .card-link {
  color: var(--color-success);
}

.card.disabled {
  border: 1px solid var(--color-error);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.card-icon {
  background-color: var(--color-border);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--text-heading);
}

.card-title {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.card-link-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-site);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--color-border);
  box-sizing: border-box;
}

.card-link {
  font-family: monospace;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.card-description {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-top: auto;
}

.copy-btn,
.go-btn {
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.2rem;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover,
.go-btn:hover {
  color: var(--text-body);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--color-success);
  color: var(--bg-site);
  padding: 1rem 1.5rem;
  border-radius: 4px;
  font-weight: bold;
  transform: translateY(200px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  transform: translateY(0);
}

/* Footer */
.bottom-menu {
  border-top: 1px solid var(--color-border);
  padding: 2rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

/* GitHub Button */
.gitea-link {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
}

.github-button {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background-color: var(--bg-card);
  color: var(--text-body);
  border: 1px solid var(--color-border);
  text-decoration: none;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.github-button:hover {
  background-color: var(--color-border);
  opacity: 1; /* override default a hover opacity */
}

.github-button svg {
  margin-right: 10px;
  fill: currentColor;
}

/* Contribute Section */
.section-divider {
  border: 0;
  height: 1px;
  background-color: var(--color-border);
  margin: 4rem 0 3rem;
}

.contribute-section {
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem;
  border: 1px solid var(--text-heading);
}

.contribute-section p {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

/* Interactive Cards Layout */
.interactive-section-title {
  grid-column: 1 / -1;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

.interactive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
  grid-column: 1 / -1;
}

.card-interactive {
  grid-column: 1 / -1;
  text-align: left;
  align-items: stretch;
  padding: 1.75rem;
}

.card-interactive.disabled {
  opacity: 0.7;
}

.card-interactive.disabled .interactive-controls {
  opacity: 0.5;
  pointer-events: none;
}

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

.card-header-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.context-badge-wrapper {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.context-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.context-badge.active {
  background-color: oklch(0.35 0.14 150);
  color: oklch(0.98 0.02 150);
}

.context-badge.inactive,
.context-badge.context-unknown {
  background-color: oklch(0.25 0.03 255);
  color: oklch(0.65 0.02 255);
  opacity: 0.5;
}

.context-badge.context-user {
  background-color: oklch(0.35 0.14 280);
  color: oklch(0.98 0.02 280);
}

.context-badge.context-repo {
  background-color: oklch(0.35 0.14 230);
  color: oklch(0.98 0.02 230);
}

.context-badge.context-file {
  background-color: oklch(0.35 0.14 150);
  color: oklch(0.98 0.02 150);
}

.context-badge.context-commit {
  background-color: oklch(0.35 0.14 60);
  color: oklch(0.98 0.02 60);
}

.context-badge.context-pr {
  background-color: oklch(0.35 0.14 320);
  color: oklch(0.98 0.02 320);
}

.context-badge.context-mismatch {
  background-color: oklch(0.35 0.14 25);
  color: oklch(0.98 0.02 25);
}

.card.disabled {
  opacity: 0.55;
  filter: grayscale(0.2);
}

.card.disabled .copy-btn {
  pointer-events: none;
  opacity: 0.4;
}

.context-notice {
  font-size: 0.85rem;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  border-left: 3px solid var(--color-border);
  margin: 0.5rem 0 1rem;
}

.interactive-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--bg-site);
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 200px;
}

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

.interactive-input,
.interactive-select {
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background-color: var(--bg-card);
  color: var(--text-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
  height: 42px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.interactive-input:focus,
.interactive-select:focus {
  border-color: var(--text-heading);
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-body);
}

.interactive-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--text-heading);
  cursor: pointer;
}

.interactive-output {
  justify-content: space-between;
  width: 100%;
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
  .main-container {
    padding: 0 1rem;
  }
  .input-section {
    padding: 1.5rem 1rem;
  }
  .card {
    padding: 1.25rem;
  }
  .card-interactive {
    padding: 1.25rem;
  }
  .cards-section {
    grid-template-columns: 1fr;
  }
}
