/**
 * NorthTec - Base Styles
 * Shared CSS variables and base styles for all pages
 */

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* CSS Variables - Dark Theme (default) */
:root {
  /* Primary colors */
  --primary: #15B3CE;
  --primary-dark: #12A6BE;
  --primary-glow: rgba(21, 179, 206, 0.15);

  /* Backgrounds */
  --bg: #05070B;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(21, 179, 206, 0.05);
  --bg-tertiary: rgba(255, 255, 255, 0.06);
  --bg-code: #0a0f14;

  /* Text */
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.55);

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(21, 179, 206, 0.3);

  /* Status colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Misc */
  --logo-filter: brightness(0.9);
}

/* Light Theme */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: rgba(21, 179, 206, 0.08);
  --bg-tertiary: #f1f5f9;
  --bg-code: #f1f5f9;
  --text: #1e293b;
  --text-muted: #334155;
  --border: #e2e8f0;
  --border-hover: rgba(21, 179, 206, 0.5);
  --logo-filter: brightness(0) saturate(100%);
}

[data-theme="light"] body::before,
[data-theme="light"] body::after {
  opacity: 0.1;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .card-title,
[data-theme="light"] .section-title,
[data-theme="light"] .endpoint-title {
  color: #0f172a;
}

/* Base body styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background glows */
body::before {
  content: '';
  position: fixed;
  left: -200px;
  top: 20%;
  width: 600px;
  height: 600px;
  filter: blur(120px);
  opacity: 0.25;
  pointer-events: none;
  background: radial-gradient(circle, rgba(21, 179, 206, 0.5) 0%, transparent 70%);
  animation: glow 6s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  right: -150px;
  bottom: 10%;
  width: 500px;
  height: 500px;
  filter: blur(100px);
  opacity: 0.2;
  pointer-events: none;
  background: radial-gradient(circle, rgba(21, 179, 206, 0.4) 0%, transparent 70%);
  animation: glow 8s ease-in-out infinite 2s;
}

@keyframes glow {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.4; }
}

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

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

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Header */
.header {
  background: rgba(5, 7, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo img {
  height: 28px;
  width: auto;
  filter: var(--logo-filter);
  opacity: 0.9;
}

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

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--primary);
}

/* Buttons */
.btn {
  padding: 12px 20px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #031017;
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 8px 32px rgba(21, 179, 206, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(21, 179, 206, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #031017;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-small {
  padding: 10px 18px;
  font-size: 0.85rem;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow: none;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
  cursor: pointer;
}

.back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 18px;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 800;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-docs {
  background: rgba(21, 179, 206, 0.15);
  border: 1px solid rgba(21, 179, 206, 0.25);
  color: var(--primary);
}

.badge-internal {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--warning);
}

.badge-sales {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--success);
}

.badge-active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.badge-expired {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* Footer */
.footer {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 64px;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
  color: var(--text-muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(21, 179, 206, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 14px;
}

/* Messages */
.message {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  display: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.message.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
  display: block;
}

.message.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ff6b6b;
  display: block;
}

/* Forms */
.form-group {
  margin-bottom: 24px;
}

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

input, select, textarea {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(21, 179, 206, 0.16);
  border-radius: 999px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(21, 179, 206, 0.6);
  box-shadow: 0 0 0 5px rgba(21, 179, 206, 0.11);
  background: rgba(255, 255, 255, 0.04);
}

input:hover, select:hover, textarea:hover {
  border-color: rgba(21, 179, 206, 0.32);
  background: rgba(255, 255, 255, 0.04);
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

textarea {
  min-height: 100px;
  resize: vertical;
  border-radius: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 16px 20px;
  }

  .nav {
    gap: 16px;
  }
}
