@use './variables.scss' as *;

// Reset
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: $font-size-md;
  line-height: 1.5;
  color: $color-text-primary;
  background-color: $color-bg-primary;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// Safe area for notch devices
.safe-area-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

// Utility classes
.text-center {
  text-align: center;
}

.text-primary {
  color: $color-primary;
}

.text-gold {
  color: $color-gold;
}

.text-muted {
  color: $color-text-muted;
}

.bg-primary {
  background-color: $color-primary;
}

.bg-gold {
  background-color: $color-gold;
}

// Guochao decorative elements
.guochao-border {
  border: 2px solid $color-gold;
  border-radius: $radius-lg;
  position: relative;

  &::before,
  &::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid $color-gold;
  }

  &::before {
    top: -6px;
    left: -6px;
    border-right: none;
    border-bottom: none;
  }

  &::after {
    bottom: -6px;
    right: -6px;
    border-left: none;
    border-top: none;
  }
}

// Gold gradient text
.gold-text {
  background: linear-gradient(135deg, $color-gold-light 0%, $color-gold 50%, $color-gold-dark 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

// Red gradient button
.btn-primary {
  background: linear-gradient(135deg, $color-primary-light 0%, $color-primary 100%);
  color: $color-text-inverse;
  border: none;
  border-radius: $radius-lg;
  padding: $spacing-md $spacing-lg;
  font-size: $font-size-lg;
  font-weight: 500;
  box-shadow: $shadow-md;
  transition: all $transition-normal;

  &:active {
    transform: scale(0.98);
    box-shadow: $shadow-sm;
  }
}

// Card style
.card {
  background: $color-bg-card;
  border-radius: $radius-lg;
  box-shadow: $shadow-md;
  padding: $spacing-md;
}

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

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

// Loading skeleton
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: $radius-sm;
}

// Vant overrides
:root {
  --van-primary-color: #{$color-primary};
  --van-success-color: #{$color-success};
  --van-warning-color: #{$color-warning};
  --van-danger-color: #{$color-error};
  --van-text-color: #{$color-text-primary};
  --van-text-color-2: #{$color-text-secondary};
  --van-text-color-3: #{$color-text-muted};
  --van-border-color: #{$color-border};
  --van-background: #{$color-bg-primary};
  --van-background-2: #{$color-bg-secondary};
}
