/* ============================================
   RemoteIP — Futuristic Dark Theme
   ============================================ */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a1f35;
  --bg-card-hover: #1f2647;
  --bg-nav: rgba(10, 14, 26, 0.85);

  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --accent-glow: rgba(0, 212, 255, 0.3);
  --accent-secondary: #7c3aed;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 212, 255, 0.2);

  --radius: 16px;
  --radius-sm: 8px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

/* ============================================
   Reset & Base
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: #33dfff;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================
   Navigation
   ============================================ */

.nav-futuristic {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

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

.brand-icon {
  color: var(--accent);
  font-size: 1.5rem;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links .nav-link {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-links .nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-cta {
  background: linear-gradient(135deg, var(--accent-secondary), #6d28d9) !important;
  color: #fff !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  margin-left: 0.5rem;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
  transition: all 0.3s ease !important;
}

.nav-cta:hover {
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
  color: #fff !important;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.user-indicator {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.toggle-bar {
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active .toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active .toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  padding-top: 64px;
  min-height: calc(100vh - 200px);
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
  text-align: center;
  padding: 5rem 0 3rem;
  position: relative;
}

.hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, var(--accent-dim) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.text-accent {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ============================================
   IP Cards Grid
   ============================================ */

.ip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.ip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.ip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ip-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 60px var(--accent-dim);
}

.ip-card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.card-icon {
  color: var(--accent);
  font-size: 1.25rem;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}

.protocol-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 255, 0.15);
}

.badge-v4 {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-orange);
  border-color: rgba(245, 158, 11, 0.15);
}

.card-body {
  padding: 1rem 1.5rem 1.5rem;
}

.card-body object {
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
}

.fallback-text {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* IP Display (iframe) */
.ip-frame-wrapper {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 3.5rem;
}

.ip-frame {
  display: block;
  width: 100%;
  height: 3.5rem;
  border: none;
  background: transparent;
  color-scheme: dark;
}

/* ============================================
   API / Code Section
   ============================================ */

.api-section {
  margin-bottom: 4rem;
}

.api-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.api-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.api-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.terminal-icon {
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.4));
}

.code-block {
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.15);
}

.code-line {
  white-space: nowrap;
  min-height: 1.5em;
}

.code-comment {
  color: var(--text-muted);
}

.code-prompt {
  color: var(--accent-green);
  margin-right: 0.75rem;
  font-weight: 500;
  user-select: none;
}

/* ============================================
   Dashboard Grid (index page)
   ============================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.dashboard-card:hover {
  border-color: var(--border-accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.dashboard-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.chart-container {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.chart-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

/* ============================================
   Footer
   ============================================ */

.footer-futuristic {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 2rem;
  margin-top: auto;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.footer-brand:hover {
  color: var(--text-primary);
}

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

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: var(--accent);
}

.footer-divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0 1.5rem;
}

.footer-bottom {
  text-align: center;
}

.footer-bottom small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ============================================
   Animations
   ============================================ */

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

.hero-section {
  animation: fadeInUp 0.6s ease-out;
}

.ip-card,
.api-card,
.dashboard-card {
  animation: fadeInUp 0.6s ease-out both;
}

.ip-card:nth-child(1) { animation-delay: 0.1s; }
.ip-card:nth-child(2) { animation-delay: 0.2s; }
.ip-card:nth-child(3) { animation-delay: 0.3s; }

.dashboard-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-card:nth-child(2) { animation-delay: 0.2s; }

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.25rem;
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-links .nav-link {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .nav-cta {
    margin-left: 0 !important;
    text-align: center;
    margin-top: 0.5rem;
  }

  .nav-user {
    border-left: none;
    padding-left: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-left: 0;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .ip-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .api-header,
  .card-header {
    padding: 1rem 1.25rem;
  }

  .card-body,
  .code-block {
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 3rem 0 2rem;
  }

  .hero-title {
    font-size: 1.875rem;
  }

  .code-block {
    font-size: 0.75rem;
  }
}

/* ============================================
   Selection
   ============================================ */

::selection {
  background: var(--accent-dim);
  color: var(--accent);
}
