@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --secondary: #7c3aed;
  --secondary-dark: #5b21b6;
  --accent: #06b6d4;
  --bg-dark: #0f172a;
  --bg-light: #f8fafc;
  --card: #ffffff;
  --card-dark: #1e293b;
  --text: #0f172a;
  --text-light: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
  --shadow-lg: 0 20px 40px rgba(37, 99, 235, 0.2);
  --glass: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-light);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 40% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
  animation: gradientMove 20s ease infinite;
  z-index: -1;
}

@keyframes gradientMove {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(5%, 5%) rotate(120deg); }
  66% { transform: translate(-5%, 5%) rotate(240deg); }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Navigation */
.nav {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 900;
  font-size: 24px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand::before {
  content: '⚡';
  font-size: 28px;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.3));
}

.nav-link {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero-title {
  font-size: 56px;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
  margin-bottom: 16px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto 40px;
  font-weight: 500;
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.panel-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(124, 58, 237, 0.03) 100%);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.upload-area:hover {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  transform: translateY(-2px);
}

.upload-area.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.upload-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 14px;
  color: var(--text-muted);
}

input[type="file"] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-icon {
  font-size: 24px;
  float: right;
  opacity: 0.3;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

/* Input Fields */
input[type="email"],
textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: var(--card);
}

input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

/* Summary Display */
.summary-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.summary-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.summary-list li {
  padding: 16px 20px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  line-height: 1.7;
  color: var(--text-light);
  animation: fadeInLeft 0.5s ease forwards;
  opacity: 0;
  transition: all 0.3s ease;
}

.summary-list li:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.summary-list li:nth-child(1) { animation-delay: 0.1s; }
.summary-list li:nth-child(2) { animation-delay: 0.2s; }
.summary-list li:nth-child(3) { animation-delay: 0.3s; }
.summary-list li:nth-child(4) { animation-delay: 0.4s; }
.summary-list li:nth-child(5) { animation-delay: 0.5s; }
.summary-list li:nth-child(6) { animation-delay: 0.6s; }
.summary-list li:nth-child(7) { animation-delay: 0.7s; }
.summary-list li:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-light);
  color: #065f46;
}

.badge-warning {
  background: var(--warning-light);
  color: #92400e;
}

.badge-info {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-primary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
  color: var(--primary);
  border: 1px solid var(--primary-light);
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 10px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-error {
  background: var(--danger-light);
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.alert-success {
  background: var(--success-light);
  color: #065f46;
  border-left: 4px solid var(--success);
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* History Items */
.history-item {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  background: var(--card);
}

.history-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

/* Share Box */
.share-box {
  padding: 16px;
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--primary);
  word-break: break-all;
  transition: all 0.3s ease;
  cursor: pointer;
}

.share-box:hover {
  background: var(--primary);
  color: white;
}

/* Info Box */
.info-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
  border: 1px solid var(--primary-light);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.info-box-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 36px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  .container {
    padding: 16px;
  }
  
  .dashboard-panel {
    padding: 20px;
  }
  
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* Keyword Tags */
.keyword-tag {
  display: inline-block;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
  border: 1px solid var(--primary-light);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  transition: all 0.3s ease;
}

.keyword-tag:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Processing Console */
.processing-console {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.console-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-light);
  border-radius: 8px;
  border-left: 3px solid var(--border);
  transition: all 0.3s ease;
}

.console-step.completed {
  border-left-color: var(--success);
}

.console-step.processing {
  border-left-color: var(--primary);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.step-icon {
  width: 32px;
  height: 32px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.console-step.processing .step-icon {
  background: var(--primary);
  animation: spin 2s linear infinite;
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-muted);
}


/* Status Card Variants */
.stat-card-success {
  border-left: 4px solid var(--success);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.stat-card-warning {
  border-left: 4px solid var(--warning);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.stat-card-danger {
  border-left: 4px solid var(--danger);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
}

/* Status Page Styles */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.status-panel {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.status-panel h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.status-item:last-child {
  border-bottom: none;
}

.status-label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 14px;
}

.status-value {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.status-badge-success {
  background: var(--success-light);
  color: var(--success);
}

.status-badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.status-badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.status-details {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--text-light);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}


/* AEO Score Styles */
.score-meter {
  position: relative;
  width: 100%;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.score-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 6px;
  transition: width 1.5s ease-out;
}

.score-excellent {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.score-good {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.score-fair {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.score-poor {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Score animation */
@keyframes scoreReveal {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.score-card {
  animation: scoreReveal 0.5s ease-out;
}

/* ===================== */
/* Billing & Plan Styles */
/* ===================== */

.billing-toggle {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.toggle-btn {
  padding: 10px 28px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
}

.plan-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.plan-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.plan-featured {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.plan-current {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(16, 185, 129, 0.08) 100%);
}

.plan-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-light);
  color: var(--text-muted);
  margin-bottom: 16px;
}

.plan-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

.plan-price {
  margin-bottom: 8px;
}

.price-amount {
  font-size: 40px;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-interval {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

.plan-yearly-note {
  font-size: 13px;
  color: var(--text-muted);
  min-height: 20px;
  margin-bottom: 20px;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
  flex: 1;
}

.plan-features li {
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}

.plan-features li:last-child {
  border-bottom: none;
}

.plan-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  margin-top: auto;
}

.plan-form {
  margin-top: auto;
}

.plan-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  background: var(--gradient-primary);
  color: white;
  white-space: nowrap;
}
