/* Mobile Menu Animations and Styles */

/* Backdrop */
#mobile-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  cursor: pointer;
}

#mobile-menu-backdrop:not(.hidden) {
  display: block !important;
}

#mobile-menu-backdrop.mobile-backdrop-open {
  opacity: 1;
}

#mobile-menu-backdrop.mobile-backdrop-closing {
  opacity: 0;
}

/* Mobile Menu Container */
#mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  height: 100dvh;
  background: var(--bg, #ffffff);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-out;
  display: flex;
  flex-direction: column;
  padding-top: 1rem;
}

/* Override Tailwind hidden when menu is open */
#mobile-menu.mobile-menu-open {
  display: flex !important;
}

#mobile-menu:not(.hidden) {
  display: flex;
}

#mobile-menu.mobile-menu-open {
  transform: translateX(0);
  opacity: 1;
}

#mobile-menu.mobile-menu-closing {
  transform: translateX(100%);
  opacity: 0;
}

/* Mobile Menu Header */
.mobile-menu-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-between;
  z-index: 10;
}

.mobile-menu-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-center;
  border-radius: 0.5rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-menu-close:hover {
  background: rgba(56, 161, 216, 0.1);
  color: #38a1d8;
}

/* Mobile Menu Items */
.mobile-menu-item {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  opacity: 0;
  animation: slideInRight 0.3s ease-out forwards;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
  background: var(--card);
  border-left-color: #38a1d8;
  color: #38a1d8;
  transform: translateX(4px);
}

.mobile-menu-item.active {
  background: rgba(56, 161, 216, 0.1);
  border-left-color: #38a1d8;
  color: #38a1d8;
}

/* Menu Item Icon */
.mobile-menu-item-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.75rem;
  display: inline-block;
  vertical-align: middle;
}

/* Mobile Wallet Section */
.mobile-wallet-section {
  margin: 1.5rem;
  padding: 1rem;
  background: var(--card);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  opacity: 0;
  animation: slideInRight 0.3s ease-out forwards;
  animation-delay: 0.3s;
}

.mobile-connect-btn {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #38a1d8 0%, #2e7fb3 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(56, 161, 216, 0.3);
}

.mobile-connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 161, 216, 0.4);
}

.mobile-connect-btn:active {
  transform: translateY(0);
}

/* Mobile Account Info */
.mobile-account-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(56, 161, 216, 0.1);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}

.mobile-account-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #38a1d8 0%, #2e7fb3 100%);
  display: flex;
  align-items: center;
  justify-center;
  color: white;
  font-weight: 600;
}

.mobile-disconnect-btn {
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-disconnect-btn:hover {
  background: #ef4444;
  color: white;
}

/* Mobile Menu Footer */
.mobile-menu-footer {
  margin-top: auto;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
  animation-delay: 0.4s;
}

.mobile-social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.mobile-social-link {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  transition: all 0.2s;
}

.mobile-social-link:hover {
  background: rgba(56, 161, 216, 0.1);
  color: #38a1d8;
  transform: translateY(-2px);
}

/* Animations */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Dark mode adjustments */
[data-theme='dark'] #mobile-menu {
  background: #0f1419;
}

[data-theme='dark'] .mobile-menu-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .mobile-menu-close {
  background: #1a1f26;
}

[data-theme='dark'] .mobile-wallet-section {
  background: #1a1f26;
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .mobile-menu-footer {
  border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .mobile-social-link {
  background: #1a1f26;
}

/* Responsive adjustments */
@media (max-width: 360px) {
  #mobile-menu {
    width: 90%;
  }
}
