.nav-brand a {
  text-decoration: none;
  color: inherit;
}

.tool-main {
  padding-top: 100px;
  padding-bottom: 60px;
  min-height: 100vh;
}

.tool-header {
  margin-bottom: 3rem;
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.tool-breadcrumb a {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 500;
}

.tool-breadcrumb a:hover {
  color: var(--primary-700);
}

.tool-breadcrumb i {
  width: 16px;
  height: 16px;
}

.tool-title-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.tool-icon-large {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius-xl);
  background: var(--gradient-primary);
  color: white;
  flex-shrink: 0;
}

.tool-icon-large i {
  width: 40px;
  height: 40px;
}

.tool-title-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.tool-title-content p {
  font-size: 1.125rem;
  color: var(--gray-600);
  max-width: 500px;
}

.tool-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.tool-form {
  background: var(--white);
  padding: var(--card-padding);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-soft);
  height: fit-content;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.tool-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-brand);
  opacity: 0.8;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  background: var(--white);
  color: var(--gray-900);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.counter-status {
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.counter-status.excellent {
  background: var(--success-100);
  color: var(--success-700);
}

.counter-status.good {
  background: var(--warning-100);
  color: var(--warning-700);
}

.counter-status.poor {
  background: var(--danger-100);
  color: var(--danger-700);
}

.form-help {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--border-radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  text-align: center;
  position: relative;
  overflow: hidden;
  font-family: var(--font-family-base);
  letter-spacing: -0.01em;
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: var(--shadow-brand);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-brand);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgb(0 102 255 / 0.25);
  filter: brightness(1.08);
}

.btn-primary:hover:not(:disabled)::before {
  opacity: 0.3;
  animation: pulse-glow 2s ease-in-out infinite;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
  box-shadow: var(--shadow);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--gray-900);
  border-color: var(--gray-300);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn i {
  width: 18px;
  height: 18px;
}

.tool-preview {
  background: var(--white);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.preview-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}

.preview-devices {
  display: flex;
  gap: 0.5rem;
}

.device-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-600);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.device-btn:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.device-btn.active {
  background: var(--primary-500);
  color: white;
  border-color: var(--primary-500);
}

.device-btn i {
  width: 16px;
  height: 16px;
}

.serp-preview {
  padding: 2rem;
  background: #f8f9fa;
}

.serp-container.desktop-view {
  max-width: 600px;
  margin: 0 auto;
}

.serp-container.mobile-view {
  max-width: 375px;
  margin: 0 auto;
}

.serp-result {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.serp-url {
  font-size: 0.875rem;
  color: #1a73e8;
  margin-bottom: 0.5rem;
  font-family: var(--font-family-mono);
}

.serp-title {
  font-size: 1.125rem;
  font-weight: 400;
  color: #1a0dab;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
}

.serp-title:hover {
  text-decoration: underline;
}

.serp-title.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.serp-description {
  font-size: 0.875rem;
  color: #4d5156;
  line-height: 1.4;
}

.serp-description.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-view .serp-title {
  font-size: 1rem;
}

.mobile-view .serp-description {
  font-size: 0.8125rem;
}

.preview-analysis {
  padding: 2rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.preview-analysis h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.analysis-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
}

.analysis-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  background: var(--gray-100);
  color: var(--gray-600);
  flex-shrink: 0;
}

.analysis-icon i {
  width: 20px;
  height: 20px;
}

.analysis-content {
  flex: 1;
}

.analysis-title {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.analysis-status {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.analysis-item.excellent .analysis-icon {
  background: var(--success-100);
  color: var(--success-600);
}

.analysis-item.good .analysis-icon {
  background: var(--warning-100);
  color: var(--warning-600);
}

.analysis-item.poor .analysis-icon {
  background: var(--danger-100);
  color: var(--danger-600);
}

.tool-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.info-section {
  background: var(--white);
  padding: var(--card-padding);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
}

.info-section::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, transparent 0%, rgba(0, 102, 255, 0.02) 100%);
  pointer-events: none;
}

.info-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

.info-section ol,
.info-section ul {
  margin: 0;
  padding-left: 1.5rem;
}

.info-section li {
  margin-bottom: 0.75rem;
  color: var(--gray-600);
  line-height: 1.6;
}

.info-section strong {
  color: var(--gray-900);
}

.toast {
  position: fixed;
  top: 100px;
  right: 1rem;
  z-index: 1001;
  background: var(--success-500);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateX(100%);
  opacity: 0;
  transition: all var(--transition-normal);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast i {
  width: 20px;
  height: 20px;
}

@media (max-width: 1024px) {
  .tool-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .tool-info {
    grid-template-columns: 1fr;
  }

  .analysis-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .tool-title-section {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .tool-title-content h1 {
    font-size: 2rem;
  }

  .preview-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .preview-devices {
    width: 100%;
    justify-content: center;
  }

  .form-actions {
    flex-direction: column;
  }

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

/* Hreflang Generator Styles */
.hreflang-entry {
  margin-bottom: 1rem;
}

.entry-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.language-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background: var(--white);
  color: var(--gray-900);
  transition: all var(--transition-fast);
}

.language-select:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.remove-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 2px solid var(--danger-200);
  background: var(--danger-100);
  color: var(--danger-600);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.remove-entry:hover {
  background: var(--danger-200);
  color: var(--danger-700);
  transform: scale(1.05);
}

.remove-entry i {
  width: 18px;
  height: 18px;
}

.code-preview {
  background: var(--gray-50);
  border-radius: var(--border-radius);
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.code-preview pre {
  padding: 1.5rem;
  margin: 0;
  font-family: var(--font-family-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--gray-800);
  white-space: pre-wrap;
  word-break: break-all;
}

.code-preview code {
  font-family: inherit;
  font-size: inherit;
}

.preview-actions {
  display: flex;
  gap: 0.5rem;
}

.validation-results {
  padding: 2rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.validation-results h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

.validation-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid;
}

.validation-section:last-child {
  margin-bottom: 0;
}

.validation-section h5 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.validation-section h5 i {
  width: 18px;
  height: 18px;
}

.validation-section ul {
  margin: 0;
  padding-left: 1.5rem;
}

.validation-section li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.validation-errors {
  background: var(--danger-50);
  border-color: var(--danger-200);
  color: var(--danger-800);
}

.validation-errors h5 {
  color: var(--danger-700);
}

.validation-warnings {
  background: var(--warning-50);
  border-color: var(--warning-200);
  color: var(--warning-800);
}

.validation-warnings h5 {
  color: var(--warning-700);
}

.validation-success {
  background: var(--success-50);
  border-color: var(--success-200);
  color: var(--success-800);
}

.validation-success h5 {
  color: var(--success-700);
}

.info-warning {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--warning-100);
  border: 1px solid var(--warning-200);
  border-radius: var(--border-radius);
  margin-top: 1.5rem;
}

.info-warning i {
  width: 20px;
  height: 20px;
  color: var(--warning-600);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.info-warning div {
  color: var(--warning-800);
  line-height: 1.5;
}

.info-warning strong {
  color: var(--warning-900);
}

@media (max-width: 768px) {
  .entry-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .preview-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .preview-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .tool-main {
    padding-top: 90px;
  }

  .tool-form,
  .tool-preview,
  .info-section {
    padding: 1.5rem;
  }

  .serp-preview {
    padding: 1rem;
  }

  .tool-icon-large {
    width: 60px;
    height: 60px;
  }

  .tool-icon-large i {
    width: 30px;
    height: 30px;
  }

  .tool-title-content h1 {
    font-size: 1.75rem;
  }

  .code-preview pre {
    padding: 1rem;
    font-size: 0.8125rem;
  }

  .validation-results,
  .validation-section {
    padding: 1rem;
  }
}

/* Redirect Checker Styles */
.analysis-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.875rem;
}

.analysis-status.analyzing {
  background: var(--warning-100);
  color: var(--warning-800);
}

.analysis-status.completed {
  background: var(--success-100);
  color: var(--success-800);
}

.analysis-status.error {
  background: var(--danger-100);
  color: var(--danger-800);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.redirect-chain {
  padding: 2rem;
}

.redirect-step {
  margin-bottom: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius-lg);
  background: var(--white);
  position: relative;
}

.redirect-step.success {
  border-color: var(--success-300);
}

.redirect-step.redirect {
  border-color: var(--warning-300);
}

.redirect-step.error {
  border-color: var(--danger-300);
}

.step-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-500);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.step-url {
  font-family: var(--font-family-mono);
  font-size: 0.875rem;
  min-width: 0;
}

.step-url a {
  color: var(--primary-600);
  text-decoration: none;
  word-break: break-all;
}

.step-url a:hover {
  text-decoration: underline;
}

.step-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-badge.success {
  background: var(--success-100);
  color: var(--success-700);
}

.status-badge.redirect {
  background: var(--warning-100);
  color: var(--warning-700);
}

.status-badge.error {
  background: var(--danger-100);
  color: var(--danger-700);
}

.status-code {
  padding: 0.25rem 0.5rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.step-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  font-size: 0.875rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-item.error {
  color: var(--danger-600);
}

.detail-label {
  font-weight: 600;
  color: var(--gray-600);
}

.detail-value {
  font-family: var(--font-family-mono);
  color: var(--gray-900);
}

.step-arrow {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0;
  color: var(--gray-400);
}

.step-arrow i {
  width: 20px;
  height: 20px;
}

.chain-summary {
  padding: 2rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
}

.summary-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-100);
  color: var(--primary-600);
  border-radius: var(--border-radius-lg);
  flex-shrink: 0;
}

.summary-icon i {
  width: 24px;
  height: 24px;
}

.summary-content {
  flex: 1;
  min-width: 0;
}

.summary-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  font-family: var(--font-family-mono);
}

.summary-url {
  font-size: 0.875rem;
  color: var(--gray-700);
  font-family: var(--font-family-mono);
  word-break: break-all;
  font-weight: 500;
}

.analysis-recommendations {
  padding: 2rem;
  border-top: 1px solid var(--gray-200);
}

.analysis-recommendations h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

.recommendation {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  border: 1px solid;
}

.recommendation:last-child {
  margin-bottom: 0;
}

.recommendation i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.recommendation strong {
  display: block;
  margin-bottom: 0.5rem;
}

.recommendation p {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.recommendation small {
  color: inherit;
  opacity: 0.8;
  font-style: italic;
}

.recommendation.success {
  background: var(--success-50);
  border-color: var(--success-200);
  color: var(--success-800);
}

.recommendation.warning {
  background: var(--warning-50);
  border-color: var(--warning-200);
  color: var(--warning-800);
}

.recommendation.error {
  background: var(--danger-50);
  border-color: var(--danger-200);
  color: var(--danger-800);
}

.bulk-checker {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--gray-50);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
}

.bulk-form h3 {
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}

.bulk-progress {
  margin-top: 1.5rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

.bulk-results {
  margin-top: 2rem;
}

.bulk-results h4 {
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.results-table-container {
  overflow-x: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.results-table th {
  background: var(--gray-100);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-900);
  border-bottom: 1px solid var(--gray-200);
}

.results-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.results-table tbody tr:hover {
  background: var(--gray-50);
}

.results-table a {
  color: var(--primary-600);
  text-decoration: none;
}

.results-table a:hover {
  text-decoration: underline;
}

.issues-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--danger-100);
  color: var(--danger-700);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .step-header {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .step-header {
    padding: 1rem;
  }

  .step-details {
    padding: 0 1rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-item {
    padding: 1rem;
  }

  .bulk-checker {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .redirect-chain,
  .chain-summary,
  .analysis-recommendations {
    padding: 1rem;
  }

  .results-table-container {
    font-size: 0.75rem;
  }

  .results-table th,
  .results-table td {
    padding: 0.5rem;
  }
}

/* Structured Data Validator Styles */
.validation-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--gray-200);
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: none;
  color: var(--gray-600);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--gray-900);
  background: var(--gray-100);
}

.tab-btn.active {
  color: var(--primary-600);
  border-bottom-color: var(--primary-600);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.validation-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.875rem;
}

.validation-status.analyzing {
  background: var(--warning-100);
  color: var(--warning-800);
}

.validation-status.completed {
  background: var(--success-100);
  color: var(--success-800);
}

.validation-status.error {
  background: var(--danger-100);
  color: var(--danger-800);
}

.structured-data-results {
  padding: 2rem;
}

.results-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--gray-200);
}

.results-tabs .tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
}

.summary-item.error .summary-icon {
  background: var(--danger-100);
  color: var(--danger-600);
}

.summary-item.warning .summary-icon {
  background: var(--warning-100);
  color: var(--warning-600);
}

.summary-item.success .summary-icon {
  background: var(--success-100);
  color: var(--success-600);
}

.schema-types {
  margin-bottom: 2rem;
}

.schema-types h5 {
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--gray-900);
}

.type-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.type-badge {
  padding: 0.25rem 0.75rem;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--border-radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.result-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid;
}

.result-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.result-section h4 i {
  width: 18px;
  height: 18px;
}

.result-section.error {
  background: var(--danger-50);
  border-color: var(--danger-200);
  color: var(--danger-800);
}

.result-section.warning {
  background: var(--warning-50);
  border-color: var(--warning-200);
  color: var(--warning-800);
}

.result-section.suggestion {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-800);
}

.result-section.success {
  background: var(--success-50);
  border-color: var(--success-200);
  color: var(--success-800);
}

.result-section ul {
  margin: 0;
  padding-left: 1.5rem;
}

.result-section li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.formatted-json {
  padding: 2rem;
  border-top: 1px solid var(--gray-200);
}

.json-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.json-header h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.json-display {
  background: var(--gray-900);
  border-radius: var(--border-radius);
  overflow-x: auto;
}

.json-display pre {
  padding: 1.5rem;
  margin: 0;
  color: var(--gray-100);
  font-family: var(--font-family-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}

.schema-fields {
  margin-top: 1rem;
}

.schema-form h4 {
  margin-bottom: 1rem;
  color: var(--gray-900);
}

/* Core Web Vitals Styles */
.api-notice {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--primary-100);
  border: 1px solid var(--primary-200);
  border-radius: var(--border-radius);
  margin-top: 1.5rem;
  color: var(--primary-800);
}

.api-notice i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top: 4px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-spinner p {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.loading-spinner small {
  color: var(--gray-600);
}

.cwv-results {
  padding: 2rem;
}

.overall-score {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: var(--gray-50);
  border-radius: var(--border-radius-lg);
  margin-bottom: 2rem;
}

.score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 8px solid;
  flex-shrink: 0;
}

.score-circle.good {
  border-color: var(--success-500);
  background: var(--success-50);
}

.score-circle.needs-improvement {
  border-color: var(--warning-500);
  background: var(--warning-50);
}

.score-circle.poor {
  border-color: var(--danger-500);
  background: var(--danger-50);
}

.score-number {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-family-mono);
}

.score-label {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.score-details h4 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.analyzed-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}

.analyzed-info small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.8125rem;
}

.analyzed-info i {
  width: 14px;
  height: 14px;
}

.cwv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.cwv-metric {
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
  position: relative;
}

.cwv-metric.good {
  border-left: 4px solid var(--success-500);
}

.cwv-metric.needs-improvement {
  border-left: 4px solid var(--warning-500);
}

.cwv-metric.poor {
  border-left: 4px solid var(--danger-500);
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary-100);
  color: var(--primary-600);
  border-radius: var(--border-radius);
}

.metric-icon i {
  width: 20px;
  height: 20px;
}

.metric-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
}

.metric-source {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  font-weight: 600;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.metric-value .value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-family-mono);
  color: var(--gray-900);
}

.metric-value .unit {
  font-size: 1rem;
  color: var(--gray-600);
  font-weight: 500;
}

.metric-status {
  margin-bottom: 1rem;
}

.metric-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.field-data-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-600);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 1rem;
}

.field-data-note i {
  width: 16px;
  height: 16px;
}

.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.performance-metric {
  padding: 1rem;
  background: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  text-align: center;
}

.performance-metric.good {
  border-color: var(--success-300);
}

.performance-metric.needs-improvement {
  border-color: var(--warning-300);
}

.performance-metric.poor {
  border-color: var(--danger-300);
}

.performance-metric .metric-name {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.performance-metric .metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.performance-metric .metric-score {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-family: var(--font-family-mono);
}

.opportunities, .diagnostics {
  padding: 2rem;
  border-top: 1px solid var(--gray-200);
}

.opportunities h4, .diagnostics h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.opportunity-item, .diagnostic-item {
  padding: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  background: var(--white);
}

.opportunity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.opportunity-title, .diagnostic-title {
  font-weight: 600;
  color: var(--gray-900);
}

.opportunity-savings {
  font-weight: 700;
  color: var(--success-600);
  font-family: var(--font-family-mono);
}

.opportunity-description, .diagnostic-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.5;
}

/* Comparison Styles */
.comparison-section {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--gray-50);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
}

.comparison-form {
  margin-bottom: 2rem;
}

.url-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.url-input-group label {
  display: block;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.comparison-actions {
  display: flex;
  gap: 1rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
}

.comparison-item {
  text-align: center;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
}

.comparison-item h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.comparison-url {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-family: var(--font-family-mono);
  margin-bottom: 1rem;
  word-break: break-all;
}

.comparison-score {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-family-mono);
  margin-bottom: 1rem;
}

.comparison-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.comparison-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.vs-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.125rem;
}

.winner {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-600);
  text-align: center;
}

/* CWV Info Styles */
.cwv-explanation {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cwv-metric-info {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
}

.cwv-metric-info .metric-icon {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.cwv-metric-info .metric-icon.lcp {
  background: var(--success-100);
  color: var(--success-600);
}

.cwv-metric-info .metric-icon.fid {
  background: var(--warning-100);
  color: var(--warning-600);
}

.cwv-metric-info .metric-icon.cls {
  background: var(--danger-100);
  color: var(--danger-600);
}

.cwv-metric-info .metric-content h5 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.cwv-metric-info .metric-content p {
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.metric-thresholds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.threshold {
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.threshold.good {
  background: var(--success-100);
  color: var(--success-700);
}

.threshold.needs {
  background: var(--warning-100);
  color: var(--warning-700);
}

.threshold.poor {
  background: var(--danger-100);
  color: var(--danger-700);
}

/* Log Analyzer Styles */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--gray-300);
  border-radius: var(--border-radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.file-upload-area:hover {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.file-upload-area.drag-over {
  border-color: var(--primary-500);
  background: var(--primary-100);
}

.file-upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  pointer-events: none;
}

.upload-content i {
  width: 48px;
  height: 48px;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.upload-text strong {
  font-size: 1.125rem;
  color: var(--gray-900);
}

.upload-text span {
  color: var(--gray-600);
}

.upload-formats {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.uploaded-files {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
}

.uploaded-files h5 {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  background: var(--gray-50);
  margin-bottom: 0.5rem;
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.file-info i {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
}

.file-name {
  font-weight: 500;
  color: var(--gray-900);
}

.file-size {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-family: var(--font-family-mono);
}

.remove-file {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--danger-100);
  color: var(--danger-600);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.remove-file:hover {
  background: var(--danger-200);
  color: var(--danger-700);
}

.remove-file i {
  width: 14px;
  height: 14px;
}

.analysis-options {
  margin-top: 2rem;
}

.analysis-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.analysis-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--gray-700);
}

.analysis-checkboxes input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-500);
}

.log-results {
  padding: 2rem;
}

.results-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--gray-200);
}

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-100);
  color: var(--primary-600);
  border-radius: var(--border-radius-lg);
  flex-shrink: 0;
}

.stat-icon i {
  width: 24px;
  height: 24px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-family-mono);
  color: var(--gray-900);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.chart-container {
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
}

.chart-container h5 {
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.status-codes, .top-pages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-item, .page-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--border-radius);
}

.status-code {
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-family-mono);
  font-weight: 600;
  font-size: 0.75rem;
  text-align: center;
  min-width: 40px;
}

.status-code.success {
  background: var(--success-100);
  color: var(--success-700);
}

.status-code.redirect {
  background: var(--warning-100);
  color: var(--warning-700);
}

.status-code.client-error {
  background: var(--danger-100);
  color: var(--danger-700);
}

.status-code.server-error {
  background: var(--danger-200);
  color: var(--danger-800);
}

.status-count, .status-percent {
  font-family: var(--font-family-mono);
  font-weight: 600;
  color: var(--gray-700);
}

.page-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary-100);
  color: var(--primary-600);
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.page-url {
  flex: 1;
  font-family: var(--font-family-mono);
  font-size: 0.875rem;
  color: var(--gray-700);
  word-break: break-all;
}

.page-count {
  font-family: var(--font-family-mono);
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.875rem;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

  .cwv-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .comparison-vs {
    order: -1;
  }
}

@media (max-width: 768px) {
  .validation-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .results-tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .overall-score {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .url-inputs {
    grid-template-columns: 1fr;
  }

  .analysis-checkboxes {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== RESPONSIVE TOOLS MAGISTRALE ===== */

/* Extra Small Mobile (320px - 374px) */
@media (max-width: 374px) {
  .tool-main {
    padding-top: 90px;
    padding-bottom: var(--spacing-5xl);
  }
  
  .tool-breadcrumb {
    font-size: 0.8125rem;
    flex-wrap: wrap;
  }
  
  .tool-title-section {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-2xl);
  }
  
  .tool-icon-large {
    width: 60px;
    height: 60px;
  }
  
  .tool-icon-large i {
    width: 28px;
    height: 28px;
  }
  
  .tool-title-content h1 {
    font-size: 1.75rem;
    line-height: 1.1;
  }
  
  .tool-title-content p {
    font-size: 1rem;
  }
  
  .tool-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-3xl);
  }
  
  .tool-form,
  .tool-preview,
  .info-section {
    padding: var(--spacing-3xl);
  }
  
  .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 1rem;
  }
  
  .form-actions {
    flex-direction: column;
    gap: var(--spacing-md);
  }
}

/* Small Mobile (375px - 575px) */
@media (min-width: 375px) and (max-width: 575px) {
  .tool-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-4xl);
  }
  
  .tool-form,
  .tool-preview {
    padding: var(--spacing-4xl);
  }
  
  .btn {
    min-height: 44px;
    padding: var(--spacing-md) var(--spacing-xl);
  }
  
  .preview-devices {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .device-btn {
    min-width: 80px;
    justify-content: center;
  }
}

/* Medium Mobile & Small Tablet (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .tool-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-4xl);
    max-width: 600px;
    margin: 0 auto;
  }
  
  .tool-info {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .analysis-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .form-actions {
    justify-content: center;
  }
}

/* Tablet Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .tool-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-4xl);
  }
  
  .tool-form,
  .tool-preview {
    padding: var(--spacing-4xl);
  }
  
  .tool-info {
    grid-template-columns: 1fr 1fr;
  }
  
  .analysis-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Large Tablet & Small Laptop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .tool-content {
    gap: var(--spacing-5xl);
  }
  
  .tool-form,
  .tool-preview {
    padding: var(--spacing-5xl);
  }
}

/* ===== TOUCH OPTIMIZATION FOR TOOLS ===== */

@media (hover: none) and (pointer: coarse) {
  /* Enhanced form elements for touch */
  .form-group input,
  .form-group textarea,
  .form-group select,
  .language-select {
    min-height: 48px;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    border-radius: var(--border-radius-lg);
    touch-action: manipulation;
  }
  
  .form-group textarea {
    min-height: 120px;
  }
  
  /* Touch-friendly buttons */
  .device-btn,
  .tab-btn,
  .remove-entry,
  .remove-file {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 102, 255, 0.1);
  }
  
  .device-btn:active,
  .tab-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* File upload optimization */
  .file-upload-area {
    min-height: 200px;
    padding: var(--spacing-4xl);
    touch-action: manipulation;
  }
  
  .file-upload-area:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* Enhanced checkboxes and radio buttons */
  .analysis-checkboxes input[type="checkbox"] {
    width: 20px;
    height: 20px;
    touch-action: manipulation;
  }
  
  .analysis-checkboxes label {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: var(--spacing-sm);
    touch-action: manipulation;
  }
}

/* ===== TABLET SPECIFIC OPTIMIZATIONS ===== */

/* iPad Mini Portrait */
@media (min-width: 768px) and (max-width: 834px) and (orientation: portrait) {
  .tool-content {
    grid-template-columns: 1fr;
    max-width: 700px;
    margin: 0 auto;
    gap: var(--spacing-4xl);
  }
  
  .serp-preview,
  .code-preview {
    padding: var(--spacing-4xl);
  }
  
  .preview-header {
    padding: var(--spacing-2xl);
  }
}

/* iPad Mini Landscape */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .tool-main {
    padding-top: 90px;
  }
  
  .tool-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
  }
  
  .tool-form,
  .tool-preview {
    padding: var(--spacing-3xl);
  }
}

/* ===== ADVANCED MOBILE INTERACTIONS ===== */

@media (max-width: 768px) {
  /* Improved form UX */
  .form-group {
    margin-bottom: var(--spacing-3xl);
  }
  
  .form-group label {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
  }
  
  /* Better spacing for mobile */
  .tool-header {
    margin-bottom: var(--spacing-4xl);
  }
  
  .tool-breadcrumb {
    margin-bottom: var(--spacing-3xl);
  }
  
  /* Enhanced preview on mobile */
  .preview-header {
    padding: var(--spacing-2xl);
    flex-direction: column;
    gap: var(--spacing-md);
    align-items: stretch;
  }
  
  .preview-devices {
    width: 100%;
    justify-content: space-around;
  }
  
  .device-btn {
    flex: 1;
    max-width: 120px;
  }
  
  /* Mobile-optimized results */
  .validation-results,
  .structured-data-results,
  .cwv-results,
  .log-results {
    padding: var(--spacing-3xl);
  }
  
  .results-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
  }
  
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .btn,
  .device-btn,
  .tab-btn {
    transition: none !important;
  }
  
  .file-upload-area:active,
  .btn:active {
    transform: none !important;
  }
}

@media (prefers-contrast: high) {
  .tool-form,
  .tool-preview,
  .info-section {
    border-width: 2px;
  }
  
  .btn,
  .device-btn {
    border: 2px solid currentColor;
  }
  
  .tab-btn.active {
    border-bottom-width: 4px;
  }
}

/* ===== LEGACY MOBILE FIXES ===== */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .file-upload-area {
    padding: var(--spacing-4xl) var(--spacing-2xl);
    min-height: 180px;
  }

  .upload-content i {
    width: 32px;
    height: 32px;
  }
  
  .upload-text strong {
    font-size: 1rem;
  }
  
  .upload-text span {
    font-size: 0.875rem;
  }
  
  .analysis-checkboxes {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .comparison-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-2xl);
    text-align: center;
  }
  
  .comparison-vs {
    order: 2;
  }
  
  .cwv-grid {
    grid-template-columns: 1fr;
  }
  
  .overall-score {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-3xl);
  }
  
  .score-circle {
    width: 100px;
    height: 100px;
  }
  
  .score-number {
    font-size: 1.75rem;
  }
}