/* ================================================================
   Coweta Computers â€” Polish & Animation Layer
   Drop-in CSS/JS enhancements for cowetacomputers.com
   Version: 1.0
   ================================================================ */

/* â”€â”€â”€ 1. LOADING SCREEN â”€â”€â”€ */
.cc-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0f131a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0s 0.6s;
}
.cc-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.cc-loader__logo {
  width: 64px;
  height: 64px;
  border: 2px solid rgba(0, 229, 255, 0.15);
  border-top-color: #00e5ff;
  border-radius: 50%;
  animation: cc-spin 0.8s linear infinite;
  margin-bottom: 20px;
}
.cc-loader__text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(0, 229, 255, 0.6);
}
@keyframes cc-spin {
  to { transform: rotate(360deg); }
}

/* â”€â”€â”€ 2. ENHANCED NAVIGATION â”€â”€â”€ */

/* Mega menu reorganization â€” group by category with headers */
.site-header .main-navigation .menu-item-15230 > .sub-menu {
  width: 720px;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 20px;
  padding: 20px 24px 24px;
}

/* Category headers inside mega menu */
.cc-menu-category {
  grid-column: 1 / -1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #00e5ff;
  padding: 12px 0 6px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cc-menu-category::before {
  content: '';
  width: 8px;
  height: 2px;
  background: #00e5ff;
  border-radius: 1px;
}

/* Nav link active state â€” animated underline */
.main-navigation ul.menu > li > a {
  position: relative;
}
.main-navigation ul.menu > li > a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 14px;
  right: 14px;
  height: 0;
  background: #00e5ff;
  border-radius: 1px;
  transition: height 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: none;
}
.main-navigation ul.menu > li:hover > a::after,
.main-navigation ul.menu > .current-menu-item > a::after,
.main-navigation ul.menu > .current_page_item > a::after {
  height: 2px;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

/* Mobile nav slide-in enhancement */
@media (max-width: 900px) {
  .main-navigation ul.toggled {
    animation: cc-mobile-menu 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
  @keyframes cc-mobile-menu {
    0% { opacity: 0; transform: translateY(-12px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* â”€â”€â”€ 3. STAGGERED SCROLL ANIMATIONS â”€â”€â”€ */

/* Override the flat anim-fade-up with staggered delays */
.grid > .anim-fade-up:nth-child(1) { transition-delay: 0ms; }
.grid > .anim-fade-up:nth-child(2) { transition-delay: 80ms; }
.grid > .anim-fade-up:nth-child(3) { transition-delay: 160ms; }
.grid > .anim-fade-up:nth-child(4) { transition-delay: 240ms; }
.grid > .anim-fade-up:nth-child(5) { transition-delay: 320ms; }
.grid > .anim-fade-up:nth-child(6) { transition-delay: 400ms; }
.grid > .anim-fade-up:nth-child(7) { transition-delay: 480ms; }
.grid > .anim-fade-up:nth-child(8) { transition-delay: 560ms; }
.grid > .anim-fade-up:nth-child(9) { transition-delay: 640ms; }
.grid > .anim-fade-up:nth-child(10) { transition-delay: 720ms; }
.grid > .anim-fade-up:nth-child(11) { transition-delay: 800ms; }

/* Section headings entrance */
.section__label,
.section__title,
.section__description {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.section-entrance.is-visible .section__label {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0ms;
}
.section-entrance.is-visible .section__title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 100ms;
}
.section-entrance.is-visible .section__description {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 200ms;
}

/* â”€â”€â”€ 4. STAT COUNTER COUNT-UP â”€â”€â”€ */
.stat__number {
  font-variant-numeric: tabular-nums;
}

/* â”€â”€â”€ 5. ENHANCED CARD EFFECTS â”€â”€â”€ */

/* Gradient border glow on hover */
.card {
  position: relative;
  background: #1c2538;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(0, 229, 255, 0) 0%,
    rgba(0, 229, 255, 0.15) 50%,
    rgba(180, 0, 255, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  pointer-events: none;
}
.card:hover::before {
  opacity: 1;
}

/* Card inner content above the gradient */
.card > * {
  position: relative;
  z-index: 1;
}

/* Service card icon pulse on hover */
.card:hover .card__icon {
  animation: cc-icon-pulse 0.6s ease;
}
@keyframes cc-icon-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  100% { transform: scale(1.12); }
}

/* Card arrow indicator for linked cards */
a.card::after {
  content: 'â†’';
  position: absolute;
  bottom: 28px;
  right: 28px;
  font-size: 1.125rem;
  color: #00e5ff;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2;
}
a.card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* â”€â”€â”€ 6. PROCESS STEPS CONNECTOR â”€â”€â”€ */
@media (min-width: 769px) {
  .grid--4 {
    position: relative;
  }
  .grid--4 > .card {
    position: relative;
  }
  .grid--4 > .card:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;
    right: -20px;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.4), rgba(0, 229, 255, 0.1));
    z-index: 2;
  }
}

/* Step number glow */
.grid--4 .card > div:first-child {
  position: relative;
}
.grid--4 .card > div:first-child::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.15), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.grid--4 .card:hover > div:first-child::after {
  opacity: 1;
}

/* â”€â”€â”€ 7. TESTIMONIAL ENHANCEMENTS â”€â”€â”€ */

/* Quote marks */
.card blockquote,
.card:has(.card__text[style*="italic"]) {
  position: relative;
}

/* Testimonial card refinement */
.card:has(.card__text[style*="italic"])::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, #00e5ff, rgba(180, 0, 255, 0.5));
  border-radius: 2px;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.card:has(.card__text[style*="italic"]):hover::before {
  height: 100%;
}

/* â”€â”€â”€ 8. PARTNER LOGO MARQUEE â”€â”€â”€ */
.logo-grid {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.logo-grid::before,
.logo-grid::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.logo-grid::before {
  left: 0;
  background: linear-gradient(90deg, #151d2b, transparent);
}
.logo-grid::after {
  right: 0;
  background: linear-gradient(270deg, #151d2b, transparent);
}

@media (min-width: 769px) {
  .logo-grid {
    display: flex;
    animation: cc-logo-scroll 20s linear infinite;
    width: max-content;
  }
  .logo-grid:hover {
    animation-play-state: paused;
  }
  .logo-card {
    flex: 0 0 auto;
    min-width: 160px;
  }
}
@keyframes cc-logo-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* â”€â”€â”€ 9. FAQ ACCORDION POLISH â”€â”€â”€ */
.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(28, 37, 56, 0.5);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.faq-item:hover {
  border-color: rgba(0, 229, 255, 0.15);
}
.faq-item[open] {
  border-color: rgba(0, 229, 255, 0.2);
  box-shadow: 0 4px 24px rgba(0, 229, 255, 0.05);
}
.faq-question {
  padding: 20px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: #f1f5f9;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: color 0.2s ease;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::marker { display: none; content: ''; }

/* Animated chevron */
.faq-question::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid #00e5ff;
  border-bottom: 2px solid #00e5ff;
  transform: rotate(45deg);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  flex-shrink: 0;
}
.faq-item[open] .faq-question::after {
  transform: rotate(-135deg);
}
.faq-question:hover {
  color: #00e5ff;
}
.faq-answer {
  padding: 0 24px 20px;
  color: #94a3b8;
  line-height: 1.7;
  animation: cc-faq-open 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cc-faq-open {
  0% { opacity: 0; transform: translateY(-8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* â”€â”€â”€ 10. CTA SECTION GLOW â”€â”€â”€ */
.cta-section {
  position: relative;
  overflow: hidden;
}
.cta-section::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.08), transparent 60%);
  pointer-events: none;
  animation: cc-cta-pulse 4s ease-in-out infinite;
}
@keyframes cc-cta-pulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* â”€â”€â”€ 11. BACK TO TOP BUTTON â”€â”€â”€ */
.cc-back-to-top {
  position: fixed;
  bottom: 80px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cc-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.cc-back-to-top:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.15);
  transform: translateY(-2px);
}
.cc-back-to-top svg {
  width: 18px;
  height: 18px;
}

/* â”€â”€â”€ 12. SMOOTH REVEAL FOR ALL SECTIONS â”€â”€â”€ */
.section-entrance {
  will-change: opacity, transform;
}

/* â”€â”€â”€ 13. FOCUS STATES FOR ACCESSIBILITY â”€â”€â”€ */
a:focus-visible,
button:focus-visible,
.faq-question:focus-visible {
  outline: 2px solid #00e5ff;
  outline-offset: 2px;
  border-radius: 4px;
}

/* â”€â”€â”€ 14. REDUCED MOTION â”€â”€â”€ */
@media (prefers-reduced-motion: reduce) {
  .cc-loader { display: none; }
  .cc-back-to-top { transition: none; }
  .faq-answer { animation: none; }
  .card::before { transition: none; }
  .logo-grid { animation: none; }
  .cc-menu-category { animation: none; }
  .grid > .anim-fade-up { transition-delay: 0ms !important; }
  .section__label, .section__title, .section__description {
    transition-delay: 0ms !important;
  }
}

/* â”€â”€â”€ 15. HEADER SCROLL REFINEMENT â”€â”€â”€ */
.site-header {
  transition: background 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.site-header.scrolled {
  border-bottom-color: rgba(0, 229, 255, 0.12);
}

/* â”€â”€â”€ 16. FOOTER LINK HOVER UNDERLINE â”€â”€â”€ */
.footer-col ul a {
  position: relative;
  text-decoration: none;
}
.footer-col ul a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #00e5ff;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.footer-col ul a:hover::after {
  width: 100%;
}

/* â”€â”€â”€ 17. BUTTON MICRO-INTERACTIONS â”€â”€â”€ */
.btn {
  will-change: transform, box-shadow;
}
.btn:active {
  transform: translateY(0) scale(0.98);
}

/* â”€â”€â”€ 18. STAT DECORATION ANIMATION â”€â”€â”€ */
.stat:hover .stat__decoration {
  width: 60px;
  opacity: 0.8;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

/* â”€â”€â”€ 19. PAGE TRANSITION OVERLAY â”€â”€â”€ */
.cc-page-transition {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #0f131a;
  transform: scaleY(0);
  transform-origin: bottom;
  pointer-events: none;
}
.cc-page-transition.is-active {
  animation: cc-page-wipe 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes cc-page-wipe {
  0% { transform: scaleY(0); transform-origin: bottom; }
  50% { transform: scaleY(1); transform-origin: bottom; }
  50.01% { transform-origin: top; }
  100% { transform: scaleY(0); transform-origin: top; }
}

/* â”€â”€â”€ 20. RESPONSIVE POLISH â”€â”€â”€ */
@media (max-width: 600px) {
  .hero__title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }
  .hero__description {
    font-size: 1rem;
    line-height: 1.7;
  }
  .stat {
    padding: 24px 16px;
  }
  .stat__number {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }
  .card {
    padding: 24px;
  }
  .faq-question {
    padding: 16px 20px;
    font-size: 0.9375rem;
  }
  .faq-answer {
    padding: 0 20px 16px;
    font-size: 0.875rem;
  }
}
