/* ─────────────────────────────────────────────────────────────
   GF SOLUÇÕES TELECOM – custom.css v3.0
   Refatoração Sênior: Performance, Acessibilidade, Responsividade
   ───────────────────────────────────────────────────────────── */

:root {
  --brand-dark: #070B14;
  --brand-cyan: #00BFFF;
  --brand-blue: #005DFF;
  --brand-card: rgba(15, 23, 42, 0.75);
  --transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══ RESET & BASE ═══ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--brand-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-cyan);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0099CC;
}

/* ═══ FOCUS STATES (ACESSIBILIDADE) ═══ */
:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

/* ═══ GLASS CARD ═══ */
.glass-card {
  background: var(--brand-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  transition: all var(--transition-smooth);
  will-change: border-color, box-shadow;
}

.glass-card:hover {
  border-color: rgba(0, 191, 255, 0.35);
  box-shadow: 0 0 30px rgba(0, 191, 255, 0.08);
}

/* ═══ GRADIENT TEXT ═══ */
.gradient-text {
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-smooth {
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradient-flow 4s ease infinite;
}

/* ═══ ANIMAÇÕES FLUIDAS ═══ */

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-smooth {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

@keyframes corporate-glow {
  0%, 100% {
    opacity: 0.15;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.2), 0 0 40px rgba(0, 93, 255, 0.1);
  }
  50% {
    opacity: 0.35;
    box-shadow: 0 0 40px rgba(0, 191, 255, 0.4), 0 0 80px rgba(0, 93, 255, 0.2);
  }
}

@keyframes pulse-smooth {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

@keyframes gradient-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes featured-glow {
  0% {
    border-color: var(--brand-cyan);
  }
  50% {
    border-color: var(--brand-blue);
  }
  100% {
    border-color: var(--brand-cyan);
  }
}

/* ═══ ANIMATION CLASSES ═══ */
.fade-in-up {
  animation: fade-in-up 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.fade-in-up-delay {
  animation: fade-in-up 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
  opacity: 0;
}

.hero-float-smooth {
  animation: float-smooth 8s ease-in-out infinite;
}

.hero-float-smooth-delay {
  animation: float-smooth 8s ease-in-out 2s infinite;
}

.corporate-glow {
  animation: corporate-glow 4s ease-in-out infinite;
}

.animate-pulse-smooth {
  animation: pulse-smooth 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ═══ CORPORATE CARD HOVER ═══ */
.corporate-card-hover {
  transition: all var(--transition-smooth);
}

.corporate-card-hover:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 191, 255, 0.6);
  box-shadow: 0 20px 60px rgba(0, 191, 255, 0.15);
}

/* ═══ FEATURED CARD ═══ */
.featured-card {
  animation: featured-glow 3s ease infinite;
}

/* ═══ CORPORATE WHATSAPP ═══ */
.corporate-whatsapp {
  animation: float-smooth 4s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
  transition: all var(--transition-fast);
}

.corporate-whatsapp:hover {
  box-shadow: 0 8px 40px rgba(34, 197, 94, 0.5);
  transform: scale(1.1);
}

/* ═══ FAQ ACCORDION ═══ */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-smooth), padding var(--transition-fast);
}

.faq-answer.open {
  max-height: 300px;
  padding-top: 12px;
}

.faq-icon {
  transition: transform var(--transition-smooth);
}

.faq-icon.rotated {
  transform: rotate(180deg);
}

/* ═══ COVERAGE BADGE ═══ */
.coverage-badge {
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.15), rgba(0, 93, 255, 0.15));
  border: 1px solid rgba(0, 191, 255, 0.3);
  border-radius: 0.75rem;
  padding: 1rem;
  animation: fade-in-up 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ═══ PLAN TABLE ═══ */
.plan-table th {
  background: rgba(0, 191, 255, 0.1);
  color: var(--brand-cyan);
}

.plan-table tr {
  transition: background-color var(--transition-fast);
}

.plan-table tr:hover td {
  background: rgba(0, 191, 255, 0.05);
}

/* ═══ BUTTONS & LINKS ═══ */
button,
a[class*="btn"],
a[class*="button"],
.cta-button {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
  cursor: pointer;
}

/* Garante contraste no hover para botões com fundo claro/gradiente */
button:hover,
a[class*="btn"]:hover,
a[class*="button"]:hover,
.cta-button:hover {
  color: #070B14 !important; /* Texto escuro no hover para melhor contraste */
}

/* Botões específicos que devem manter texto claro no hover (ex: botões escuros) */
.btn-dark:hover,
.bg-slate-900:hover,
.bg-slate-800:hover {
  color: #ffffff !important;
}

/* Botão WhatsApp geralmente fica melhor com texto branco */
a[href*="wa.me"]:hover,
.bg-emerald-600:hover {
  color: #ffffff !important;
}

button::before,
a[class*="btn"]::before,
a[class*="button"]::before,
.cta-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none;
}

button:hover::before,
a[class*="btn"]:hover::before,
a[class*="button"]:hover::before,
.cta-button:hover::before {
  width: 300px;
  height: 300px;
}

/* ═══ LINKS ═══ */
a {
  transition: all var(--transition-fast);
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--brand-cyan);
}

/* ═══ SMOOTH TRANSITIONS ═══ */
.shadow-lg {
  transition: box-shadow var(--transition-smooth);
}

.border {
  transition: border-color var(--transition-smooth);
}

/* ═══ NO TRANSITION ═══ */
*[class*="no-transition"],
.no-transition {
  transition: none !important;
}

/* ═══ REVEAL ANIMATION ═══ */
.reveal {
  animation: fade-in-up 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}

.reveal:nth-child(1) {
  animation-delay: 0s;
}
.reveal:nth-child(2) {
  animation-delay: 0.1s;
}
.reveal:nth-child(3) {
  animation-delay: 0.2s;
}
.reveal:nth-child(4) {
  animation-delay: 0.3s;
}

/* ═══ RESPONSIVE ADJUSTMENTS ═══ */

@media (max-width: 768px) {
  .fade-in-up,
  .fade-in-up-delay {
    animation: none;
    opacity: 1;
  }

  .hero-float-smooth,
  .hero-float-smooth-delay {
    animation: none;
  }

  .corporate-card-hover:hover {
    transform: none;
  }

  .transform.hover\:scale-105:hover {
    transform: scale(1);
  }

  /* Disable parallax on mobile */
  [class*="hero-float"] {
    animation: none !important;
  }
}

/* ═══ PREFERS REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ HIGH CONTRAST MODE ═══ */
@media (prefers-contrast: more) {
  .glass-card {
    border-width: 2px;
    border-color: rgba(0, 191, 255, 0.5);
  }

  button,
  a[class*="btn"],
  a[class*="button"] {
    border-width: 2px;
  }
}

/* ═══ DARK MODE SUPPORT ═══ */
@media (prefers-color-scheme: dark) {
  body {
    color-scheme: dark;
  }
}

/* ═══ PRINT STYLES ═══ */
@media print {
  header,
  footer,
  .corporate-whatsapp {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }
}

/* ═══ PERFORMANCE OPTIMIZATIONS ═══ */

/* Reduce motion for animations on slower devices */
@media (max-width: 640px) {
  * {
    animation-duration: 0.5s !important;
  }
}

/* Optimize images for mobile */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lazy load images */
img[loading="lazy"] {
  background: linear-gradient(90deg, rgba(0, 191, 255, 0.1) 25%, rgba(0, 191, 255, 0.05) 50%, rgba(0, 191, 255, 0.1) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ═══ UTILITY CLASSES ═══ */

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══ CONTAINER QUERIES (Future-proof) ═══ */
@supports (container-type: inline-size) {
  @container (max-width: 640px) {
    .glass-card {
      padding: 1rem;
    }
  }
}

/* ═══ IMPROVED FOCUS MANAGEMENT ═══ */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand-cyan);
  color: var(--brand-dark);
  padding: 8px;
  z-index: 100;
  text-decoration: none;
  font-weight: bold;
}

.skip-to-main:focus {
  top: 0;
}

/* ═══ SEMANTIC HTML ENHANCEMENTS ═══ */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section {
  display: block;
}

/* ═══ FORM IMPROVEMENTS ═══ */
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.1);
}

/* ═══ MOBILE-FIRST RESPONSIVE GRID ═══ */
@media (max-width: 640px) {
  .grid {
    gap: 1rem;
  }

  .md\:grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .lg\:grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* ═══ TABLET ADJUSTMENTS ═══ */
@media (min-width: 641px) and (max-width: 1024px) {
  .md\:grid-cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .lg\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══ DESKTOP OPTIMIZATIONS ═══ */
@media (min-width: 1025px) {
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .lg\:grid-cols-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ═══ ULTRA-WIDE DISPLAYS ═══ */
@media (min-width: 1920px) {
  .max-w-7xl {
    max-width: 1400px;
  }
}
