/* =========================
   Tech Footer
   ========================= */

.site-footer {
  position: relative;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 0;
  overflow: hidden;
}

/* Animated background layers */
.footer-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.footer-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

.footer-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 15%, #000 85%, transparent);
}

.footer-scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(6, 182, 212, 0.04) 50%,
    transparent 100%
  );
  background-size: 100% 8px;
  animation: footerScan 6s linear infinite;
}

@keyframes footerScan {
  from { background-position: 0 -100%; }
  to   { background-position: 0 200%; }
}

.footer-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: footerOrbFloat 8s ease-in-out infinite alternate;
}

.footer-glow-orb--primary {
  width: 320px;
  height: 320px;
  background: var(--color-primary);
  top: -80px;
  right: 10%;
}

.footer-glow-orb--accent {
  width: 260px;
  height: 260px;
  background: var(--color-accent);
  bottom: -60px;
  left: 8%;
  animation-delay: -3s;
}

@keyframes footerOrbFloat {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(20px, -15px) scale(1.08); }
}

/* Main grid */
.footer-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 1.1fr;
  gap: 40px;
  padding: 72px 0 48px;
}

.footer-col {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.footer-col.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.footer-col:nth-child(1) { transition-delay: 0.05s; }
.footer-col:nth-child(2) { transition-delay: 0.15s; }
.footer-col:nth-child(3) { transition-delay: 0.25s; }

/* ---- Map column (right in RTL) ---- */
.footer-map-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.footer-map-frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, 0.25);
  background: rgba(15, 23, 42, 0.6);
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.12),
    0 20px 50px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  width: 100%;
  max-width: 100%;
}

.footer-map-frame:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 24px rgba(6, 182, 212, 0.2),
    0 24px 56px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.footer-map-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.5),
    transparent 40%,
    rgba(37, 99, 235, 0.4)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.footer-map-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
  font-size: 0.82rem;
  color: #94a3b8;
  font-family: "Courier New", monospace;
}

.footer-map-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
  animation: footerPulse 2s ease infinite;
}

.footer-map-status {
  margin-right: auto;
  color: var(--color-accent);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

@keyframes footerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.85); }
}

.footer-map-frame iframe {
  display: block;
  width: 100%;
  height: 220px;
  border: 0;
  filter: saturate(0.85) contrast(1.05);
  transition: filter var(--transition-normal);
}

.footer-map-frame:hover iframe {
  filter: saturate(1) contrast(1.08);
}

.footer-map-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--color-accent);
  border-style: solid;
  opacity: 0.7;
  z-index: 3;
  pointer-events: none;
}

.footer-map-corner--tl { top: 42px;  right: 8px;  border-width: 2px 2px 0 0; }
.footer-map-corner--br { bottom: 8px; left: 8px;   border-width: 0 0 2px 2px; }

.footer-address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #94a3b8;
}

.footer-address i {
  color: var(--color-accent);
  margin-top: 4px;
  flex-shrink: 0;
}

.footer-map-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-accent) !important;
  transition: gap var(--transition-fast), color var(--transition-fast);
}

.footer-map-link:hover {
  gap: 12px;
  color: var(--color-surface) !important;
}

/* ---- Links column ---- */
.footer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-surface);
  font-size: 1.05rem;
  margin-bottom: 22px;
  position: relative;
}

.footer-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, rgba(6, 182, 212, 0.4), transparent);
}

.footer-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.15);
  color: var(--color-accent);
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.footer-title-sub {
  margin-top: 32px;
  margin-bottom: 16px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-footer-text);
  font-weight: 500;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    padding-right var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.footer-nav a::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--color-accent);
  border-radius: 2px;
  transition: height var(--transition-fast);
}

.footer-nav a:hover,
.footer-nav a.active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-surface);
  padding-right: 18px;
  transform: translateX(-4px);
}

.footer-nav a:hover::before,
.footer-nav a.active::before {
  height: 60%;
}

.link-code {
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  color: var(--color-accent);
  opacity: 0.7;
  min-width: 28px;
}

.footer-nav a:hover .link-code,
.footer-nav a.active .link-code {
  opacity: 1;
}

.footer-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-tech-tag {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: #94a3b8;
  transition: all var(--transition-fast);
  cursor: default;
}

.footer-tech-tag:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.35);
  color: var(--color-surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* ---- Brand column ---- */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: inherit;
  transition: transform var(--transition-fast);
}

.footer-brand:hover {
  transform: scale(1.02);
  color: inherit;
}

.footer-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.3));
  animation: footerLogoGlow 3s ease-in-out infinite alternate;
}

@keyframes footerLogoGlow {
  from { filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.2)); }
  to   { filter: drop-shadow(0 0 16px rgba(37, 99, 235, 0.4)); }
}

.footer-brand h3 {
  color: var(--color-surface);
  font-size: 1.15rem;
  margin-bottom: 4px;
  line-height: 1.4;
}

.footer-brand-tag {
  display: inline-block;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  color: var(--color-accent);
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.footer-desc {
  font-size: 0.92rem;
  line-height: 1.85;
  color: #94a3b8;
  margin-bottom: 22px;
}

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.footer-contact-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--color-footer-text);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-contact-list a i {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-accent);
  font-size: 0.85rem;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.footer-contact-list a:hover {
  color: var(--color-surface);
  transform: translateX(-3px);
}

.footer-contact-list a:hover i {
  background: rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--color-footer-text);
  font-size: 1rem;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.footer-social a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.footer-social a i {
  position: relative;
  z-index: 1;
}

.footer-social a:hover {
  color: var(--color-surface);
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.footer-social a:hover::after {
  opacity: 1;
}

/* ---- Bottom bar ---- */
.footer-bottom {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  flex-wrap: wrap;
}

.footer-bottom p {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
}

.footer-tech-line {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  color: var(--color-accent);
  direction: ltr;
}

.typing-cursor {
  animation: footerBlink 1s step-end infinite;
  color: var(--color-primary);
}

@keyframes footerBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

.footer-back-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(6, 182, 212, 0.3);
  background: var(--color-footer-bg);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-normal);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.footer-back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.footer-back-top:hover {
  background: var(--color-primary);
  color: var(--color-surface);
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

/* =========================
   Responsive Footer
   ========================= */

@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-map-wrap {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 56px 0 40px;
  }

  .footer-map-wrap {
    grid-column: span 1;
  }

  .footer-map-frame iframe {
    height: 180px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .footer-back-top {
    bottom: 20px;
    left: 20px;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 576px) {
  .footer-inner {
    padding: 48px 0 32px;
    gap: 24px;
  }

  .footer-col {
    opacity: 1;
    transform: none;
  }

  .footer-brand img {
    width: 56px;
    height: 56px;
  }

  .footer-brand h3 {
    font-size: 1rem;
  }

  .footer-desc {
    font-size: 0.88rem;
  }

  .footer-contact-list {
    gap: 8px;
  }

  .footer-contact-list a {
    font-size: 0.85rem;
  }

  .footer-contact-list a i {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .footer-social {
    gap: 8px;
  }

  .footer-social a {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .footer-nav a {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .footer-tech-tag {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .footer-map-frame iframe {
    height: 160px;
  }

  .footer-bottom p {
    font-size: 0.82rem;
  }

  .footer-tech-line {
    font-size: 0.78rem;
  }

  .footer-back-top {
    bottom: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
  }
}
