@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(17, 24, 39, 0.9);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --accent-cyan: #00f5d4;
  --accent-purple: #7b2ff7;
  --accent-pink: #f72585;
  --accent-blue: #4361ee;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow-glow: 0 0 30px rgba(0, 245, 212, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-animation {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-animation .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: floatOrb 20s ease-in-out infinite;
}

.bg-animation .orb:nth-child(1) {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent-purple), transparent 70%);
  top: -10%; left: -5%;
  animation-duration: 25s;
}

.bg-animation .orb:nth-child(2) {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
  bottom: -10%; right: -5%;
  animation-duration: 20s;
  animation-delay: -5s;
}

.bg-animation .orb:nth-child(3) {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--accent-pink), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 30s;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -80px) scale(1.1); }
  50% { transform: translate(-30px, 60px) scale(0.9); }
  75% { transform: translate(60px, 30px) scale(1.05); }
}

/* ===== PARTICLES ===== */
.particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px; height: 3px;
  background: var(--accent-cyan);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s ease-in-out infinite;
}

.particle:nth-child(odd) { background: var(--accent-purple); }

@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ===== MAIN CONTAINER ===== */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  margin-bottom: 48px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 30px rgba(0, 245, 212, 0.3);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(0, 245, 212, 0.3); }
  50% { box-shadow: 0 0 50px rgba(0, 245, 212, 0.5); }
}

.logo-text {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 400;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== TAB NAVIGATION ===== */
.tab-nav {
  display: flex;
  gap: 6px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 32px;
}

.tab-btn {
  flex: 1;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.15), rgba(123, 47, 247, 0.15));
  color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.1);
}

.tab-btn .tab-icon { font-size: 18px; }

/* ===== TOOL PANEL ===== */
.tool-panel {
  display: none;
  animation: fadeSlideIn 0.4s ease-out;
}

.tool-panel.active { display: block; }

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

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(0, 245, 212, 0.15);
  box-shadow: var(--shadow-glow);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}

/* ===== TEXTAREA ===== */
.input-group { position: relative; }

.text-input {
  width: 100%;
  min-height: 160px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  transition: var(--transition);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.1);
}

.text-input::placeholder { color: var(--text-muted); }

.char-count {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

/* ===== OPTIONS ROW ===== */
.options-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.option-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.option-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.option-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.option-select option { background: var(--bg-secondary); }

/* ===== BUTTONS ===== */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0e1a;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 245, 212, 0.3);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary .spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(10, 14, 26, 0.3);
  border-top-color: #0a0e1a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.btn-copy {
  padding: 10px 20px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.3);
  border-radius: var(--radius-xs);
  color: var(--accent-cyan);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-copy:hover {
  background: rgba(0, 245, 212, 0.2);
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.15);
}

/* ===== RESULTS ===== */
.results-section {
  display: none;
  animation: fadeSlideIn 0.5s ease-out;
}

.results-section.visible { display: block; }

/* Gauge */
.gauge-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.gauge {
  position: relative;
  width: 140px;
  height: 140px;
}

.gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.gauge-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.gauge-text {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* Result Label Badge */
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  margin: 8px auto 20px;
  text-align: center;
}

.badge-ai {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-likely-ai {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-likely-human {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-human {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-plagiarized {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-partial {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-unique {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-summary {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
  padding: 0 16px;
}

/* Sentences Breakdown */
.sentences-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sentence-item {
  padding: 14px 16px;
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
  border-left: 3px solid;
  font-size: 13px;
  line-height: 1.6;
  transition: var(--transition);
}

.sentence-item:hover { transform: translateX(4px); }

.sentence-ai {
  background: rgba(239, 68, 68, 0.06);
  border-color: #ef4444;
  color: var(--text-primary);
}

.sentence-human {
  background: rgba(16, 185, 129, 0.06);
  border-color: #10b981;
  color: var(--text-primary);
}

.sentence-plagiarized {
  background: rgba(239, 68, 68, 0.06);
  border-color: #ef4444;
}

.sentence-original {
  background: rgba(16, 185, 129, 0.06);
  border-color: #10b981;
}

.sentence-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.sentence-tag {
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-ai { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.tag-human { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.tag-plagiarized { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.tag-original { background: rgba(16, 185, 129, 0.2); color: #10b981; }

/* Humanized Output */
.humanized-output {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-bottom: 16px;
}

.output-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.output-stats {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

/* Plagiarism Progress Bar */
.progress-bar-wrapper {
  margin: 20px 0;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
}

.progress-labels span:first-child { color: var(--danger); }
.progress-labels span:last-child { color: var(--success); }

/* Source Link */
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-cyan);
  font-size: 11px;
  text-decoration: none;
  transition: var(--transition);
}

.source-link:hover {
  text-decoration: underline;
  color: #33f7dc;
}

/* ===== ERROR MESSAGE ===== */
.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: #ef4444;
  font-size: 13px;
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.error-msg.visible { display: flex; }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 13px;
}

.footer a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-container { padding: 24px 16px; }
  .logo-text { font-size: 22px; }
  .header-subtitle { font-size: 14px; }
  .tab-btn { padding: 12px 8px; font-size: 12px; gap: 5px; }
  .tab-btn .tab-label { display: none; }
  .tab-btn .tab-icon { font-size: 20px; }
  .glass-card { padding: 20px; }
  .options-row { grid-template-columns: 1fr; }
  .gauge-container { gap: 24px; }
  .gauge { width: 120px; height: 120px; }
  .gauge-value { font-size: 26px; }
}

@media (max-width: 480px) {
  .logo-icon { width: 42px; height: 42px; font-size: 22px; }
  .logo-text { font-size: 20px; }
  .tab-nav { padding: 4px; gap: 4px; }
  .text-input { min-height: 130px; padding: 12px; }
  .btn-primary { padding: 14px 20px; font-size: 14px; }
}
