/* Force Light Mode for Mobile Offcanvas Menu */
.offcanvas {
  background-color: #ffffff !important;
}

.offcanvas-header {
  background-color: #ffffff !important;
  border-bottom: 1px solid rgba(0,0,0,0.1) !important;
}

.offcanvas-title {
  color: #000000 !important;
}

.offcanvas .btn-close {
  filter: invert(1) !important;
  opacity: 0.8 !important;
}

.offcanvas-body {
  background-color: #ffffff !important;
}

/* Mobile Nav Icon Alignment Fix */
.offcanvas-body .mobile-nav-link,
.offcanvas-body .nav-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  color: #212529 !important;
}

/* Section Headers */
.mobile-section-header {
  display: flex !important;
  align-items: center !important;
  padding: 0.5rem 1.25rem !important;
  margin-bottom: 0.5rem !important;
  color: #6c757d !important;
  pointer-events: none !important;
}

.mobile-section-header i {
  color: #6c757d !important;
}

.mobile-section-header span {
  color: #6c757d !important;
}

/* Sub-items styling */
.mobile-nav-sub {
  padding-left: 2rem !important;
  min-height: 50px !important;
  background: rgba(99,102,241,0.02) !important;
  font-size: 1rem !important;
}

.mobile-nav-sub:hover {
  background: rgba(99,102,241,0.06) !important;
  transform: translateX(4px) !important;
}

/* Active page indicator */
.mobile-nav-link.active,
.mobile-nav-sub.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.15), rgba(168,85,247,0.1)) !important;
  font-weight: 700 !important;
  border-left: 4px solid #6366f1 !important;
  padding-left: calc(1.25rem - 4px) !important;
  box-shadow: 0 2px 8px rgba(99,102,241,0.15) !important;
}

.mobile-nav-sub.active {
  padding-left: calc(2rem - 4px) !important;
  border-left: 3px solid #6366f1 !important;
}

.mobile-nav-link.active i,
.mobile-nav-sub.active i {
  opacity: 1 !important;
  color: #6366f1 !important;
}

.mobile-nav-link.active span,
.mobile-nav-sub.active span {
  color: #6366f1 !important;
}

/* Active indicator dot */
.mobile-nav-link.active::before,
.mobile-nav-sub.active::before {
  content: '';
  position: absolute;
  right: 1rem;
  width: 8px;
  height: 8px;
  background: #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(99,102,241,0.5);
  animation: pulse 2s infinite;
}

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

.offcanvas-body .mobile-nav-link i,
.offcanvas-body .nav-link i {
  flex-shrink: 0;
  width: 1.5rem;
  margin-right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit !important;
}

/* Ensure icons inherit proper color */
.offcanvas-body .mobile-nav-link:not(.active) i,
.offcanvas-body .mobile-nav-sub:not(.active) i {
  color: #495057 !important;
}

.offcanvas-body .mobile-nav-link span,
.offcanvas-body .nav-link span:not(.dropdown-arrow) {
  flex: 1;
}

/* Dropdown toggle alignment */
.offcanvas-body .dropdown-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100%;
}

.offcanvas-body .dropdown-toggle i {
  flex-shrink: 0;
  width: 1.5rem;
  margin-right: 0.75rem;
}

/* Dropdown items alignment */
.offcanvas-body .dropdown-item {
  display: flex !important;
  align-items: center !important;
}

.offcanvas-body .dropdown-item i {
  flex-shrink: 0;
  width: 1.25rem;
  margin-right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Theme toggle button alignment */
#theme-toggle-mobile {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #212529 !important;
}

#theme-toggle-mobile i {
  flex-shrink: 0;
  margin-right: 0.5rem;
  color: #212529 !important;
}

#theme-toggle-mobile .theme-toggle-label {
  color: #212529 !important;
}

/* Mobile Profile Image - Fix Display Issues */
.mobile-profile-image {
  display: block !important;
  max-width: 140px !important;
  width: 140px !important;
  height: 140px !important;
  margin: 0 auto !important;
  background: transparent !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Force image to load on mobile */
.mobile-profile-image.image-loading {
  opacity: 1 !important;
  filter: none !important;
}

.mobile-profile-image.theme-image {
  display: block !important;
}

/* Ensure image container is visible */
.offcanvas-body .nav-item.text-center {
  display: block !important;
  width: 100% !important;
}

.offcanvas-body .nav-item.text-center a {
  display: block !important;
  width: 100% !important;
}

/* Taco Hover Image - Fix Z-Index for Mobile */
.taco-hover-image {
  position: fixed !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

.taco-img {
  position: relative !important;
  z-index: -1 !important;
}

/* Footer Character Container - Ensure Proper Stacking */
.footer-character-container {
  position: relative !important;
  z-index: 1 !important;
}

.footer-character {
  position: relative !important;
  z-index: 2 !important;
}

/* Ensure footer content stays on top */
.sticky-footer {
  position: relative !important;
  z-index: 1 !important;
}

/* Mobile-specific fixes for actual devices */
@media only screen and (max-width: 768px) {
  /* Force mobile profile image to show */
  .offcanvas .mobile-profile-image {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    min-height: 140px !important;
  }
  
  /* Taco image should be behind everything */
  .taco-hover-image {
    z-index: -10 !important;
  }
  
  /* Footer character on top of taco */
  .footer-character-container {
    z-index: 10 !important;
  }
  
  .footer-character {
    z-index: 15 !important;
  }
  
  /* Art cards and content should be above taco */
  .category-card,
  .category-card-wrapper,
  .artwork-card {
    position: relative !important;
    z-index: 20 !important;
  }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
  .mobile-profile-image {
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
  }
  
  .taco-hover-image {
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
  }
}

