/* ============================================
   HEADER STYLES - Energy Future Insights
   ============================================ */

:root {
  --font-heading: Sora, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: Outfit, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-code: 'Courier New', Courier, monospace;
}

/* Body Base */
body {
  font-family: var(--font-body);
  background-color: #ffffff;
  letter-spacing: -0.005em;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
}

code,
pre,
kbd,
samp,
.font-mono {
  font-family: var(--font-code) !important;
}

/* Compensação para navbar fixa - DESKTOP */
@media (min-width: 1024px) {
  body {
    padding-top: 64px !important; /* Altura da navbar desktop (h-16 = 64px) */
  }
}

/* Mobile usa sticky, não precisa de padding-top */
@media (max-width: 1023px) {
  body {
    padding-top: 0 !important;
  }
}

/* Text Gradient */
.text-gradient {
  background: linear-gradient(120deg, #9333EA, #71E9D8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Progress bar - Barra de progresso de leitura */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #9333EA 0%, #7C3AED 50%, #71E9D8 100%);
  z-index: 99999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.5);
  pointer-events: none;
}

/* Enhanced animations for portal experience */
@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.animate-marquee {
  animation: marquee 20s linear infinite;
}

/* Mobile Header - Compacto e Moderno */
.mobile-header {
  display: none;
}

@media (max-width: 1023px) {
  .mobile-header {
    display: block !important;
  }
}

/* Mobile Drawer - Flowbite Style */
#mobile-drawer {
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

#mobile-drawer.show {
  transform: translateX(0) !important;
}

#mobile-drawer-backdrop.show {
  display: block !important;
  opacity: 1;
}

/* Scrollbar hide para categorias mobile */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Responsive Breakpoints */
@media (max-width: 1023px) {
  .desktop-header {
    display: none !important;
  }
  
  .mobile-header {
    display: block !important;
  }

  /* Remove bottom padding since no bottom nav */
  body {
    padding-bottom: 0;
  }
}

@media (min-width: 1024px) {
  .mobile-header,
  #mobile-drawer,
  #mobile-drawer-backdrop {
    display: none !important;
  }
  
  .desktop-header {
    display: block;
  }
}

/* Smooth transitions for mobile navigation */
.mobile-nav-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Haptic feedback simulation */
@media (hover: none) and (pointer: coarse) {
  .mobile-nav-item:active {
    transform: scale(0.95);
  }
}

/* Responsividade para categorias no header */
@media (max-width: 1280px) {
  nav.flex-1 {
    gap: 0.5rem;
  }
  
  .categoria-link {
    font-size: 0.8125rem; /* 13px */
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 1200px) {
  .categoria-link {
    font-size: 0.75rem; /* 12px */
    padding-left: 0.375rem;
    padding-right: 0.375rem;
  }
}

.search-container button:hover {
  transform: scale(1.05);
}

/* Transições suaves para busca */
#searchBox {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lazy Loading - Skeleton e Estados */
.lazy-image-skeleton {
  z-index: 1;
  transition: opacity 0.3s ease;
}

.lazy-image {
  position: relative;
  z-index: 2;
}

.lazy-image.loaded {
  opacity: 1 !important;
}

.lazy-image.loaded + .lazy-image-skeleton,
.lazy-image.loaded ~ .lazy-image-skeleton {
  opacity: 0;
  pointer-events: none;
}

/* Skeleton Animation */
@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.lazy-image-skeleton {
  animation: skeleton-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Blur-up effect para imagens carregadas */
.lazy-image.loading {
  filter: blur(5px);
  transform: scale(1.05);
}

.lazy-image.loaded {
  filter: blur(0);
  transform: scale(1);
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

/* Skeleton melhorado com gradiente */
.lazy-image-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.1) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

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

/* Loading state visual feedback */
.lazy-image.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(128, 74, 255, 0.3);
  border-top-color: #804aff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  z-index: 3;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error state */
.lazy-image.error {
  opacity: 0.5;
}

.lazy-image.error::before {
  content: '⚠️';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  z-index: 3;
}

/* Logo hover effect - sutil sem zoom */
.logo-hover {
  transition: filter 0.3s ease;
}

.logo-hover:hover {
  filter: brightness(1.1);
}

/* Performance: Desabilitar mega menus em dispositivos móveis */
@media (max-width: 1023px) {
  .desktop-header {
    display: none !important;
  }
}

/* Otimizações para tablets */
@media (min-width: 768px) and (max-width: 1023px) {
  .desktop-header {
    display: none !important;
  }
  
  .mobile-header {
    display: block !important;
  }
}

/* Ticker de Notícias - Animação Infinita */
@keyframes scroll-slow {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.ticker-scroll {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}

.animate-scroll-slow {
  animation: scroll-slow 60s linear infinite;
}

/* Garantir que o container do ticker não corte o conteúdo */
.ticker-container {
  overflow: hidden;
  position: relative;
  width: 100%;
}

/* Responsividade do ticker */
@media (max-width: 768px) {
  .animate-scroll-slow {
    animation: scroll-slow 45s linear infinite;
  }
}

@media (max-width: 480px) {
  .animate-scroll-slow {
    animation: scroll-slow 30s linear infinite;
  }
}

