/* Critical fixes for visual inconsistencies */

/* Fix for inconsistent font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Fix for broken cursor on touch devices */
@media (hover: none) {
  .cursor-outer,
  .cursor-inner {
    display: none !important;
  }
}

/* Fix for inconsistent button heights */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 4.8rem;
}

/* Fix for inconsistent card shadows */
.card,
.project-card,
.service-preview-card,
.testimonial-card,
.timeline-content {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Fix for image aspect ratio issues */
.project-image img,
.featured-project-image img,
.testimonial-author-image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.testimonial-author-image img {
  aspect-ratio: 1 / 1;
}

/* Fix for inconsistent spacing */
section {
  padding: 8rem 0;
}

section:first-of-type {
  padding-top: 12rem;
}

.section-header {
  margin-bottom: 6rem;
}

/* Fix for mobile navigation issues */
@media (max-width: 768px) {
  nav {
    width: 80%;
    max-width: 30rem;
  }

  nav ul li {
    margin-bottom: 2rem;
  }

  nav ul li a {
    font-size: 2rem;
    padding: 1rem 0;
  }
}

/* Fix for hero section on small screens */
@media (max-width: 576px) {
  .hero {
    min-height: 100vh;
    padding-top: 10rem;
    padding-bottom: 5rem;
  }

  .hero-text h1 {
    font-size: 3.6rem;
  }

  .hero-subtitle {
    font-size: 1.8rem;
  }

  .hero-description {
    font-size: 1.6rem;
  }
}

/* Fix for timeline on mobile */
@media (max-width: 576px) {
  .timeline {
    padding-left: 2rem;
  }

  .timeline-dot {
    left: -2.5rem;
  }

  .timeline-content {
    padding: 1.5rem;
  }
}

/* Fix for footer on mobile */
@media (max-width: 576px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.5rem;
  }
}

/* Fix for color scheme panel */
.color-scheme-panel {
  max-height: 80vh;
  overflow-y: auto;
}

/* Fix for skill progress bars */
.skill-progress {
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fix for testimonial slider */
.testimonial-slide {
  opacity: 0;
  transition: opacity 0.5s ease;
  position: absolute;
  width: 100%;
}

.testimonial-slide.active {
  opacity: 1;
  position: relative;
}

/* Fix for form elements */
input,
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.5rem;
  padding-right: 3rem;
}

/* Fix for dark mode text contrast */
[data-theme="dark"] {
  --text-color: #f0f0f0;
  --text-color-light: #b0b0b0;
}

/* Fix for inconsistent border-radius */
.btn,
.card,
.project-card,
.service-preview-card,
.testimonial-card,
input,
textarea,
select,
.skill-level,
.back-to-top {
  border-radius: 0.8rem;
}

/* Fix for inconsistent transitions */
.btn,
.nav-link,
.social-icon,
.project-card,
.service-preview-card,
.testimonial-card,
input,
textarea,
select {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fix for scroll behavior */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 8rem;
}

/* Fix for focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Fix for inconsistent shadows in dark mode */
[data-theme="dark"] .card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .service-preview-card,
[data-theme="dark"] .testimonial-card,
[data-theme="dark"] .timeline-content {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), 0 10px 15px rgba(0, 0, 0, 0.3);
}

/* Fix for color scheme toggle position */
.color-scheme-toggle {
  position: fixed;
  top: 2rem;
  right: 8rem;
}

@media (max-width: 768px) {
  .color-scheme-toggle {
    top: 1.5rem;
    right: 7rem;
  }
}

@media (max-width: 576px) {
  .color-scheme-toggle {
    top: 1.5rem;
    right: 6rem;
  }
}

/* Fix for inconsistent spacing in forms */
.form-group {
  margin-bottom: 2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 500;
}

/* Fix for inconsistent button sizes */
.btn-lg {
  padding: 1.5rem 3rem;
  font-size: 1.8rem;
  min-height: 5.6rem;
}

.btn-sm {
  padding: 0.8rem 1.6rem;
  font-size: 1.4rem;
  min-height: 3.6rem;
}

/* Fix for inconsistent image containers */
.img-container {
  position: relative;
  overflow: hidden;
  border-radius: 0.8rem;
}

/* Fix for inconsistent social icons */
.social-icon {
  width: 4rem;
  height: 4rem;
}

/* Fix for inconsistent section padding on mobile */
@media (max-width: 576px) {
  section {
    padding: 6rem 0;
  }

  section:first-of-type {
    padding-top: 10rem;
  }
}

/* Fix for inconsistent card padding */
.card,
.project-card .project-content,
.service-preview-card,
.testimonial-card {
  padding: 2.4rem;
}

/* Fix for inconsistent text alignment on mobile */
@media (max-width: 576px) {
  .text-center-mobile {
    text-align: center;
  }

  .hero-content,
  .about-content,
  .contact-info {
    text-align: center;
  }
}

/* Fix for inconsistent grid gaps */
.featured-projects-grid,
.services-preview-grid,
.projects-grid,
.testimonials-grid,
.skills-grid {
  gap: 3rem;
}

@media (max-width: 768px) {
  .featured-projects-grid,
  .services-preview-grid,
  .projects-grid,
  .testimonials-grid,
  .skills-grid {
    gap: 2.4rem;
  }
}

@media (max-width: 576px) {
  .featured-projects-grid,
  .services-preview-grid,
  .projects-grid,
  .testimonials-grid,
  .skills-grid {
    gap: 2rem;
  }
}
