/* === Modern, Premium Styling for Backlink Generator Tool === */
:root {
  /* Core Colors */
  --bg-dark: #0f172a;
  --bg-dark-2: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --success: #10b981;
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  /* Inputs & Controls */
  --input-bg: rgba(15, 23, 42, 0.5);
  --input-border: rgba(255, 255, 255, 0.15);
  --input-focus: rgba(59, 130, 246, 0.5);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  /* Beautiful animated mesh gradient background */
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.1), transparent 30%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

.text-center {
  text-align: center;
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
}

/* --- Typography & Header --- */
.hero {
  padding: 80px 0 50px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  border-radius: 30px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1.5px;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
}

/* --- Tool Wrapper Styling --- */
.tool-wrapper {
  padding: 32px;
  margin-bottom: 60px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Controls Row */
#controls {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
}

#urlInput {
  width: 100%;
  padding: 16px 20px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
}

#urlInput:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--input-focus);
  background: rgba(30, 41, 59, 0.8);
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 24px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#startBtn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

#startBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
  background: linear-gradient(135deg, #4f46e5, #9333ea);
}

#startBtn:active {
  transform: translateY(0);
}

#toggleAdvancedBtn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

#toggleAdvancedBtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Advanced Panel */
#advancedPanel {
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  animation: slideDown 0.3s ease-out;
}

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

#advancedPanel label {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

#advancedPanel label.checkbox-label {
  display: flex;
  justify-content: flex-start;
}

#advancedPanel select,
#advancedPanel input[type="range"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
}

#advancedPanel select option {
  background: var(--bg-dark);
  color: var(--text-primary);
}

/* Share & Action Controls */
#shareControls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-top: 24px;
}

#newUrl {
  width: 100%;
  padding: 14px 20px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px dashed rgba(139, 92, 246, 0.4);
  border-radius: 14px;
  color: var(--text-secondary);
  font-family: inherit;
}

#copyBtn, #downloadBtn {
  background: var(--bg-dark-2);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

#copyBtn:hover, #downloadBtn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

#externalLink {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  padding: 12px;
  border-radius: 12px;
  transition: background 0.2s;
}

#externalLink:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* Progress Bar */
#progressContainer {
  margin: 30px 0 20px;
}

.progress-track {
  background: rgba(0, 0, 0, 0.3);
  height: 12px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success), #34d399);
  border-radius: 20px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

#progressText {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: right;
  font-weight: 500;
}

/* Results */
#previewwebsite {
  display: none;
  width: 100%;
  height: auto;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin: 24px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.results-list {
  list-style: none;
  margin: 20px 0 0;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom Scrollbar for results */
.results-list::-webkit-scrollbar {
  width: 6px;
}
.results-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}
.results-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
}

.results-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: background 0.2s;
}

.results-list li:hover {
  background: rgba(255, 255, 255, 0.06);
}

.results-list a {
  color: #93c5fd;
  word-break: break-all;
  text-decoration: none;
  font-size: 0.95rem;
}

.results-list a:hover {
  color: #bfdbfe;
  text-decoration: underline;
}

/* --- SEO Content Section --- */
.seo-section {
  margin-bottom: 60px;
}

.seo-content {
  padding: 40px;
}

.seo-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #fff;
}

.seo-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #e2e8f0;
}

.seo-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 1.05rem;
}

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

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s, background 0.2s;
}

.feature-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.04);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.feature-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
}

.steps-list {
  color: var(--text-secondary);
  padding-left: 20px;
  margin-bottom: 24px;
}

.steps-list li {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.steps-list strong {
  color: var(--text-primary);
}

.faq-item {
  margin-bottom: 20px;
}

.faq-item h4 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 8px;
}

.faq-item p {
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Footer --- */
.footer {
  margin-top: auto;
  padding: 24px 0;
  border-radius: 24px 24px 0 0;
  border-bottom: none;
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media (max-width: 850px) {
  .hero h1 { font-size: 2.5rem; }
  .two-col-layout { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  
  #controls {
    grid-template-columns: 1fr;
  }
  
  #advancedPanel label {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  #shareControls {
    grid-template-columns: 1fr;
  }
  
  .tool-wrapper { padding: 20px; }
  .seo-content { padding: 24px; }
}

/* --- Navigation Bar --- */
.main-nav {
  padding: 16px 0;
  border-radius: 0 0 24px 24px;
  margin-bottom: 30px;
  border-top: none;
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.nav-logo a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* --- AdSense Placeholders --- */
.ad-placeholder {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    text-align: center;
  }
  .nav-links {
    justify-content: center;
  }
}

/* Responsive Grid Utility */
.responsive-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .responsive-grid-2 {
    grid-template-columns: 1fr;
  }
}
