/**
 * TeleWorld Footer Styles
 * Extracted from footer.php inline <style> block.
 * Enqueued via functions.php teleworld_enqueue_scripts().
 */

/* Footer Dark Theme — single authoritative declaration */
.site-footer,
footer#colophon {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%) !important;
  color: #e2e8f0 !important;
  padding: 40px 0 20px !important;
  margin: 0 !important;
  min-height: auto !important;
  height: auto !important;
  border: none !important;
  box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER GRID — 5-column desktop layout
   ═══════════════════════════════════════════════════════════════════════════ */

.footer-grid {
  display: grid !important;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr !important;
  gap: 2rem;
  padding: 0;
}

.footer-section .footer-title {
  background: linear-gradient(135deg, #ffffff 0%, #8b5cf6 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid rgba(139, 92, 246, 0.4);
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER BOTTOM BAR — copyright + legal links + certifications in one row
   ═══════════════════════════════════════════════════════════════════════════ */

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.footer-bottom-content {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-legal {
  display: flex !important;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-legal .copyright {
  color: #64748b;
  font-size: 0.85rem;
  margin: 0;
  white-space: nowrap;
}

.legal-links {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.legal-links li {
  display: inline;
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-links a {
  color: #94a3b8;
  font-size: 0.82rem;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition:
    color 0.3s ease,
    background 0.3s ease;
}

.legal-links a:hover {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
}

.footer-certifications {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
}

.cert-icon {
  font-size: 0.9rem;
}

.site-footer .footer-main,
.site-footer .footer-bottom,
.site-footer .footer-section {
  background: transparent !important;
  background-image: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UNIFORM COLUMN ROW GAPS — enterprise-standard equal spacing
   ═══════════════════════════════════════════════════════════════════════════ */

.site-footer .footer-links {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
}

.site-footer .footer-links li {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.site-footer .footer-links li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: bottom;
}

.site-footer .footer-links li:hover {
  background: rgba(139, 92, 246, 0.1);
  transform: translateX(5px);
  box-shadow:
    0 2px 8px rgba(139, 92, 246, 0.2),
    0 0 20px rgba(139, 92, 246, 0.1);
}

.site-footer .footer-links li:hover::before {
  transform: scaleY(1);
}

.site-footer .footer-links li a {
  display: block;
  padding: 0.3rem 0.6rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  line-height: 1.4;
}

.site-footer .footer-links li:hover a {
  color: #8b5cf6;
  transform: translateX(2px);
  text-decoration: none;
}

/* Enhanced Contact Info Styles */
.footer-section.contact-info .contact-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-section.contact-info .contact-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.6rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.footer-section.contact-info .contact-item:hover {
  background: rgba(139, 92, 246, 0.1);
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.footer-section.contact-info .contact-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: bottom;
}

.footer-section.contact-info .contact-item:hover::before {
  transform: scaleY(1);
}

.footer-section.contact-info .contact-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  transition: all 0.3s ease;
}

.footer-section.contact-info .contact-item:hover .contact-icon {
  transform: scale(1.2) rotate(5deg);
  filter: brightness(1.2);
}

.footer-section.contact-info .contact-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 1;
  line-height: 1.4;
}

.footer-section.contact-info .contact-item:hover .contact-link {
  color: #8b5cf6;
  transform: translateX(2px);
}

.footer-section.contact-info .contact-link:hover {
  color: #a855f7;
  text-decoration: none;
}

/* Add subtle glow effect on hover */
.footer-section.contact-info .contact-item:hover {
  box-shadow:
    0 2px 8px rgba(139, 92, 246, 0.2),
    0 0 20px rgba(139, 92, 246, 0.1);
}

/* Staggered animation delay for each item */
.footer-section.contact-info .contact-item:nth-child(1) {
  animation-delay: 0.1s;
}

.footer-section.contact-info .contact-item:nth-child(2) {
  animation-delay: 0.2s;
}

.footer-section.contact-info .contact-item:nth-child(3) {
  animation-delay: 0.3s;
}

.footer-section.contact-info .contact-item:nth-child(4) {
  animation-delay: 0.4s;
}

.footer-section.contact-info .contact-item:nth-child(5) {
  animation-delay: 0.5s;
}

/* Company description paragraph — desktop */
.site-footer .company-description {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #94a3b8;
  margin-bottom: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER SOCIAL LINKS — explicit color for SVG icons
   ═══════════════════════════════════════════════════════════════════════════ */

.site-footer .social-links {
  display: flex !important;
  gap: 0.85rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.site-footer .social-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(139, 92, 246, 0.1) !important;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  color: #8b5cf6 !important;
  text-decoration: none;
  transition: all 0.3s ease;
}

.site-footer .social-link svg {
  fill: currentColor;
  width: 20px;
  height: 20px;
}

.site-footer .social-link:hover {
  background: rgba(139, 92, 246, 0.25) !important;
  border-color: #8b5cf6;
  color: #a855f7 !important;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Contact section
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 1024px) ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr !important;
    gap: 1.5rem;
  }

  .footer-section.contact-info .contact-item:hover {
    transform: translateX(3px);
  }

  .site-footer .social-link:hover {
    transform: none;
  }
}

/* ── Mobile (≤ 768px) ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer-section.contact-info .contact-item {
    padding: 0.75rem 0.5rem;
    gap: 1rem;
  }

  .footer-section.contact-info .contact-icon {
    font-size: 1.1rem;
    width: 22px;
    height: 22px;
  }

  .footer-section.contact-info .contact-link {
    font-size: 0.85rem;
  }

  .footer-section.contact-info .contact-item:hover {
    transform: translateX(3px);
  }

  .site-footer .social-links {
    justify-content: center;
    gap: 0.75rem;
  }

  .site-footer .social-link {
    width: 44px;
    height: 44px;
  }

  .footer-section.contact-info {
    padding-right: 0;
    margin-left: 0;
  }

  .footer-section:not(.company-info):not(.contact-info) {
    margin-left: 0;
  }
}

/* ── Small mobile (≤ 480px) ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .footer-section.contact-info .contact-item {
    padding: 0.65rem 0.4rem;
    gap: 0.75rem;
  }

  .footer-section.contact-info .contact-icon {
    font-size: 1rem;
    width: 20px;
    height: 20px;
  }

  .footer-section.contact-info .contact-link {
    font-size: 0.8rem;
  }

  .site-footer .social-links {
    gap: 0.6rem;
  }

  .site-footer .social-link {
    width: 40px;
    height: 40px;
  }

  .site-footer .social-link svg {
    width: 18px;
    height: 18px;
  }

  .footer-section.contact-info .contact-item:hover {
    transform: none;
  }
}

/* ── Extra small (≤ 360px) ───────────────────────────────────────────── */
@media (max-width: 360px) {
  .footer-section.contact-info .contact-item {
    padding: 0.55rem 0.3rem;
    gap: 0.6rem;
  }

  .footer-section.contact-info .contact-link {
    font-size: 0.75rem;
  }

  .site-footer .social-link {
    width: 36px;
    height: 36px;
  }

  .site-footer .social-link svg {
    width: 16px;
    height: 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Footer grid, bottom bar, AI widget
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 1024px) ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-section:not(.company-info):not(.contact-info) .footer-links li:hover {
    transform: none;
    padding-left: 0;
  }

  .footer-section:not(.company-info):not(.contact-info)
    .footer-links
    li
    a:hover {
    transform: none;
  }
}

/* ── Mobile (≤ 768px) ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 0 1rem !important;
  }

  .footer-section {
    margin-bottom: 1.5rem !important;
  }

  .footer-section.company-info {
    text-align: center !important;
    order: 1 !important;
  }

  .footer-section.contact-info {
    order: 2 !important;
  }

  .footer-bottom-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
    text-align: center !important;
    padding: 0 1rem !important;
  }

  .footer-certifications {
    order: 1 !important;
    display: flex !important;
    justify-content: center !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
  }

  .footer-legal {
    order: 2 !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .legal-links {
    justify-content: center !important;
    flex-wrap: wrap !important;
  }

  /* AI chat widget — adapt for mobile */
  #tw-ai-panel {
    width: calc(100vw - 16px) !important;
    right: 8px !important;
    bottom: 96px !important;
    max-height: calc(100vh - 120px) !important;
    border-radius: 12px !important;
  }

  #tw-ai-toggle-btn {
    width: 52px !important;
    height: 52px !important;
    bottom: 20px !important;
    right: 16px !important;
  }
}

/* ── Small mobile (≤ 480px) ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .footer-grid {
    gap: 1.5rem !important;
    padding: 0 0.75rem !important;
  }

  .footer-section {
    margin-bottom: 1rem !important;
  }

  .footer-bottom-content {
    padding: 0 0.75rem !important;
    gap: 1.25rem !important;
  }

  .cert-item {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.5rem !important;
  }

  .legal-links a {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.5rem !important;
  }

  .copyright {
    font-size: 0.8rem !important;
  }

  /* AI chat widget — full width */
  #tw-ai-panel {
    width: calc(100vw - 12px) !important;
    right: 6px !important;
    bottom: 88px !important;
    height: calc(100vh - 110px) !important;
    max-height: calc(100vh - 110px) !important;
  }

  #tw-ai-toggle-btn {
    width: 48px !important;
    height: 48px !important;
    bottom: 16px !important;
    right: 12px !important;
  }
}

/* ── Extra small (≤ 360px) ───────────────────────────────────────────── */
@media (max-width: 360px) {
  .footer-grid {
    gap: 1.25rem !important;
    padding: 0 0.5rem !important;
  }

  .footer-bottom-content {
    padding: 0 0.5rem !important;
    gap: 1rem !important;
  }

  .cert-item {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.4rem !important;
  }

  .legal-links a {
    font-size: 0.7rem !important;
  }

  .copyright {
    font-size: 0.75rem !important;
  }

  .footer-section:not(.company-info):not(.contact-info) .footer-links li a {
    font-size: 0.82rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LANDSCAPE ORIENTATION — compact footer
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-height: 500px) and (orientation: landscape) {
  .site-footer {
    padding: 20px 0 10px !important;
  }

  .footer-main {
    padding: 15px 0 10px !important;
  }

  .footer-bottom {
    padding: 8px 0 12px !important;
  }

  .footer-section.contact-info .contact-item {
    padding: 0.4rem 0.5rem;
  }

  /* AI widget in landscape */
  #tw-ai-panel {
    height: calc(100vh - 80px) !important;
    max-height: calc(100vh - 80px) !important;
    bottom: 70px !important;
  }

  #tw-ai-toggle-btn {
    width: 46px !important;
    height: 46px !important;
    bottom: 12px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SAFE AREA INSETS — notched / curved-screen devices
   ═══════════════════════════════════════════════════════════════════════════ */

@supports (padding: env(safe-area-inset-bottom)) {
  .footer-bottom {
    padding-bottom: calc(25px + env(safe-area-inset-bottom)) !important;
  }

  .mobile-social {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  #tw-ai-toggle-btn {
    bottom: calc(28px + env(safe-area-inset-bottom)) !important;
  }

  #tw-ai-panel {
    bottom: calc(100px + env(safe-area-inset-bottom)) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .footer-section.contact-info .contact-item,
  .footer-section.contact-info .contact-icon,
  .footer-section.contact-info .contact-link,
  .footer-section.contact-info .contact-item::before,
  .site-footer .social-link,
  .cert-item,
  .legal-links a,
  .footer-section:not(.company-info):not(.contact-info) .footer-links li,
  .footer-section:not(.company-info):not(.contact-info) .footer-links li a,
  .footer-section:not(.company-info):not(.contact-info)
    .footer-links
    li
    a::before {
    transition: none !important;
    animation: none !important;
  }
}

/* Focus states (WCAG 2.4.7) */
.site-footer .social-link:focus-visible,
.site-footer .footer-links a:focus-visible,
.site-footer .contact-link:focus-visible,
.site-footer .legal-links a:focus-visible,
.site-footer .cert-item:focus-visible,
#tw-ai-toggle-btn:focus-visible,
#tw-ai-panel button:focus-visible,
#tw-ai-panel a:focus-visible,
#ai-chat-input:focus-visible {
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
}

/* Touch targets (WCAG 2.5.5) — 44×44px minimum */
@media (max-width: 900px) {
  .site-footer .footer-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .site-footer .contact-item {
    min-height: 44px;
  }

  .site-footer .legal-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  .site-footer,
  footer#colophon,
  .site-footer.site-footer {
    background: #000 !important;
    border-top-color: #fff !important;
  }

  .site-footer .social-link {
    border-color: #fff !important;
    color: #fff !important;
  }

  .site-footer .footer-links a,
  .site-footer .contact-link,
  .site-footer .legal-links a {
    color: #fff !important;
  }

  .site-footer .footer-title {
    color: #fff !important;
  }

  .cert-item {
    color: #fff !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  .site-footer {
    background: #fff !important;
    color: #000 !important;
    padding: 1rem 0 !important;
    border-top: 1px solid #333 !important;
  }

  .site-footer .social-links,
  .site-footer .footer-certifications,
  #tw-ai-toggle-btn,
  #tw-ai-panel {
    display: none !important;
  }

  .site-footer .footer-links a,
  .site-footer .contact-link,
  .site-footer .legal-links a {
    color: #000 !important;
  }

  .site-footer .footer-title {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
  }

  .site-footer .logo-text {
    -webkit-text-fill-color: #000 !important;
    color: #000 !important;
  }

  .site-footer .copyright {
    color: #333 !important;
  }
}
