/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--white);
}

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

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}

.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"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--white);
  padding: 40px 0;
}

.hero-title {
  font-size: 5rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -2px;
  animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
  font-size: 1.8rem;
  margin-bottom: 20px;
  opacity: 0.95;
  font-weight: 300;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-description {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 40px;
  opacity: 0.9;
  line-height: 1.8;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.download-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  color: var(--primary-color);
  padding: 18px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 50px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.download-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
  background: #f8f9ff;
}

.download-button:active {
  transform: translateY(-1px);
}

.download-icon {
  transition: transform 0.3s ease;
}

.download-button:hover .download-icon {
  transform: translateY(3px);
}

.system-requirements {
  margin-top: 20px;
  font-size: 0.9rem;
  opacity: 0.8;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

/* Features Section */
.features {
  padding: 100px 0;
  background: var(--bg-light);
}

.section-title {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 60px;
  color: var(--text-dark);
  font-weight: 700;
}

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

.feature-card {
  background: var(--white);
  padding: 40px 30px;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-dark);
  font-weight: 600;
}

.feature-card p {
  color: var(--text-light);
  line-height: 1.7;
}

/* Demo Section */
.demo-section {
  padding: 100px 0;
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  overflow: hidden;
  position: relative;
}

.demo-subtitle {
  text-align: center;
  color: #94a3b8;
  font-size: 1.1rem;
  margin-top: -40px;
  margin-bottom: 20px;
}

.mockup-badge {
  text-align: center;
  color: #60a5fa;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 40px;
  letter-spacing: 0.5px;
  background: rgba(59, 130, 246, 0.1);
  border: 2px dashed #3b82f6;
  border-radius: 8px;
  padding: 12px 24px;
  display: inline-block;
  margin-left: 50%;
  transform: translateX(-50%);
}

.demo-section .section-title {
  color: var(--white);
}

.app-mockup {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

/* Animated Cursor */
.animated-cursor {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              top 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.animated-cursor.visible {
  opacity: 1;
}

.window-frame {
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(59, 130, 246, 0.2);
  border: 2px solid rgba(59, 130, 246, 0.3);
}

.window-titlebar {
  background: #0f172a;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #334155;
}

.window-controls {
  display: flex;
  gap: 8px;
}

.window-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.window-button.close {
  background: #ef4444;
}

.window-button.minimize {
  background: #f59e0b;
}

.window-button.maximize {
  background: #10b981;
}

.window-title {
  color: #cbd5e1;
  font-size: 0.9rem;
  flex: 1;
  text-align: center;
  margin-right: 60px;
}

.app-content {
  display: flex;
  height: 600px;
  position: relative;
}

.sidebar {
  width: 220px;
  background: #0f172a;
  border-right: 1px solid #334155;
  padding: 20px 0;
}

.sidebar-header {
  padding: 0 16px;
  margin-bottom: 16px;
  color: #e2e8f0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.sidebar-items {
  display: flex;
  flex-direction: column;
}

.sidebar-item {
  padding: 8px 16px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.sidebar-item:hover {
  background: #1e293b;
  color: #e2e8f0;
}

.sidebar-item.active {
  background: #1e293b;
  color: #e2e8f0;
  border-left: 3px solid #3b82f6;
}

.folder-icon {
  font-size: 1rem;
}

.main-content {
  flex: 1;
  background: #1e293b;
  overflow: hidden;
}

.papers-list {
  padding: 20px;
}

.list-header {
  padding: 8px 12px;
  border-bottom: 1px solid #334155;
  margin-bottom: 12px;
}

.column-title {
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.paper-item {
  padding: 12px;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.paper-item:hover {
  background: #334155;
}

.paper-item.highlighted {
  background: rgba(59, 130, 246, 0.2);
  border: 2px solid #3b82f6;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.paper-icon {
  font-size: 1rem;
  opacity: 0.7;
}

.paper-title {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Synthesize Window */
.synthesize-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 90%;
  max-width: 900px;
  height: 520px;
  background: #0f172a;
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 3px rgba(16, 185, 129, 0.3);
  border: 2px solid rgba(16, 185, 129, 0.4);
  display: flex;
  flex-direction: column;
  opacity: 0;
}

.synthesize-window.visible {
  animation: popIn 0.5s ease-out forwards;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  70% {
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -45%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.synthesize-header {
  padding: 16px 20px;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.synthesize-header h3 {
  color: #e2e8f0;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #1e293b;
  color: #e2e8f0;
}

.synthesize-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.welcome-message {
  text-align: center;
  color: #cbd5e1;
}

.welcome-message h4 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: #e2e8f0;
}

.context-info {
  color: #64748b;
  font-size: 0.9rem;
}

.token-count {
  color: #3b82f6;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overscroll-behavior: contain;
}

.message {
  animation: messageIn 0.3s ease-out;
}

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

.user-message {
  background: #1e293b;
  padding: 12px 16px;
  border-radius: 12px;
  color: #e2e8f0;
  align-self: flex-end;
  max-width: 80%;
  border: 1px solid #334155;
}

.assistant-message {
  background: #0c1220;
  padding: 16px;
  border-radius: 12px;
  color: #cbd5e1;
  border: 1px solid #1e293b;
  line-height: 1.6;
}

.assistant-message strong {
  color: #e2e8f0;
}

.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 16px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.paper-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1e293b;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #3b82f6;
  border: 1px solid #334155;
  margin: 4px;
}

.papers-selected {
  display: flex;
  flex-wrap: wrap;
  margin-top: 8px;
}

.autocomplete-menu {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  margin-top: 8px;
  overflow: hidden;
}

.autocomplete-item {
  padding: 12px 16px;
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid #334155;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: #334155;
}

.autocomplete-item strong {
  color: #3b82f6;
  font-weight: 600;
}

.autocomplete-item small {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 2px;
}

.command-hint {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #3b82f6;
}

.diff-view {
  background: #0c1220;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
}

.diff-header {
  color: #cbd5e1;
  margin-bottom: 12px;
  font-weight: 500;
}

.diff-line {
  padding: 4px 8px;
  border-radius: 4px;
  margin: 2px 0;
}

.diff-line.removed {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.diff-line.added {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}

.synthesize-input {
  padding: 16px 20px;
  border-top: 1px solid #334155;
  display: flex;
  gap: 12px;
  align-items: center;
}

.synthesize-input input {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 12px 16px;
  color: #e2e8f0;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.synthesize-input input:focus {
  border-color: #3b82f6;
  background: #0f172a;
}

.synthesize-input input::placeholder {
  color: #64748b;
}

.send-btn {
  background: #3b82f6;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.send-btn:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

/* Approval Screen */
.approval-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #0f172a;
  display: none;
  flex-direction: column;
  z-index: 10;
}

.approval-screen.active {
  display: flex;
}

.approval-header {
  padding: 20px 24px;
  border-bottom: 1px solid #334155;
}

.approval-header h3 {
  color: #e2e8f0;
  font-size: 1.2rem;
  margin: 0;
}

.approval-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.change-title {
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.approval-actions {
  padding: 16px 24px;
  border-top: 1px solid #334155;
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.approval-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.approval-btn.accept {
  background: #3b82f6;
  color: white;
}

.approval-btn.accept:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

.approval-btn.reject {
  background: #ef4444;
  color: white;
}

.approval-btn.reject:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.follow-up-input {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 16px;
  color: #e2e8f0;
  font-size: 0.9rem;
  outline: none;
}

.follow-up-input::placeholder {
  color: #64748b;
}

/* Annotation Labels */
.annotation {
  position: absolute;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  white-space: nowrap;
}

.annotation.visible {
  animation: fadeInLabel 0.4s ease-out forwards;
}

.annotation::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

.annotation.top::after {
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-color: #8b5cf6 transparent transparent transparent;
}

.annotation.left::after {
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 8px;
  border-color: transparent transparent transparent #8b5cf6;
}

@keyframes fadeInLabel {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.footer {
  background: var(--text-dark);
  color: var(--white);
  text-align: center;
  padding: 40px 0;
}

.footer p {
  opacity: 0.8;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }

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

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

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

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

  .features {
    padding: 60px 0;
  }

  .demo-section {
    padding: 60px 0;
    overscroll-behavior: none;
  }

  .sidebar {
    display: none;
  }

  .app-content {
    height: 500px;
    overscroll-behavior: contain;
  }

  .synthesize-window {
    width: 95%;
    height: 450px;
  }

  .assistant-message {
    font-size: 0.85rem;
  }

  .paper-title {
    font-size: 0.85rem;
  }

  /* Prevent page scrolling issues on mobile */
  .app-mockup {
    overscroll-behavior: none;
    isolation: isolate;
  }
}

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

  .download-button {
    padding: 15px 30px;
    font-size: 1rem;
  }

  .app-content {
    height: 400px;
  }

  .synthesize-window {
    height: 350px;
  }

  .demo-subtitle {
    font-size: 0.95rem;
  }
}
