/* Optimized styles for SEO Audit Report Website */

/* Base styles with performance optimizations */
:root {
  --primary-color: #4a6baf;
  --secondary-color: #5cb85c;
  --accent-color: #f0ad4e;
  --danger-color: #d9534f;
  --dark-color: #343a40;
  --light-color: #f8f9fa;
  --gray-color: #6c757d;
  --border-color: #dee2e6;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* Reset with minimal footprint */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Font optimization */
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
  text-rendering: optimizeSpeed;
}

/* Container with fluid responsiveness */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header with minimal properties */
header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
}

.logo span {
  color: var(--accent-color);
}

/* Navigation with simplified styles */
nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: var(--accent-color);
}

/* Hero section with optimized gradient */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, #2a4a8d 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* Button with minimal transitions */
.btn {
  display: inline-block;
  background-color: var(--accent-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.3s, background-color 0.3s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: #e09a3e;
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #3a5a9f;
}

.btn-success {
  background-color: var(--secondary-color);
}

.btn-success:hover {
  background-color: #4cae4c;
}

.btn-danger {
  background-color: var(--danger-color);
}

.btn-danger:hover {
  background-color: #c9302c;
}

/* Section with reduced padding */
section {
  padding: 3rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
}

.section-title h2 {
  font-size: 2rem;
  color: var(--dark-color);
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background-color: var(--primary-color);
}

/* Card with optimized shadow */
.card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 1.5rem;
  background-color: var(--primary-color);
  color: white;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  border-top: 1px solid var(--border-color);
}

/* Grid with auto-fill for better responsiveness */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Score card with simplified styles */
.score-card {
  text-align: center;
  padding: 1.5rem;
}

.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
}

.score-excellent {
  background-color: var(--secondary-color);
}

.score-good {
  background-color: var(--accent-color);
}

.score-moderate {
  background-color: #f0ad4e;
}

.score-poor {
  background-color: var(--danger-color);
}

/* Findings list with reduced margins */
.findings-list {
  list-style: none;
}

.findings-list li {
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  border-radius: 4px;
  border-left: 4px solid var(--primary-color);
  background-color: #f8f9fa;
}

.findings-list li.strength {
  border-left-color: var(--secondary-color);
}

.findings-list li.critical {
  border-left-color: var(--danger-color);
}

.findings-list li.opportunity {
  border-left-color: var(--accent-color);
}

.findings-list li h3 {
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

/* Recommendations with simplified styles */
.recommendations {
  margin-top: 1.5rem;
}

.recommendation-category {
  margin-bottom: 1.5rem;
}

.recommendation-category h3 {
  padding: 0.75rem 1rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.recommendation-category.critical h3 {
  background-color: var(--danger-color);
}

.recommendation-category.high h3 {
  background-color: var(--accent-color);
}

.recommendation-category.medium h3 {
  background-color: var(--primary-color);
}

.recommendation-category.low h3 {
  background-color: var(--gray-color);
}

.recommendation-list {
  list-style: none;
}

.recommendation-list li {
  padding: 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  background-color: #f8f9fa;
  border-left: 4px solid var(--primary-color);
}

.recommendation-list li.critical {
  border-left-color: var(--danger-color);
}

.recommendation-list li.high {
  border-left-color: var(--accent-color);
}

.recommendation-list li.medium {
  border-left-color: var(--primary-color);
}

.recommendation-list li.low {
  border-left-color: var(--gray-color);
}

/* Timeline with simplified styles */
.timeline {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background-color: var(--primary-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -2px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  right: -14px;
  background-color: white;
  border: 4px solid var(--primary-color);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.left {
  left: 0;
}

.right {
  left: 50%;
}

.left::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  right: 30px;
  border: medium solid var(--border-color);
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent var(--border-color);
}

.right::before {
  content: " ";
  height: 0;
  position: absolute;
  top: 22px;
  width: 0;
  z-index: 1;
  left: 30px;
  border: medium solid var(--border-color);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--border-color) transparent transparent;
}

.right::after {
  left: -14px;
}

.timeline-content {
  padding: 15px 20px;
  background-color: white;
  position: relative;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-content h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

/* Analysis section with reduced margins */
.analysis-section {
  margin-bottom: 2rem;
}

.analysis-section h3 {
  margin-bottom: 1rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.analysis-subsection {
  margin-bottom: 1.5rem;
}

.analysis-subsection h4 {
  margin-bottom: 0.75rem;
  color: var(--dark-color);
}

/* Table with simplified styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

table th, table td {
  padding: 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

table th {
  background-color: var(--primary-color);
  color: white;
}

table tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* Footer with reduced padding */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 1.5rem 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-links {
  margin-bottom: 1rem;
}

.footer-links a {
  color: white;
  margin: 0 0.5rem;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--accent-color);
}

.copyright {
  font-size: 0.9rem;
  color: #adb5bd;
}

/* Responsive styles with mobile-first approach */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
  }
  
  nav ul {
    margin-top: 1rem;
  }
  
  nav ul li {
    margin-left: 0.8rem;
    margin-right: 0.8rem;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .timeline::after {
    left: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  
  .timeline-item::before {
    left: 60px;
    border: medium solid var(--border-color);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--border-color) transparent transparent;
  }
  
  .left::after, .right::after {
    left: 15px;
  }
  
  .right {
    left: 0%;
  }
  
  .card-header, .card-body, .card-footer {
    padding: 1rem;
  }
  
  section {
    padding: 2rem 0;
  }
}

/* Small screen optimizations */
@media (max-width: 480px) {
  .hero {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 1.5rem;
  }
  
  .section-title h2 {
    font-size: 1.5rem;
  }
  
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .score-circle {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
  }
  
  .timeline-item {
    padding-left: 50px;
  }
  
  .timeline::after {
    left: 21px;
  }
  
  .left::after, .right::after {
    left: 5px;
  }
}

/* Print styles with minimal footprint */
@media print {
  header, footer, .btn, #back-to-top, .no-print {
    display: none;
  }
  
  body {
    background-color: white;
    color: black;
  }
  
  .container {
    width: 100%;
    max-width: none;
    padding: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
  
  .card:hover {
    transform: none;
    box-shadow: none;
  }
  
  section {
    padding: 1rem 0;
    page-break-inside: avoid;
  }
  
  .section-title {
    margin-bottom: 1rem;
  }
  
  .timeline::after, .timeline-item::after, .timeline-item::before {
    display: none;
  }
  
  .timeline-item {
    width: 100%;
    padding: 0;
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
  }
  
  .left, .right {
    left: 0;
  }
  
  .timeline-content {
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  img {
    max-width: 100% !important;
  }
  
  p, h2, h3 {
    orphans: 3;
    widows: 3;
  }
  
  .print-only {
    display: block;
  }
}
