.tool-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 40px 20px;
  text-align: center;
}

.tool-header h1 {
  font-size: 32px;
  margin-bottom: 10px;
}

.back-link {
  display: inline-block;
  color: white;
  text-decoration: none;
  margin-bottom: 20px;
  opacity: 0.9;
  transition: opacity 0.3s;
}

.back-link:hover {
  opacity: 1;
}

.tool-container {
  max-width: 900px;
  margin: 40px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 30px;
}

.input-section {
  margin-bottom: 30px;
}

.input-section label {
  margin-top: 15px;
}

.input-section label:first-child {
  margin-top: 0;
}

.input-section button {
  width: 100%;
  margin-top: 20px;
}

.results-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border);
}

.results-section h2 {
  margin-bottom: 20px;
  color: var(--dark);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--light);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.stat-card h3 {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary);
}

.related-keywords ul {
  list-style: none;
  padding: 0;
}

.related-keywords li {
  background: var(--light);
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rank-display {
  text-align: center;
  margin: 30px 0;
}

.rank-number {
  font-size: 72px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 10px;
}

.chart-container {
  margin: 30px 0;
  max-height: 300px;
}

.rank-history table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.rank-history th,
.rank-history td {
  padding: 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.rank-history th {
  background: var(--light);
  font-weight: 600;
}

.content-output {
  background: var(--light);
  padding: 20px;
  border-radius: 8px;
}

.content-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.content-meta span {
  color: var(--gray);
}

.content-text {
  background: white;
  padding: 20px;
  border-radius: 6px;
  min-height: 200px;
  line-height: 1.8;
  margin-bottom: 20px;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-buttons button {
  flex: 1;
  min-width: 150px;
}

.ads-variants {
  display: grid;
  gap: 15px;
  margin-bottom: 30px;
}

.ad-variant {
  background: var(--light);
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.ad-variant:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.ad-variant h4 {
  margin-bottom: 8px;
  color: var(--dark);
}

.preview-box {
  background: white;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid var(--border);
  min-height: 200px;
}

@media (max-width: 768px) {
  .tool-header h1 {
    font-size: 24px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .content-meta {
    flex-direction: column;
    gap: 10px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons button {
    width: 100%;
  }
}