/* Reset & Base */
* {
  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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  min-height: 100vh;
  line-height: 1.6;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.logo span {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

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

.nav a {
  text-decoration: none;
  color: #4b5563;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: #6366f1;
}

.nav-cta {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white !important;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  color: white !important;
}

/* Hero */
.hero {
  padding: 140px 24px 60px;
  text-align: center;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 500px;
  margin: 0 auto;
}

.hero-subtitle strong {
  color: white;
}

/* Detector Section */
.detector-section {
  padding: 0 24px 60px;
}

.detector-container {
  max-width: 700px;
  margin: 0 auto;
}

/* Views */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* Input Card */
.input-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.input-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.input-header svg {
  width: 18px;
  height: 18px;
  color: #6366f1;
}

.input-header span {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.7;
  resize: vertical;
  min-height: 250px;
  transition: all 0.2s ease;
  background: #fafafa;
  font-family: inherit;
}

textarea::placeholder {
  color: #9ca3af;
}

textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Character Info */
.char-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  padding: 12px 0 0;
  margin-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

#char-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #374151;
}

.char-hint {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}

.char-hint.hint-default {
  color: #6b7280;
  background: #f3f4f6;
}

.char-hint.hint-error {
  color: #dc2626;
  background: #fef2f2;
}

.char-hint.hint-warning {
  color: #d97706;
  background: #fffbeb;
}

.char-hint.hint-success {
  color: #059669;
  background: #ecfdf5;
}

/* Validation Message */
.validation-message {
  font-size: 14px;
  color: #dc2626;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-radius: 12px;
  display: none;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(220, 38, 38, 0.1);
  margin-bottom: 16px;
}

.validation-message::before {
  content: "!";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #dc2626;
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.validation-message.visible {
  display: flex;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    0 4px 14px rgba(99, 102, 241, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary svg {
  width: 20px;
  height: 20px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 20px rgba(99, 102, 241, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  width: 100%;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.95);
  color: #6366f1;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-secondary svg {
  width: 20px;
  height: 20px;
}

.btn-secondary:hover {
  background: white;
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Loading View */
.loading-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.loader-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 30px;
}

.loader {
  position: absolute;
  inset: 0;
  border: 4px solid #e5e7eb;
  border-radius: 50%;
}

.loader::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 4px solid transparent;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader::after {
  content: '';
  position: absolute;
  inset: 10px;
  border: 4px solid transparent;
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite reverse;
}

.loader-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-icon svg {
  width: 36px;
  height: 36px;
  color: #6366f1;
  animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

#loading-view p {
  color: #374151;
  font-size: 17px;
  font-weight: 500;
}

#loading-view .loading-hint {
  color: #9ca3af;
  font-size: 14px;
  margin-top: 8px;
  font-weight: 400;
}

/* Score Card */
.score-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
}

.score-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.score-header svg {
  width: 20px;
  height: 20px;
  color: #6b7280;
}

.score-label {
  font-size: 13px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.score-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 20px;
}

.score-value {
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -3px;
  line-height: 1;
}

.score-percent {
  font-size: 28px;
  font-weight: 600;
  color: #9ca3af;
}

.score-value.low { color: #059669; }
.score-value.medium { color: #d97706; }
.score-value.high { color: #dc2626; }

.score-verdict {
  font-size: 15px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 24px;
  display: inline-block;
  margin-bottom: 20px;
}

.score-verdict.low {
  color: #059669;
  background: #ecfdf5;
}

.score-verdict.medium {
  color: #d97706;
  background: #fffbeb;
}

.score-verdict.high {
  color: #dc2626;
  background: #fef2f2;
}

.score-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-fill.low { background: linear-gradient(90deg, #22c55e, #4ade80); }
.score-fill.medium { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.score-fill.high { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Result Card */
.result-section {
  margin-bottom: 16px;
}

.result-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.result-header svg {
  width: 18px;
  height: 18px;
  color: #6366f1;
}

.result-header span {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.result-legend {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-dot.high { background: rgba(239, 68, 68, 0.3); border-bottom: 2px solid #ef4444; }
.legend-dot.medium { background: rgba(245, 158, 11, 0.3); border-bottom: 2px solid #f59e0b; }

.analyzed-text {
  font-size: 15px;
  line-height: 1.8;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.analyzed-text::-webkit-scrollbar {
  width: 6px;
}

.analyzed-text::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.analyzed-text::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.sentence {
  display: inline;
  transition: background 0.2s;
}

.sentence.suspicious {
  background: rgba(239, 68, 68, 0.15);
  border-bottom: 2px solid #ef4444;
  padding: 2px 0;
  border-radius: 2px;
}

.sentence.suspicious.medium {
  background: rgba(245, 158, 11, 0.15);
  border-bottom-color: #f59e0b;
}

/* Error Card */
.error-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.error-icon-container {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-icon-container svg {
  width: 36px;
  height: 36px;
  color: #dc2626;
}

.error-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

#error-text {
  color: #6b7280;
  font-size: 15px;
  margin-bottom: 24px;
}

/* Features Section */
.features-section {
  background: rgba(255, 255, 255, 0.05);
  padding: 80px 24px;
}

.features-section h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin-bottom: 48px;
}

.features-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
  color: white;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

/* Extension Section */
.extension-section {
  padding: 80px 24px;
}

.extension-card {
  max-width: 1000px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.extension-badge {
  display: inline-block;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}

.extension-content h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 12px;
}

.extension-content > p {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 24px;
}

.extension-features {
  list-style: none;
  margin-bottom: 32px;
}

.extension-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
  color: #374151;
}

.extension-features svg {
  width: 20px;
  height: 20px;
  color: #22c55e;
  flex-shrink: 0;
}

.btn-chrome {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #1f2937;
  color: white;
  padding: 16px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-chrome svg {
  width: 22px;
  height: 22px;
}

.btn-chrome:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

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

.extension-preview img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* FAQ Section */
.faq-section {
  background: rgba(255, 255, 255, 0.05);
  padding: 80px 24px;
}

.faq-section h2 {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  color: white;
  margin-bottom: 48px;
}

.faq-grid {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.faq-item summary {
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 24px;
  color: #6366f1;
  font-weight: 300;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 24px 20px;
  font-size: 15px;
  color: #6b7280;
  line-height: 1.7;
}

/* Hidden SEO Accordion */
.seo-accordion {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.seo-accordion summary {
  display: none;
}

.seo-content {
  display: block;
}

.seo-content h2,
.seo-content h3 {
  margin: 16px 0 8px;
}

.seo-content p,
.seo-content ul {
  margin: 8px 0;
}

.seo-content ul {
  padding-left: 20px;
}

/* Footer */
.footer {
  background: rgba(0, 0, 0, 0.2);
  padding: 60px 24px 24px;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .logo {
  margin-bottom: 16px;
}

.footer-brand .logo span {
  color: white;
}

.footer-brand .logo-icon {
  background: rgba(255, 255, 255, 0.2);
}

.footer-brand p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  max-width: 300px;
}

.footer-links h4 {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  max-width: 1000px;
  margin: 0 auto;
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    padding: 12px 16px;
  }

  .nav {
    gap: 16px;
  }

  .nav a:not(.nav-cta) {
    display: none;
  }

  .hero {
    padding: 120px 16px 40px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .detector-section {
    padding: 0 16px 40px;
  }

  .extension-card {
    grid-template-columns: 1fr;
    padding: 32px;
  }

  .extension-preview {
    order: -1;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .score-value {
    font-size: 56px;
  }
}
