/* ========================================
   KK Dating UI Enhancements
   Modern, polished interface improvements
   ======================================== */

/* ---- Global Transitions ---- */
* {
  transition: all 0.2s ease;
}

/* ---- Input Fields Enhancement ---- */
.van-field {
  position: relative;
  transition: all 0.3s ease;
}

.van-field::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #a78bfa 0%, #7c3aed 100%);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.van-field:focus-within::after {
  width: 100%;
}

.van-field:focus-within {
  background: rgba(167, 139, 250, 0.05) !important;
  border-radius: 8px;
}

.van-field__control {
  transition: all 0.3s ease;
}

.van-field__control:focus {
  transform: translateY(-1px);
}

/* ---- Button Enhancement ---- */
.van-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.van-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.van-button:active::before {
  width: 300px;
  height: 300px;
}

.van-button--primary {
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
}

.van-button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(167, 139, 250, 0.4);
}

.van-button--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(167, 139, 250, 0.3);
}

/* ---- Card Enhancement ---- */
.van-cell,
.register-card,
.login-card,
.forgot-card {
  transition: all 0.3s ease;
}

.van-cell:hover {
  background: rgba(167, 139, 250, 0.03);
}

/* ---- Auth Pages Enhancement ---- */
.auth-brand {
  transition: all 0.3s ease;
}

.auth-brand:hover {
  transform: scale(1.05);
}

.auth-brand-icon {
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 8px rgba(167, 139, 250, 0.3));
}

.auth-brand:hover .auth-brand-icon {
  filter: drop-shadow(0 4px 12px rgba(167, 139, 250, 0.5));
  transform: rotate(5deg);
}

/* ---- Link Enhancement ---- */
a,
.router-link {
  position: relative;
  transition: all 0.3s ease;
}

a::after,
.router-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #a78bfa 0%, #7c3aed 100%);
  transition: width 0.3s ease;
}

a:hover::after,
.router-link:hover::after {
  width: 100%;
}

/* ---- Popup Enhancement ---- */
.van-popup {
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Loading States ---- */
.van-button--loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.van-button--loading::before {
  display: none;
}

/* ---- Success/Error States ---- */
.van-field--error {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ---- Tab Bar Enhancement ---- */
.van-tabbar-item {
  transition: all 0.3s ease;
}

.van-tabbar-item--active {
  transform: translateY(-4px);
}

.van-tabbar-item__icon {
  transition: all 0.3s ease;
}

.van-tabbar-item--active .van-tabbar-item__icon {
  transform: scale(1.2);
}

/* ---- Avatar Enhancement ---- */
.member-avatar,
.user-avatar {
  transition: all 0.3s ease;
  border: 3px solid transparent;
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%) border-box;
}

.member-avatar:hover,
.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.4);
}

/* ---- List Items Enhancement ---- */
.van-cell::after {
  transition: all 0.3s ease;
}

.van-cell:active::after {
  background: rgba(167, 139, 250, 0.1);
}

/* ---- Search Bar Enhancement ---- */
.van-search {
  transition: all 0.3s ease;
}

.van-search:focus-within {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.2);
}

/* ---- Badge Enhancement ---- */
.van-badge {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ---- Empty State Enhancement ---- */
.van-empty {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Message Bubbles ---- */
.message-bubble {
  transition: all 0.3s ease;
}

.message-bubble:hover {
  transform: translateX(4px);
}

/* ---- Wallet Cards ---- */
.wallet-card,
.balance-card {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.wallet-card::before,
.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
}

.wallet-card:hover::before,
.balance-card:hover::before {
  left: 100%;
}

/* ---- Settings List ---- */
.settings-item {
  transition: all 0.3s ease;
  position: relative;
}

.settings-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 60%;
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
  transform: translateY(-50%);
  transition: width 0.3s ease;
  border-radius: 0 4px 4px 0;
}

.settings-item:hover::before {
  width: 4px;
}

.settings-item:hover {
  padding-left: 20px;
}

/* ---- Moment Cards ---- */
.moment-card {
  transition: all 0.3s ease;
}

.moment-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(167, 139, 250, 0.2);
}

/* ---- Loading Spinner ---- */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ---- Notification Dot ---- */
.notification-dot {
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* ---- Smooth Page Transitions ---- */
.page-enter-active,
.page-leave-active {
  transition: all 0.3s ease;
}

.page-enter-from {
  opacity: 0;
  transform: translateX(20px);
}

.page-leave-to {
  opacity: 0;
  transform: translateX(-20px);
}

/* ---- Tooltip Enhancement ---- */
.tooltip {
  animation: tooltipFadeIn 0.2s ease;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Skeleton Loading ---- */
.skeleton {
  background: linear-gradient(90deg, #1f1f30 25%, #2a2a3e 50%, #1f1f30 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ---- Ripple Effect ---- */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ---- Floating Action Button ---- */
.fab {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

/* ---- Progress Bar ---- */
.progress-bar {
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ---- Dark Mode Specific ---- */
@media (prefers-color-scheme: dark) {
  .van-field:focus-within {
    background: rgba(167, 139, 250, 0.08) !important;
  }
  
  .van-cell:hover {
    background: rgba(167, 139, 250, 0.05);
  }
}

/* ---- Mobile Optimization ---- */
@media (max-width: 768px) {
  .van-button--primary:hover {
    transform: none;
  }
  
  .van-button--primary:active {
    transform: scale(0.98);
  }
  
  .moment-card:hover {
    transform: none;
  }
}

/* ---- Accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
