/**
 * JEnv Landing Page - Styles
 */

/* ============================================
   CSS Reset & Base Styles
   ============================================ */

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

:root {
  /* Colors */
  --primary: #0EA5E9;
  --primary-dark: #0284C7;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;

  /* Background */
  --bg-dark: #1F2937;
  --bg-dark-2: #374151;
  --bg-dark-3: #4B5563;

  /* Text */
  --text-light: #F9FAFB;
  --text-light-2: #D1D5DB;
  --text-light-3: #9CA3AF;

  /* UI */
  --radius: 0.75rem;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);

  /* Font */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", "Monaco", monospace;

  /* Transitions */
  --transition: 0.2s ease;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--text-light);
  background: var(--bg-dark);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.navbar {
  background: var(--bg-dark-2);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bg-dark-3);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-light);
}

.logo-img {
  height: 2rem;
  width: auto;
  display: block;
}

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

.lang-btn,
.github-link {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition);
}

.lang-btn:hover,
.github-link:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

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

.hero {
  padding: 3rem 0 1.5rem;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.5s ease 0.1s both;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-light-2);
  max-width: 700px;
  margin: 0 auto;
  animation: fadeInUp 0.5s ease 0.2s both;
  line-height: 1.6;
}

/* Typing Effect */
.typing-container {
  padding: 1.5rem 0 1rem;
  text-align: center;
  min-height: 50px;
}

.typing-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary);
  font-family: var(--font-mono);
  animation: fadeInUp 0.5s ease 0.3s both;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.125rem;
  background: var(--primary);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* ============================================
   Quick Start Section
   ============================================ */

.quick-start {
  padding: 2rem 0 4rem;
}

.section-title {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--text-light);
  font-weight: 700;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 2px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.step-card {
  background: var(--bg-dark-2);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid transparent;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14, 165, 233, 0.3);
}

.step-card.full-width {
  grid-column: 1 / -1;
  height: auto;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

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

.step-desc {
  color: var(--text-light-2);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.step-desc span {
  color: var(--text-light-3);
}

.step-desc #jenv-version {
  color: var(--primary);
  font-weight: 600;
}

/* Selector Group */
.selector-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.selector-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.selector-item label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light-2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.detected-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detected-badge::before {
  content: "✓";
  font-weight: 700;
  font-size: 0.875rem;
}

/* Dropdown Styles */
.dropdown {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  color: var(--text-light);
  background: var(--bg-dark);
  border: 2px solid var(--bg-dark-3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D1D5DB' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.dropdown:hover {
  border-color: var(--primary);
  background-color: rgba(14, 165, 233, 0.08);
}

.dropdown:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  background-color: rgba(14, 165, 233, 0.05);
}

.dropdown option {
  background: var(--bg-dark-2);
  color: var(--text-light);
  padding: 0.75rem;
}

/* Legacy selector classes (keep for compatibility) */
.distribution-selector,
.version-selector {
  margin: 1rem 0;
}

.distribution-selector label,
.version-selector label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-light-2);
  font-size: 0.875rem;
}

.dist-dropdown,
.version-dropdown {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-dark);
  color: var(--text-light);
  border: 1px solid var(--bg-dark-3);
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color var(--transition);
}

.dist-dropdown:focus,
.version-dropdown:focus {
  outline: none;
  border-color: var(--primary);
}

.download-btn {
  width: 100%;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
  position: relative;
  overflow: hidden;
}

.download-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.download-btn:hover:not(:disabled)::before {
  left: 100%;
}

.download-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.download-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.download-btn:disabled {
  background: var(--bg-dark-3);
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.btn-icon {
  font-size: 1.25rem;
}

.file-size,
.hint {
  margin-top: 0.875rem;
  color: var(--text-light-3);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.hint {
  font-style: italic;
  padding: 0.5rem 0.75rem;
  background: rgba(14, 165, 233, 0.08);
  border-left: 3px solid var(--primary);
  border-radius: 0 0.375rem 0.375rem 0;
}

.code-block {
  position: relative;
  background: var(--bg-dark);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border: 1px solid var(--bg-dark-3);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.code-block pre {
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-light-2);
}

.code-block code {
  display: block;
}

.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.copy-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

/* ============================================
   Features Section
   ============================================ */

.features {
  padding: 4rem 0;
  background: linear-gradient(180deg, var(--bg-dark-2), var(--bg-dark));
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--bg-dark-2);
  border-radius: var(--radius);
  transition: all var(--transition);
  border: 1px solid transparent;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14, 165, 233, 0.2);
  background: var(--bg-dark);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1.25rem;
  display: inline-block;
  transition: transform var(--transition);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
}

.feature-card p {
  color: var(--text-light-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* ============================================
   FAQ Section
   ============================================ */

.faq {
  padding: 4rem 0;
  background: var(--bg-dark);
}

.accordion {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-dark-2);
  margin-bottom: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--bg-dark-3);
  transition: all var(--transition);
}

.faq-item:hover {
  border-color: rgba(14, 165, 233, 0.3);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.0625rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition);
}

.faq-question:hover {
  background: var(--bg-dark-3);
  color: var(--primary);
}

.faq-question .arrow {
  transition: transform 0.3s ease;
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 700;
}

.faq-item.open .arrow {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.5rem;
  color: var(--text-light-2);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 1.5rem 1.5rem;
}

.faq-answer ul {
  list-style-position: inside;
  margin: 0.75rem 0;
}

.faq-answer li {
  margin: 0.5rem 0;
  padding-left: 0.5rem;
}

.faq-answer p {
  margin: 0.75rem 0;
}

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

.footer {
  padding: 3rem 0;
  text-align: center;
  background: var(--bg-dark-2);
  color: var(--text-light-2);
  border-top: 1px solid var(--bg-dark-3);
}

.footer p {
  margin: 0.5rem 0;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.last-updated {
  font-size: 0.875rem;
  color: var(--text-light-3);
  margin-top: 1rem;
}

/* ============================================
   Toast Notification
   ============================================ */

.toast {
  position: fixed;
  top: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transform: translateX(400px);
  transition: transform var(--transition);
  z-index: 1000;
  max-width: 300px;
}

.toast.show {
  transform: translateX(0);
}

.toast.toast-success {
  background: var(--success);
  color: white;
}

.toast.toast-error {
  background: var(--error);
  color: white;
}

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

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(31, 41, 55, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-dark-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-overlay p {
  margin-top: 1rem;
  color: var(--text-light-2);
}

/* ============================================
   Mobile View
   ============================================ */

.mobile-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
}

.mobile-icon {
  font-size: 5rem;
  margin-bottom: 2rem;
}

.mobile-message h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.mobile-message p {
  color: var(--text-light-2);
  margin-bottom: 2rem;
  max-width: 400px;
}

.mobile-btn {
  padding: 1rem 2rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all var(--transition);
}

.mobile-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

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

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

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

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

@media (max-width: 768px) {
  .hero {
    padding: 2rem 0 1rem;
  }

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

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

  .typing-text {
    font-size: 0.9375rem;
  }

  .typing-container {
    min-height: 40px;
    padding: 1rem 0 0.5rem;
  }

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

  .steps {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .step-card {
    min-height: auto;
  }

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

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

  .copy-btn {
    position: static;
    width: 100%;
    margin-top: 1rem;
  }

  .toast {
    right: 1rem;
    left: 1rem;
    max-width: none;
  }

  .nav-brand {
    font-size: 1.25rem;
  }

  .logo-img {
    height: 1.5rem;
  }

  .navbar .container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero {
    padding: 1.5rem 0 0.5rem;
  }

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

  .quick-start,
  .features,
  .faq {
    padding: 2rem 0;
  }

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

  .step-card {
    padding: 1.5rem;
  }

  .step-number {
    width: 2rem;
    height: 2rem;
    font-size: 1.125rem;
  }

  .step-card h3 {
    font-size: 1.25rem;
  }

  .download-btn {
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .navbar,
  .toast,
  .loading-overlay {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }
}
