/* Modern CSS for ipaddress.sh */

/* CSS Variables */
:root {
  --primary: #0a0a0a;
  --primary-light: #1a1a1a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --success: #10b981;
  --code-bg: #1e1e1e;
  --terminal-bg: #0d1117;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --transition: all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

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

a:hover {
  color: var(--accent-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Hero Section */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-secondary) 100%);
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out;
}

.hero-title {
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

.hero-subtitle {
  font-size: clamp(18px, 3vw, 22px);
  color: var(--text-secondary);
  margin-bottom: 48px;
  font-weight: 400;
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

/* Terminal */
.terminal {
  background: var(--terminal-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  margin: 0 auto 40px;
  animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

.terminal-header {
  background: #161b22;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.terminal-buttons {
  display: flex;
  gap: 8px;
}

.terminal-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-btn.red { background: #ff5f56; }
.terminal-btn.yellow { background: #ffbd2e; }
.terminal-btn.green { background: #27c93f; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: #8b949e;
  font-weight: 500;
}

.terminal-body {
  padding: 20px 24px;
  min-height: 80px;
}

.terminal-body pre {
  margin: 0;
}

.terminal-body code {
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;
  font-size: 14px;
  color: #c9d1d9;
  background: transparent;
}

/* IP Display */
.ip-display {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.ip-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
}

.ip-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
}

/* Section Styles */
.section {
  padding: 100px 24px;
}

.section-title {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 60px;
}

/* API Section */
.api-section {
  background: var(--bg);
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

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

.api-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.api-card-header {
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.api-method {
  padding: 4px 10px;
  background: var(--success);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.api-endpoint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  background: transparent;
}

.api-card-body {
  padding: 20px;
}

.api-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 8px;
}

.api-response {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-tertiary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

/* Examples Section */
.examples-section {
  background: var(--bg-secondary);
}

.tabs-container {
  max-width: 900px;
  margin: 0 auto;
}

.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 8px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  justify-content: center;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

.tab-btn.active {
  color: white;
  background: var(--primary);
}

.tabs-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tab-pane {
  display: none;
  padding: 24px;
}

.tab-pane.active {
  display: block;
}

.code-block {
  background: var(--code-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.code-block:last-child {
  margin-bottom: 0;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-header span {
  font-size: 13px;
  font-weight: 500;
  color: #8b949e;
}

.copy-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #8b949e;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.copy-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.copy-btn.copied {
  color: var(--success);
}

.code-block pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
}

.code-block code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, #1f2937 100%);
  padding: 80px 24px;
}

.cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-content h2 {
  font-size: 32px;
  color: white;
  margin-bottom: 12px;
}

.cta-content p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 32px;
}

.cta-section .btn-primary {
  background: white;
  color: var(--primary);
}

.cta-section .btn-primary:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

/* Footer */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 60px 24px 40px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 300px;
}

.footer-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  display: block;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.footer-bottom {
  text-align: center;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 14px;
  color: var(--text-secondary);
}

.footer-bottom a {
  color: var(--text);
  font-weight: 600;
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding: 60px 20px;
  }

  .section {
    padding: 60px 20px;
  }

  .hero-title {
    font-size: 42px;
  }

  .hero-subtitle {
    font-size: 16px;
    margin-bottom: 32px;
  }

  .terminal {
    max-width: 100%;
  }

  .terminal-body {
    padding: 16px;
  }

  .terminal-body code {
    font-size: 12px;
  }

  .ip-display {
    padding: 16px 24px;
  }

  .ip-value {
    font-size: 22px;
  }

  .section-title {
    font-size: 28px;
  }

  .section-subtitle {
    font-size: 16px;
    margin-bottom: 40px;
  }

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

  .tabs-nav {
    gap: 4px;
    padding: 6px;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  .tab-pane {
    padding: 16px;
  }

  .code-block pre {
    padding: 16px;
  }

  .code-block code {
    font-size: 12px;
  }

  .footer-content {
    flex-direction: column;
    gap: 32px;
  }

  .footer-links {
    flex-direction: column;
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 36px;
  }

  .badge {
    font-size: 12px;
    padding: 6px 12px;
  }

  .tabs-nav {
    gap: 4px;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* Utility for smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection color */
::selection {
  background: var(--accent);
  color: white;
}
