/* ==============================================
   MOBILE FOOTER IMPROVEMENTS - ESL Fun Online
   Compact and clean footer design for mobile devices
   ============================================== */

/* Mobile-optimized footer class */
footer.mobile-optimized {
  font-size: 14px;
  line-height: 1.3;
}

footer.mobile-optimized .footer-content {
  display: block;
  text-align: center;
}

footer.mobile-optimized .footer-section ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
}

footer.mobile-optimized .footer-section ul li a {
  font-size: 0.7rem;
  padding: 0.3rem 0.5rem;
  border-radius: 12px;
}

/* Mobile Footer Overrides */
@media (max-width: 768px) {
  /* Overall Footer Compression */
  footer {
    font-size: 14px !important;
  }

  /* Simplified Newsletter Section */
  .footer-newsletter {
    padding: 0.75rem 0 !important;
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
    border-bottom: 1px solid #374151 !important;
  }

  .footer-newsletter .container {
    padding: 0 1rem !important;
  }

  .newsletter-content {
    flex-direction: column !important;
    text-align: center !important;
    gap: 1rem !important;
  }

  .newsletter-text h3 {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
  }

  .newsletter-text p {
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    opacity: 0.9 !important;
  }

  .newsletter-form {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .newsletter-form input {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    min-width: unset !important;
  }

  .btn-newsletter {
    width: 100% !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.9rem !important;
    border-radius: 8px !important;
    justify-content: center !important;
  }

  /* Compact Main Footer */
  footer > .container {
    padding: 0 1rem !important;
  }

  .footer-content {
    display: block !important;
    margin: 1rem 0 0.75rem !important;
    text-align: center !important;
  }

  /* Brand Section - More Compact */
  .footer-brand {
    margin-bottom: 1rem !important;
    padding: 0 !important;
  }

  .brand-header {
    justify-content: center !important;
    gap: 0.6rem !important;
    margin-bottom: 0.5rem !important;
  }

  .footer-logo {
    width: 28px !important;
    height: 28px !important;
    padding: 2px !important;
  }

  .footer-brand h3 {
    font-size: 1rem !important;
    margin: 0 !important;
  }

  .footer-brand p {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
    margin: 0 auto 0.75rem !important;
    max-width: 260px !important;
    opacity: 0.85 !important;
  }

  /* Simplified Footer Sections */
  .footer-section {
    margin-bottom: 1rem !important;
  }

  .footer-section h3 {
    font-size: 0.9rem !important;
    margin-bottom: 0.6rem !important;
    justify-content: center !important;
  }

  .footer-section h3::after {
    display: none !important;
  }

  /* Horizontal Links Layout */
  .footer-section ul {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .footer-section ul li {
    margin: 0 !important;
  }

  .footer-section ul li a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    padding: 0.4rem 0.6rem !important;
    font-size: 0.75rem !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #d1d5db !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
  }

  .footer-section ul li a:hover {
    transform: translateY(-1px) !important;
    background: var(--primary-light) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
  }

  .footer-section ul li a i {
    font-size: 0.7rem !important;
    width: 12px !important;
  }

  /* Compact Footer Bottom */
  .footer-bottom {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 0 !important;
    background: rgba(0, 0, 0, 0.3) !important;
  }

  .footer-bottom-left,
  .footer-bottom-center,
  .footer-bottom-right {
    justify-self: center !important;
    padding: 0 !important;
  }

  .footer-bottom-left {
    order: 2 !important;
  }

  .footer-bottom-left p {
    font-size: 0.8rem !important;
    margin: 0 !important;
    line-height: 1.3 !important;
  }

  .footer-bottom-left .footer-subtitle {
    font-size: 0.7rem !important;
    margin-top: 0.25rem !important;
    opacity: 0.7 !important;
  }

  .footer-bottom-center {
    order: 1 !important;
  }

  .footer-links {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    margin-bottom: 0.5rem !important;
  }

  .footer-links a {
    font-size: 0.75rem !important;
    padding: 0.4rem 0.6rem !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #9ca3af !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    white-space: nowrap !important;
  }

  .footer-links a:hover {
    background: var(--primary-light) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
  }

  .footer-bottom-right {
    order: 3 !important;
  }

  .footer-badges {
    justify-content: center !important;
    gap: 0.5rem !important;
    margin: 0 !important;
  }

  .badge {
    font-size: 0.7rem !important;
    padding: 0.3rem 0.6rem !important;
    border-radius: 12px !important;
  }

  /* Smaller Back to Top */
  .back-to-top {
    width: 44px !important;
    height: 44px !important;
    font-size: 1rem !important;
    bottom: 1rem !important;
    right: 1rem !important;
    box-shadow: 0 2px 12px rgba(70, 187, 229, 0.4) !important;
  }

  .back-to-top:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 4px 16px rgba(70, 187, 229, 0.5) !important;
  }

  /* Hide Social Links on Mobile for Cleaner Look */
  .social-links {
    display: none !important;
  }
}

/* Extra Small Mobile (iPhone SE, etc.) */
@media (max-width: 480px) {
  /* Ultra Compact Mode */
  footer {
    font-size: 13px !important;
  }

  .footer-newsletter {
    padding: 0.5rem 0 !important;
  }

  .newsletter-text h3 {
    font-size: 0.85rem !important;
  }

  .newsletter-text p {
    font-size: 0.75rem !important;
  }

  .newsletter-form input,
  .btn-newsletter {
    padding: 0.5rem 0.7rem !important;
    font-size: 0.8rem !important;
  }

  .footer-content {
    margin: 0.75rem 0 0.5rem !important;
  }

  .footer-brand {
    margin-bottom: 0.75rem !important;
  }

  .footer-brand p {
    font-size: 0.75rem !important;
    max-width: 220px !important;
    margin-bottom: 0.5rem !important;
  }

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

  .footer-section h3 {
    font-size: 0.85rem !important;
    margin-bottom: 0.5rem !important;
  }

  .footer-section ul li a {
    font-size: 0.7rem !important;
    padding: 0.35rem 0.5rem !important;
  }

  .footer-section ul li a i {
    font-size: 0.65rem !important;
  }

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

  .footer-links {
    gap: 0.4rem !important;
  }

  .footer-links a {
    font-size: 0.65rem !important;
    padding: 0.25rem 0.4rem !important;
  }

  .badge {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.4rem !important;
  }

  .back-to-top {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.85rem !important;
    bottom: 0.75rem !important;
    right: 0.75rem !important;
  }
}

/* Ultra Small Mobile (iPhone 5/SE and smaller) */
@media (max-width: 375px) {
  /* Minimal Footer Mode */
  .footer-newsletter {
    padding: 0.4rem 0 !important;
  }

  .newsletter-content {
    gap: 0.6rem !important;
  }

  .newsletter-text h3 {
    font-size: 0.8rem !important;
  }

  .newsletter-text p {
    font-size: 0.7rem !important;
  }

  .newsletter-form {
    gap: 0.5rem !important;
  }

  .newsletter-form input,
  .btn-newsletter {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.75rem !important;
  }

  .footer-content {
    margin: 0.5rem 0 0.4rem !important;
  }

  /* Collapse some sections for ultra-small screens */
  .footer-section:not(.footer-brand):nth-child(n + 4) {
    display: none !important;
  }

  .footer-brand {
    margin-bottom: 0.6rem !important;
  }

  .footer-brand h3 {
    font-size: 0.9rem !important;
  }

  .footer-brand p {
    font-size: 0.7rem !important;
    max-width: 200px !important;
    margin-bottom: 0.4rem !important;
  }

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

  .footer-section h3 {
    font-size: 0.8rem !important;
    margin-bottom: 0.4rem !important;
  }

  .footer-section ul li a {
    font-size: 0.65rem !important;
    padding: 0.3rem 0.45rem !important;
  }

  .footer-section ul li a i {
    font-size: 0.6rem !important;
    width: 10px !important;
  }

  .footer-bottom {
    padding: 0.4rem 0 !important;
    gap: 0.4rem !important;
  }

  .footer-bottom-left p {
    font-size: 0.65rem !important;
  }

  .footer-bottom-left .footer-subtitle {
    font-size: 0.6rem !important;
  }

  .footer-links a {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.35rem !important;
  }

  .badge {
    font-size: 0.55rem !important;
    padding: 0.15rem 0.3rem !important;
  }

  .back-to-top {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8rem !important;
    bottom: 0.5rem !important;
    right: 0.5rem !important;
  }
}

/* Landscape Mobile Optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .footer-newsletter {
    padding: 0.75rem 0 !important;
  }

  .footer-content {
    margin: 1rem 0 0.75rem !important;
  }

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

  .footer-brand p {
    max-width: 90% !important;
  }

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

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

/* Dark Mode Adjustments for Mobile Footer */
.dark-mode .footer-section ul li a {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.dark-mode .footer-links a {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Performance Optimizations for Mobile */
@media (max-width: 768px) {
  footer *,
  .footer-newsletter * {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
  }

  /* Reduce complexity for better mobile performance */
  footer::before {
    display: none !important;
  }

  .footer-section h3::after {
    display: none !important;
  }

  /* Force override any conflicting desktop styles */
  footer {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
  }

  .footer-newsletter {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
  }

  .footer-bottom {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
  }
}
