/* ==========================================================================
   HTML SCRAPPER BY ZHH - DARK FUTURISTIC GLASSMORPHISM DESIGN SYSTEM
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-card: rgba(13, 17, 26, 0.7);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(18, 24, 38, 0.8);
  
  --neon-cyan: #00f2fe;
  --neon-blue: #4facfe;
  --neon-purple: #7f00ff;
  --neon-pink: #f857a6;
  --neon-green: #00ff9d;
  --neon-red: #ff3366;
  
  --text-main: #f0f4f8;
  --text-muted: #7e8b9b;
  --text-dim: #4a5568;

  --syntax-tag: #00f2fe;
  --syntax-attr: #a6e22e;
  --syntax-val: #ffe66d;
  --syntax-comment: #6272a4;
  --syntax-punct: #6c7a89;
  --syntax-doctype: #bd93f9;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', Consolas, Monaco, monospace;
  
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.unselectable-ui {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.selectable-code, 
.selectable-code * {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  animation: pulseGlow 12s infinite alternate ease-in-out;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--neon-cyan) 0%, var(--neon-purple) 100%);
  top: -150px;
  left: -150px;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--neon-purple) 0%, var(--neon-blue) 100%);
  bottom: -200px;
  right: -200px;
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.25; }
  100% { transform: scale(1.15) translate(30px, 30px); opacity: 0.45; }
}

.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.logo-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #000;
  font-size: 1rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-author {
  font-size: 0.7rem;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--neon-cyan);
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  transition: var(--transition-smooth);
}

.status-indicator-dot.busy {
  background-color: var(--neon-blue);
  box-shadow: 0 0 8px var(--neon-blue);
  animation: blink 1s infinite alternate;
}

.status-indicator-dot.error {
  background-color: var(--neon-red);
  box-shadow: 0 0 8px var(--neon-red);
}

@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.status-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2.5rem 0;
}

.hero-section {
  text-align: center;
  max-width: 850px;
  margin: 0 auto;
  width: 100%;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(180deg, #ffffff 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.input-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem;
  border-radius: 14px;
  transition: var(--transition-smooth);
}

.input-card:focus-within {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.15);
}

.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.url-icon {
  position: absolute;
  left: 1.25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 1rem 2.8rem 1rem 3.2rem;
  color: var(--text-main);
  font-size: 1rem;
  font-family: var(--font-mono);
  outline: none;
  transition: var(--transition-smooth);
}

.input-wrapper input:focus {
  background: rgba(18, 24, 38, 0.95);
  border-color: rgba(0, 242, 254, 0.4);
}

.btn-clear-input {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.input-wrapper input:valid ~ .btn-clear-input,
.input-wrapper input:not(:placeholder-shown) ~ .btn-clear-input {
  opacity: 1;
  visibility: visible;
}

.btn-clear-input:hover {
  color: var(--text-main);
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  color: #050811;
  border: none;
  padding: 0 2rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 242, 254, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(5, 8, 17, 0.2);
  border-top-color: #050811;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

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

.error-panel {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-color: rgba(255, 51, 102, 0.3);
  background: rgba(255, 51, 102, 0.08);
  animation: fadeIn 0.3s ease-out;
}

.error-icon {
  width: 32px;
  height: 32px;
  background: var(--neon-red);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.error-content {
  flex: 1;
  text-align: left;
}

.error-content h4 {
  font-size: 0.85rem;
  color: var(--neon-red);
  letter-spacing: 1px;
}

.error-content p {
  font-size: 0.9rem;
  color: var(--text-main);
}

.btn-close-error {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.workspace-section {
  width: 100%;
  animation: fadeInUp 0.4s ease-out;
}

.workspace-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(18, 24, 38, 0.6);
  border-bottom: 1px solid var(--bg-card-border);
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.toolbar-title-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--neon-cyan);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 242, 254, 0.2);
}

.stats-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat-item {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  display: flex;
  gap: 0.4rem;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  color: var(--text-main);
  font-weight: 600;
}

.stat-value.val-success {
  color: var(--neon-green);
}

.stat-value.val-error {
  color: var(--neon-red);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.btn-control:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-control.btn-accent {
  background: rgba(0, 242, 254, 0.1);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--neon-cyan);
}

.btn-control.btn-accent:hover {
  background: rgba(0, 242, 254, 0.2);
}

.btn-control.btn-danger {
  color: #ff5555;
}

.btn-control.btn-danger:hover {
  background: rgba(255, 85, 85, 0.15);
}

.editor-container {
  display: flex;
  height: 550px;
  max-height: 70vh;
  background: #090c14;
  position: relative;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
}

.line-numbers {
  padding: 1rem 0.75rem;
  background: #06080e;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  text-align: right;
  min-width: 50px;
  overflow: hidden;
  user-select: none !important;
  white-space: pre;
}

.code-scroller {
  flex: 1;
  overflow: auto;
  padding: 1rem;
}

.code-output {
  margin: 0;
  white-space: pre;
  tab-size: 2;
}

.token-tag { color: var(--syntax-tag); font-weight: 500; }
.token-attr { color: var(--syntax-attr); }
.token-val { color: var(--syntax-val); }
.token-comment { color: var(--syntax-comment); font-style: italic; }
.token-punct { color: var(--syntax-punct); }
.token-doctype { color: var(--syntax-doctype); font-weight: bold; }

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.app-footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  background: rgba(13, 17, 26, 0.9);
  backdrop-filter: blur(15px);
  border: 1px solid var(--neon-cyan);
  color: var(--text-main);
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.toast-error {
  border-color: var(--neon-red);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 768px) {
  .app-container {
    padding: 0 1rem;
  }
  
  .input-card {
    flex-direction: column;
  }
  
  .btn-primary {
    width: 100%;
    padding: 0.9rem;
  }
  
  .workspace-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .toolbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .btn-control {
    flex: 1;
    justify-content: center;
  }

  .editor-container {
    height: 400px;
  }

  .stat-time-item {
    display: none;
  }
}
