/* Shared application theme matching the homepage V2 styling */
/* CSS Variables from homepage.css for consistency across all app pages */

:root {
  /* Homepage V2 color palette */
  --bg-black: #0a0a0a;
  --bg-dark: #111111;
  --bg-card: #161616;
  --bg-elevated: #1a1a1a;

  --text-white: #fafafa;
  --text-gray: #c4c4c4;
  --text-muted: #8a8a8a;

  --accent: #c8ff00;
  --accent-dim: rgba(200, 255, 0, 0.15);
  --accent-glow: rgba(200, 255, 0, 0.4);

  --red: #ff3b3b;
  --red-dim: rgba(255, 59, 59, 0.15);

  --border: #2a2a2a;
  --border-light: #333333;

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Legacy variables for backward compatibility */
  --primary: #c8ff00;
  --primary-dark: #a8d600;
  --primary-soft: #d4ff33;
  --secondary: #c8ff00;
  --surface: #161616;
  --surface-strong: #111111;
  --surface-soft: #1a1a1a;
  --text-primary: #fafafa;
  --text-secondary: #c4c4c4;
  --code-bg: #1a1a1a;
  --success: #27c93f;
  --warning: #fbbf24;
  --danger: #ff3b3b;
  --info: #38bdf8;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.45);
}

body.app-shell {
  min-height: 100vh;
  margin: 0;
  background: var(--bg-black);
  color: var(--text-white);
  font-family: var(--font-display);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

body.app-shell a {
  color: var(--accent);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

body.app-shell a:hover {
  color: var(--text-white);
}

body.app-shell h1,
body.app-shell h2,
body.app-shell h3,
body.app-shell h4 {
  color: var(--text-white);
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

body.app-shell p,
body.app-shell label,
body.app-shell li {
  color: var(--text-gray);
}

/* Layout chrome - Topbar matching homepage header */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.app-topbar .nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.app-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-white) !important;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.app-brand span {
  color: var(--accent);
  font-weight: 700;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-link {
  color: var(--text-gray);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s var(--ease-out);
}

.nav-link:hover {
  color: var(--text-white);
  border-color: var(--border);
  background: rgba(200, 255, 0, 0.03);
}

.nav-link.active {
  color: var(--accent);
  border-color: rgba(200, 255, 0, 0.3);
  background: var(--accent-dim);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-white);
  font-size: 14px;
  font-weight: 500;
}

.action-button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--bg-black);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.app-main {
  width: min(1400px, 96vw);
  margin: 32px auto 64px;
  padding: 0 8px;
}

/* Flash banners */
.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(200, 255, 0, 0.3);
  background: var(--accent-dim);
  color: var(--text-white);
  margin-bottom: 24px;
}

.flash::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.flash.alert {
  border-color: rgba(255, 59, 59, 0.3);
  background: var(--red-dim);
}

.flash.alert::before {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-dim);
}

/* Panels, backgrounds, borders - Tailwind overrides for dark theme */
.bg-white,
.bg-gray-50,
.bg-gray-100 {
  background-color: var(--bg-card) !important;
  color: var(--text-white);
}

.bg-gray-800 {
  background-color: var(--bg-elevated) !important;
}

.border-gray-200,
.border-gray-300,
.border-gray-400 {
  border-color: var(--border) !important;
}

.shadow,
.shadow-sm {
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35) !important;
}

.hover\:bg-gray-50:hover {
  background-color: rgba(200, 255, 0, 0.03) !important;
}

.text-gray-900,
.text-gray-800 {
  color: var(--text-white) !important;
}

.text-gray-700,
.text-gray-600 {
  color: var(--text-gray) !important;
}

.text-gray-500,
.text-gray-400 {
  color: var(--text-muted) !important;
}

.bg-blue-50 {
  background-color: var(--accent-dim) !important;
}

.bg-blue-100 {
  background-color: rgba(200, 255, 0, 0.2) !important;
}

.text-blue-600,
.text-blue-700,
.text-blue-800,
.text-blue-900 {
  color: var(--accent) !important;
}

.bg-blue-600,
.bg-blue-700 {
  background: var(--accent) !important;
  color: var(--bg-black) !important;
  border: none;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.bg-blue-600.text-white,
.bg-blue-700.text-white {
  color: var(--bg-black) !important;
}

.hover\:bg-blue-700:hover,
.hover\:bg-blue-500:hover {
  background: var(--text-white) !important;
  color: var(--bg-black) !important;
}

.hover\:text-blue-700:hover,
.hover\:text-blue-900:hover {
  color: var(--text-white) !important;
}

.border-blue-500,
.border-blue-200,
.border-blue-300 {
  border-color: rgba(200, 255, 0, 0.3) !important;
}

.focus\:ring-blue-500:focus {
  --tw-ring-color: var(--accent);
}

.focus\:ring-offset-2:focus {
  --tw-ring-offset-color: var(--bg-black);
}

.bg-green-50 {
  background-color: rgba(39, 201, 63, 0.08) !important;
}

.bg-green-100 {
  background-color: rgba(39, 201, 63, 0.15) !important;
}

.text-green-800,
.text-green-700 {
  color: #27c93f !important;
}

.bg-red-50 {
  background-color: var(--red-dim) !important;
}

.bg-red-100 {
  background-color: rgba(255, 59, 59, 0.15) !important;
}

.text-red-800,
.text-red-700,
.text-red-600 {
  color: var(--red) !important;
}

.bg-yellow-50 {
  background-color: rgba(251, 191, 36, 0.08) !important;
}

.bg-yellow-100 {
  background-color: rgba(251, 191, 36, 0.15) !important;
}

.text-yellow-800,
.text-yellow-700 {
  color: #fbbf24 !important;
}

/* Inputs & form controls */
body.app-shell input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
body.app-shell select,
body.app-shell textarea {
  background: var(--bg-elevated);
  color: var(--text-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.2s var(--ease-out);
}

body.app-shell input::placeholder,
body.app-shell textarea::placeholder {
  color: var(--text-muted);
}

body.app-shell input:focus,
body.app-shell select:focus,
body.app-shell textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Tables */
body.app-shell table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  color: var(--text-white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

body.app-shell thead {
  background: var(--bg-elevated);
}

body.app-shell th {
  padding: 14px 18px;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

body.app-shell td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-gray);
}

body.app-shell tbody tr {
  transition: background 0.15s;
}

body.app-shell tbody tr:hover {
  background: rgba(200, 255, 0, 0.03);
}

body.app-shell .divide-y > * + * {
  border-top-color: var(--border);
}

/* Code blocks */
code,
pre {
  background: var(--bg-elevated);
  color: var(--text-white);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}

pre {
  padding: 16px;
  overflow: auto;
}

code {
  padding: 2px 8px;
  font-size: 13px;
  color: var(--accent);
}

pre code {
  padding: 0;
  color: var(--text-gray);
}

/* Rounded corners for cards */
.rounded-lg {
  border-radius: 16px !important;
}

/* Utility badges */
.bg-green-100,
.bg-red-100,
.bg-yellow-100,
.bg-blue-100 {
  border: 1px solid var(--border);
}

/* Status pill badges */
.rounded-full {
  border-radius: 999px !important;
}

/* Button improvements */
button,
.btn,
[type="submit"] {
  cursor: pointer;
}

/* Primary action button - lime green brand color */
.btn-primary {
  background: var(--accent);
  color: var(--bg-black);
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 1rem;
  transition: all 0.2s var(--ease-out);
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--primary-soft);
  color: var(--bg-black);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* Form inputs with brand accent focus */
.form-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-top: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-white);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Scrollbar styling */
body.app-shell ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.app-shell ::-webkit-scrollbar-track {
  background: var(--bg-black);
}

body.app-shell ::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

body.app-shell ::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* App Footer */
.app-footer {
  border-top: 1px solid var(--border, #30363d);
  padding: 48px 0 24px;
  margin-top: auto;
}

.app-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-landing-pages {
  width: 100%;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.footer-section-title {
  font-size: 12px;
  color: var(--accent, #c9ff3c);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 16px;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-list a {
  color: var(--text-gray, #8b949e);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease;
}

.footer-links-list a:hover {
  color: var(--text, #e6edf3);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border, #30363d);
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-gray, #8b949e);
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  font-size: 13px;
  color: var(--text-gray, #8b949e);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--text, #e6edf3);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-nav {
    justify-content: center;
  }
}
