/* pages/wiki/identify/index.wxss */

.identify-page {
  min-height: 100vh;
  background: #F4F6F0;
}

/* ========== Shared State Container ========== */
.state-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 48rpx;
  box-sizing: border-box;
  padding-bottom: 20%; /* Push up visually */
}

.state-card {
  background: #fff;
  border-radius: 48rpx;
  padding: 64rpx 48rpx;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40rpx;
  box-shadow: 0 20rpx 60rpx rgba(85, 139, 47, 0.15);
}

/* ========== Loading State ========== */
.loading-image-wrap {
  width: 440rpx;
  height: 440rpx;
  border-radius: 40rpx;
  overflow: hidden;
  position: relative;
  box-shadow: 0 12rpx 40rpx rgba(0,0,0,0.15);
}

.loading-preview {
  width: 100%;
  height: 100%;
  display: block;
}

/* Scan overlay breathing effect */
.scan-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(85, 139, 47, 0) 30%, rgba(85, 139, 47, 0.15) 100%);
  animation: pulseBg 2s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes pulseBg {
  0% { opacity: 0.2; }
  100% { opacity: 0.65; }
}

/* Premium neon scan line animation */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 8rpx;
  background: linear-gradient(90deg, rgba(85, 139, 47, 0) 0%, rgba(139, 195, 74, 1) 50%, rgba(85, 139, 47, 0) 100%);
  animation: scan 2.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  box-shadow: 0 0 20rpx rgba(139, 195, 74, 0.9), 0 0 40rpx rgba(85, 139, 47, 0.5);
}

@keyframes scan {
  0% { top: 0%; opacity: 0.8; }
  50% { top: 98%; opacity: 1; }
  100% { top: 0%; opacity: 0.8; }
}

.loading-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12rpx;
}

/* Animated dots */
.loading-dots {
  display: flex;
  gap: 12rpx;
  margin-bottom: 8rpx;
}

.dot {
  width: 16rpx;
  height: 16rpx;
  border-radius: 50%;
  background: #558B2F;
  animation: dotPulse 1.4s infinite ease-in-out;
}

.dot2 { animation-delay: 0.2s; }
.dot3 { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.state-title {
  font-size: 34rpx;
  font-weight: 700;
  color: #1F2937;
}

.state-hint {
  font-size: 26rpx;
  color: #9CA3AF;
}

/* ========== Error State ========== */
.error-icon-wrap {
  width: 140rpx;
  height: 140rpx;
  border-radius: 50%;
  background: #FFF5F5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-actions {
  display: flex;
  gap: 24rpx;
  margin-top: 16rpx;
  width: 100%;
  justify-content: center;
}

/* ========== Shared Action Buttons ========== */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10rpx;
  padding: 20rpx 36rpx;
  border-radius: 48rpx;
  font-size: 28rpx;
  font-weight: 600;
  transition: all 0.2s;
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn.primary {
  background: linear-gradient(135deg, #558B2F, #689F38);
  color: #fff;
  box-shadow: 0 8rpx 24rpx rgba(85, 139, 47, 0.25);
}

.action-btn.primary text {
  color: #fff;
}

.action-btn.outline {
  background: #fff;
  color: #558B2F;
  border: 2rpx solid #C5E1A5;
}

.action-btn.outline text {
  color: #558B2F;
}

.action-btn.full {
  width: 100%;
}

/* ========== Results: Hero Section ========== */
.results-scroll {
  height: 100vh;
}

.hero-section {
  position: relative;
  height: 480rpx;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 280rpx;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.65));
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40rpx;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8rpx;
  background: rgba(85, 139, 47, 0.85);
  backdrop-filter: blur(8rpx);
  color: #fff;
  font-size: 24rpx;
  font-weight: 600;
  padding: 8rpx 20rpx;
  border-radius: 24rpx;
  margin-bottom: 12rpx;
}

.hero-badge text {
  color: #fff;
}

.hero-plant-name {
  font-size: 52rpx;
  font-weight: 800;
  color: #fff;
  display: block;
  text-shadow: 0 4rpx 12rpx rgba(0,0,0,0.3);
}

/* ========== Results: Detail Card ========== */
.detail-card-wrapper {
  padding: 0 32rpx;
  margin-top: -40rpx;
  position: relative;
  z-index: 10;
}

.detail-card {
  background: #fff;
  border-radius: 32rpx;
  padding: 36rpx;
  box-shadow: 0 8rpx 32rpx rgba(0,0,0,0.06);
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 20rpx;
  margin-bottom: 24rpx;
}

/* Rank badge */
.result-rank {
  width: 56rpx;
  height: 56rpx;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28rpx;
  font-weight: 800;
  flex-shrink: 0;
}

.result-rank.best {
  background: linear-gradient(135deg, #558B2F, #689F38);
  color: #fff;
  box-shadow: 0 6rpx 16rpx rgba(85, 139, 47, 0.3);
}

.result-rank.normal {
  background: #F3F4F6;
  color: #6B7280;
}

.result-name-area {
  flex: 1;
}

.result-main-name {
  font-size: 36rpx;
  font-weight: 800;
  color: #1F2937;
  display: block;
  margin-bottom: 4rpx;
}

.confidence-text {
  font-size: 24rpx;
  color: #558B2F;
  font-weight: 600;
}

/* Confidence Bar */
.confidence-bar-wrap {
  margin-bottom: 24rpx;
}

.confidence-bar-bg {
  height: 12rpx;
  background: #F3F4F6;
  border-radius: 6rpx;
  overflow: hidden;
}

.confidence-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #689F38, #558B2F);
  border-radius: 6rpx;
  transition: width 0.8s ease-out;
}

.result-description {
  font-size: 26rpx;
  color: #6B7280;
  line-height: 1.8;
  display: block;
  margin-bottom: 28rpx;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

.detail-card-actions {
  display: flex;
  gap: 16rpx;
}

/* ========== Results: Other Results ========== */
.other-section {
  padding: 32rpx 32rpx 0;
}

.section-title {
  font-size: 30rpx;
  font-weight: 700;
  color: #374151;
  display: block;
  margin-bottom: 20rpx;
  padding-left: 8rpx;
}

.other-list {
  background: #fff;
  border-radius: 28rpx;
  overflow: hidden;
  box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.03);
}

.other-item {
  display: flex;
  align-items: center;
  padding: 28rpx 32rpx;
  gap: 20rpx;
  border-bottom: 1rpx solid #F3F4F6;
  transition: background 0.15s;
}

.other-item:last-child {
  border-bottom: none;
}

.other-item:active {
  background: #FAFFF5;
}

.other-item-info {
  flex: 1;
  min-width: 0;
}

.other-item-name {
  font-size: 30rpx;
  font-weight: 600;
  color: #374151;
  display: block;
  margin-bottom: 10rpx;
}

/* Mini bars */
.mini-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12rpx;
}

.mini-bar-bg {
  flex: 1;
  height: 8rpx;
  background: #F3F4F6;
  border-radius: 4rpx;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #A5D6A7, #66BB6A);
  border-radius: 4rpx;
}

.mini-bar-text {
  font-size: 22rpx;
  color: #9CA3AF;
  font-weight: 600;
  flex-shrink: 0;
  width: 80rpx;
  text-align: right;
}

/* ========== Bottom Section ========== */
.bottom-section {
  padding: 32rpx 32rpx 0;
}
