/* ============================================
   QuickTech Pro — Custom Styles
   Professional Computer Repair Website
   ============================================ */

/* ===== SMOOTH SCROLLING ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

/* ===== FOCUS STYLES (Accessibility) ===== */
:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ===== PAGE LOADER ===== */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}
.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}
.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #ea580c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
  position: fixed;
  top: 80px;
  left: 0;
  height: 3px;
  background-color: #ea580c;
  z-index: 100;
  width: 0%;
  transition: width 0.05s linear;
}

/* ===== NAVIGATION ===== */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #ea580c;
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 9999;
  visibility: hidden;
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
}
.mobile-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9998;
}
.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ===== TYPING CURSOR ===== */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1.1em;
  background-color: #ea580c;
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== SERVICE CARDS ===== */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}
.service-card .service-icon {
  transition: transform 0.3s ease;
}
.service-card:hover .service-icon {
  transform: scale(1.1);
}

/* ===== TESTIMONIAL CAROUSEL ===== */
.testimonial-carousel {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.testimonial-track {
  display: flex;
  width: 100%;
  transition: transform 0.5s ease;
}
.testimonial-slide {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}
.testimonial-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #cbd5e1;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
  padding: 0;
}
.testimonial-dot.active {
  background-color: #ea580c;
  transform: scale(1.2);
}

/* ===== DOT PATTERN BACKGROUND ===== */
.dot-pattern {
  position: relative;
}
.dot-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1.5' cy='1.5' r='1' fill='%2394a3b8' opacity='0.15'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}
.dot-pattern > * {
  position: relative;
  z-index: 1;
}

/* ===== WHATSAPP FLOAT BUTTON ===== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  animation: wa-pulse 2s infinite;
}
@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 90;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== FAQ ACCORDION ===== */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.faq-answer.open {
  max-height: 600px;
}
.faq-icon {
  transition: transform 0.3s ease;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

/* ===== BLOG CARDS ===== */
.blog-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}
.blog-card .blog-img {
  overflow: hidden;
}
.blog-card .blog-img img,
.blog-card .blog-img .img-placeholder {
  transition: transform 0.3s ease;
}
.blog-card:hover .blog-img img,
.blog-card:hover .blog-img .img-placeholder {
  transform: scale(1.05);
}

/* ===== STEP CONNECTOR LINE ===== */
.step-connector {
  position: absolute;
  top: 32px;
  left: calc(50% + 32px);
  width: calc(100% - 64px);
  height: 2px;
  background-color: #e2e8f0;
}

/* ===== BUTTON HOVER EFFECTS ===== */
.btn-primary {
  background-color: #ea580c;
  color: #ffffff;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}
.btn-primary:hover {
  background-color: #c2410c;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid #e2e8f0;
  color: #f1f5f9;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline {
  border: 2px solid #ea580c;
  color: #ea580c;
  background-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.btn-outline:hover {
  background-color: #ea580c;
  color: #ffffff;
  transform: translateY(-1px);
}

/* ===== STAR RATING ===== */
.star-rating {
  color: #f59e0b;
}

/* ===== HEADER SHADOW ON SCROLL ===== */
.header-scrolled {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

/* ===== TAG / BADGE STYLES ===== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
}

/* ===== PRICING CARD HIGHLIGHT ===== */
.pricing-highlight {
  border: 2px solid #ea580c;
  position: relative;
}
.pricing-highlight::before {
  content: 'Most Popular';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ea580c;
  color: #fff;
  padding: 4px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
}

/* ===== FORM STYLES ===== */
.form-input {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-input:focus {
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}
.form-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* ===== SKIP TO MAIN (Accessibility) ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: #ea580c;
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ===== RESPONSIVE OVERFLOW FIX ===== */
@media (max-width: 768px) {
  /* Ensure all major containers respect viewport width */
  .max-w-7xl,
  .max-w-6xl,
  .max-w-5xl,
  .max-w-4xl,
  .max-w-3xl,
  .max-w-2xl {
    max-width: 100%;
    overflow-x: visible;
  }
  
  /* Ensure all content sections don't overflow */
  section,
  main,
  article {
    max-width: 100vw;
    overflow-x: visible;
  }
  
  /* Ensure grid containers don't cause overflow */
  .grid {
    overflow-x: visible;
  }
  
  /* Hero section specific fixes */
  .dot-pattern {
    width: 100%;
    max-width: 100vw;
  }
  
  /* Prevent trust indicators overflow */
  .text-3xl,
  .text-4xl,
  .text-5xl {
    word-break: break-word;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .no-print,
  .whatsapp-float,
  .back-to-top,
  .scroll-progress,
  header,
  footer {
    display: none !important;
  }
  body {
    font-size: 12pt;
    color: #000;
  }
}
