/* Passwordless Auth - Professional Wiki Styles */

:root {
  --primary-color: #0066cc;
  --primary-dark: #004999;
  --primary-light: #3399ff;
  --secondary-color: #6c757d;
  --accent-color: #ff6b35;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;

  --bg-color: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-color: #212529;
  --text-secondary: #6c757d;
  --text-light: #adb5bd;

  --border-color: #dee2e6;
  --border-radius: 8px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);

  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-tertiary: #3a3a3a;
  --text-color: #e9ecef;
  --text-secondary: #adb5bd;
  --text-light: #6c757d;
  --border-color: #495057;
  --primary-color: #4d9fff;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

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

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  padding-top: 70px;
}

/* Header & Navigation */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  position: relative;
  min-height: 60px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: absolute;
  right: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  position: absolute;
  left: 2rem;
}

.logo-icon {
  font-size: 1.8rem;
}

.nav-menu {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 0.95rem;
  position: relative;
}

.nav-link:hover {
  background: var(--bg-secondary);
  color: var(--primary-color);
}

.nav-link.active {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
}

.theme-toggle {
  background: var(--bg-secondary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

/* Progress Bar */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--accent-color));
  z-index: 1001;
  transition: none;
  box-shadow: 0 0 10px rgba(0, 102, 204, 0.5);
  will-change: width;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: -70px;
  padding-top: calc(4rem + 70px);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  word-wrap: break-word;
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.badge {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

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

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

.btn-secondary {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid white;
}

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

/* Main Content */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
  width: 100%;
  overflow-x: hidden;
}

.section {
  margin-bottom: 5rem;
  overflow-x: hidden;
  width: 100%;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--primary-color);
  position: relative;
  padding-bottom: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Architecture Diagrams */
.diagram-container {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  overflow-x: auto;
  max-width: 100%;
}

.mermaid {
  display: flex;
  justify-content: center;
  min-height: 400px;
  max-width: 100%;
  overflow-x: auto;
}

/* Code Blocks */
.code-section {
  margin: 2rem 0;
}

.code-header {
  background: var(--bg-tertiary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-color);
  border-bottom: none;
}

.code-label {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.copy-btn {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
  color: var(--text-color);
}

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

pre {
  background: var(--bg-tertiary);
  padding: 1.5rem;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  overflow-x: auto;
  border: 1px solid var(--border-color);
  margin: 0;
  max-width: 100%;
  word-wrap: break-word;
  white-space: pre-wrap;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.inline-code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent-color);
}

/* Parameter Lists */
.param-list {
  margin-left: 2rem;
  margin-top: 0.5rem;
}

.param-list li {
  margin-bottom: 0.5rem;
}

/* API Documentation */
.api-endpoint {
  background: var(--bg-secondary);
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  word-wrap: break-word;
}

.api-method {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

.method-post { background: var(--success-color); color: white; }
.method-get { background: var(--info-color); color: white; }
.method-put { background: var(--warning-color); color: black; }
.method-delete { background: var(--danger-color); color: white; }

.api-path {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-color);
  word-break: break-all;
}

/* Flow Cards */
.flow-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.flow-card {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  overflow: hidden;
}

.flow-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.flow-number {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Table */
.table-container {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  table-layout: fixed;
}

thead {
  background: var(--bg-tertiary);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

th {
  font-weight: 600;
  color: var(--primary-color);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-color);
}

/* Info Boxes */
.info-box {
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin: 2rem 0;
  border-left: 4px solid;
  overflow: hidden;
  word-wrap: break-word;
}

.info-box.info {
  background: rgba(23, 162, 184, 0.1);
  border-color: var(--info-color);
}

.info-box.warning {
  background: rgba(255, 193, 7, 0.1);
  border-color: var(--warning-color);
}

.info-box.success {
  background: rgba(40, 167, 69, 0.1);
  border-color: var(--success-color);
}

.info-box.danger {
  background: rgba(220, 53, 69, 0.1);
  border-color: var(--danger-color);
}

.info-box-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.4rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid var(--bg-color);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-color);
  margin-top: 5rem;
  overflow-x: hidden;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.footer-section h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

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

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  word-break: break-word;
}

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

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1002;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  border-radius: 2px;
  transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .menu-toggle {
    display: flex;
  }

  .nav-actions {
    position: relative;
    z-index: 1002;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 280px;
    background: var(--bg-color);
    flex-direction: column;
    gap: 0;
    padding: 5rem 0 2rem;
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 1rem 2rem;
    border-radius: 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-link.active::after {
    bottom: 0;
    left: 0;
    right: auto;
    width: 4px;
    height: 100%;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }

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

  .cta-buttons {
    flex-direction: column;
  }

  .section-title {
    font-size: 2rem;
  }

  .nav-container {
    padding: 0.5rem 1rem;
    justify-content: space-between;
  }

  .logo {
    font-size: 1.1rem;
    position: static;
    left: auto;
  }

  .logo-icon {
    font-size: 1.3rem;
  }

  .nav-actions {
    position: static;
    right: auto;
  }

  .container {
    padding: 2rem 1rem;
  }

  .diagram-container {
    padding: 1rem;
  }

  .flow-cards {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  body {
    padding-top: 60px;
  }

  .hero {
    margin-top: -60px;
    padding-top: calc(3rem + 60px);
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 3rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .badges {
    font-size: 0.8rem;
  }

  .badge {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }

  .feature-card, .flow-card {
    padding: 1.5rem;
  }

  .api-endpoint {
    padding: 1rem;
  }

  .code-section pre {
    padding: 1rem;
    font-size: 0.85rem;
  }

  .table-container {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }

  .btn {
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 60px;
  }

  .hero {
    margin-top: -60px;
    padding-top: calc(2.5rem + 60px);
    padding-bottom: 2.5rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .logo {
    font-size: 1rem;
  }

  .logo-icon {
    font-size: 1.2rem;
  }

  .container {
    padding: 1.5rem 0.75rem;
  }

  .feature-icon {
    font-size: 2rem;
  }

  .code-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .copy-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }

  .api-method {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
  }

  .nav-menu {
    width: 100%;
    right: -100%;
  }

  .cta-buttons {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

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

/* Loading Animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

.link {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
  word-break: break-word;
}

.link:hover {
  text-decoration: underline;
}

/* Ensure all links break properly */
a {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Ensure all text content breaks properly */
p, li, span, div {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Prevent horizontal overflow */
.hero, .container, .section, .footer {
  max-width: 100%;
  overflow-x: hidden;
}
