/* ============================================
   MediNote Website Design System
   Modern Medical Tech + Minimal Apple Style
   ============================================ */

/* ==================== CSS Variables ==================== */
:root {
  /* Dark Mode (Default) */
  --bg-primary: #0A0F1C;
  --bg-secondary: #141B2D;
  --bg-tertiary: #1C2438;
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --accent-primary: #00D9C0;
  --accent-secondary: #1E3A5F;
  --accent-gradient: linear-gradient(135deg, #00D9C0 0%, #1E3A5F 100%);

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  --border-radius: 16px;
  --border-radius-lg: 24px;
  --border-radius-sm: 8px;

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

  --container-width: 1200px;
  --section-padding: 100px;
}

/* Light Mode */
[data-theme="light"] {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  --glass-bg: rgba(0, 0, 0, 0.02);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: var(--transition);
  overflow-x: hidden;
}

/* Chinese font fallback */
:lang(zh) {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

a:hover {
  opacity: 0.8;
}

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

/* ==================== Typography ==================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== Layout ==================== */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-padding) 0;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 968px) {

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

/* ==================== Navigation ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  background: rgba(10, 15, 28, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
}

[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.8);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-primary);
}

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

.theme-toggle,
.lang-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 8px 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--transition);
}

.theme-toggle:hover,
.lang-toggle:hover {
  background: var(--glass-border);
  color: var(--text-primary);
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition);
}

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

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(0, 217, 192, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 217, 192, 0.4);
  opacity: 1;
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-border);
  opacity: 1;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.125rem;
}

/* App Store Button */
.app-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

[data-theme="light"] .app-store-btn {
  background: #000;
  color: #fff;
}

.app-store-btn:hover {
  transform: translateY(-2px);
  opacity: 1;
}

.app-store-btn svg {
  width: 28px;
  height: 28px;
}

.app-store-btn .text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.app-store-btn .text small {
  font-size: 0.7rem;
  opacity: 0.8;
}

.app-store-btn .text strong {
  font-size: 1.1rem;
}

/* ==================== Cards ==================== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--glass-shadow);
}

.card-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.card h3 {
  margin-bottom: 12px;
}

.card p {
  margin-bottom: 0;
}

/* ==================== Hero Section ==================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 80px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 80%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 217, 192, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-content {
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

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

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.hero h1 {
  margin-bottom: 24px;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 1;
}

/* Hero Mockup Image */
.hero-mockup {
  width: 100%;
  max-width: 320px;
  /* Limit max width for phone screenshot */
  height: auto;
  border-radius: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: block;
  margin: 0 auto;
}

/* ==================== Highlight Section ==================== */
.highlight {
  position: relative;
  overflow: hidden;
}

.highlight-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
}

/* Flex children control */
.highlight-content>img,
.highlight-content>.highlight-image {
  flex: 0 0 auto;
}

.highlight-content>div,
.highlight-text {
  flex: 1;
}

/* Reverse layout: Image on right, Text on left */
.highlight-content.reverse {
  flex-direction: row-reverse;
}

/* Highlight Image */
.highlight-image {
  width: 100%;
  max-width: 320px;
  /* Limit max width for phone screenshot */
  height: auto;
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  display: block;
  margin: 0 auto;
  align-self: center;
  /* Prevent vertical stretching */
}

.highlight-text h2 {
  margin-bottom: 16px;
}

.highlight-text p {
  font-size: 1.125rem;
  margin-bottom: 24px;
}

.highlight-list {
  list-style: none;
}

.highlight-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.highlight-list li::before {
  content: '✓';
  color: var(--accent-primary);
  font-weight: bold;
}

@media (max-width: 968px) {

  .highlight-content,
  .highlight-content.reverse {
    flex-direction: column;
    text-align: center;
    gap: 48px;
  }

  .highlight-image {
    order: -1;
    /* Image always on top */
    max-width: 280px;
    margin: 0 auto;
  }
}

/* ==================== CTA Section ==================== */
.cta {
  background: var(--bg-secondary);
  text-align: center;
}

.cta-box {
  background: var(--accent-gradient);
  border-radius: var(--border-radius-lg);
  padding: 64px;
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
  pointer-events: none;
}

.cta-box h2 {
  color: white;
  margin-bottom: 16px;
}

.cta-box p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.125rem;
  margin-bottom: 32px;
}

.cta-box .app-store-btn {
  background: white;
  color: var(--accent-secondary);
}

/* ==================== Footer ==================== */
.footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--glass-border);
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  margin-top: 16px;
  max-width: 300px;
}

.footer-links h4 {
  color: var(--text-primary);
  margin-bottom: 16px;
  font-size: 1rem;
}

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

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 32px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-social {
  display: flex;
  gap: 16px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--accent-primary);
  color: white;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: span 2;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-brand {
    grid-column: span 1;
  }
}

/* ==================== FAQ Section ==================== */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: none;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.faq-question:hover {
  color: var(--accent-primary);
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  transition: var(--transition);
}

.faq-item.active .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer p {
  padding: 0 24px 20px;
}

/* ==================== Legal Pages ==================== */
.legal-page {
  padding-top: 120px;
  min-height: 100vh;
}

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

.legal-content h1 {
  margin-bottom: 16px;
}

.legal-content .updated {
  color: var(--text-muted);
  margin-bottom: 48px;
}

.legal-content h2 {
  font-size: 1.5rem;
  margin-top: 48px;
  margin-bottom: 16px;
}

.legal-content h3 {
  font-size: 1.125rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-content p,
.legal-content li {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
  padding-left: 24px;
  margin-bottom: 24px;
}

.legal-content li {
  margin-bottom: 8px;
}

/* ==================== Download Page ==================== */
.download-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

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

.download-icon {
  width: 120px;
  height: 120px;
  background: var(--accent-gradient);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 32px;
  box-shadow: 0 20px 40px rgba(0, 217, 192, 0.3);
}

.download-content h1 {
  margin-bottom: 16px;
}

.download-content p {
  font-size: 1.125rem;
  margin-bottom: 32px;
}

.download-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.system-requirements {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: left;
}

.system-requirements h3 {
  margin-bottom: 16px;
}

.system-requirements ul {
  list-style: none;
}

.system-requirements li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.system-requirements li::before {
  content: '•';
  color: var(--accent-primary);
}

/* ==================== Animations ==================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation for grids */
.grid .fade-in:nth-child(1) {
  transition-delay: 0s;
}

.grid .fade-in:nth-child(2) {
  transition-delay: 0.1s;
}

.grid .fade-in:nth-child(3) {
  transition-delay: 0.2s;
}

.grid .fade-in:nth-child(4) {
  transition-delay: 0.3s;
}

.grid .fade-in:nth-child(5) {
  transition-delay: 0.4s;
}

.grid .fade-in:nth-child(6) {
  transition-delay: 0.5s;
}

/* ==================== Utilities ==================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 8px !important;
}

.mb-2 {
  margin-bottom: 16px !important;
}

.mb-3 {
  margin-bottom: 24px !important;
}

.mb-4 {
  margin-bottom: 32px !important;
}