/* ResourceFieldsView.css */

.resource-fields-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.village-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6B8E23 0%, #556B2F 50%, #8FBC8F 100%);
  background-size: cover;
  background-position: center;
}

/* Alternative background pattern if no image */
.village-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(139, 69, 19, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(34, 139, 34, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(160, 82, 45, 0.2) 0%, transparent 70%);
  opacity: 0.6;
}

.resource-fields-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: default;
}

/* Resource field circles */
.resource-field-circle {
  cursor: pointer;
  transition: all 0.3s ease;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.resource-field-circle:hover {
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
  transform: scale(1.05);
}

.field-glow {
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.5;
    r: 43;
  }
  50% {
    opacity: 0.8;
    r: 48;
  }
}

.resource-icon {
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.8));
}

/* Tooltip */
.resource-tooltip {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(to bottom, rgba(42, 24, 16, 0.98), rgba(26, 15, 10, 0.98));
  border: 3px solid #8B7355;
  border-radius: 12px;
  padding: 0;
  min-width: 250px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  z-index: 100;
  animation: tooltipFadeIn 0.2s ease-out;
}

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

.tooltip-header {
  background: linear-gradient(to right, #8B7355, #5D4E37);
  padding: 12px 18px;
  border-radius: 9px 9px 0 0;
  color: #FFD700;
  font-size: 16px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tooltip-body {
  padding: 15px 18px;
  color: #F5DEB3;
}

.tooltip-body p {
  margin: 8px 0;
  font-size: 14px;
}

.tooltip-body .bonus {
  color: #FFD700;
  font-weight: bold;
}

.tooltip-body .hint {
  color: #DAA520;
  font-style: italic;
  font-size: 12px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(139, 115, 85, 0.5);
}

/* Resource type colors */
.wood-field {
  fill: rgba(139, 69, 19, 0.7);
}

.clay-field {
  fill: rgba(205, 133, 63, 0.7);
}

.iron-field {
  fill: rgba(112, 128, 144, 0.7);
}

.crop-field {
  fill: rgba(218, 165, 32, 0.7);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .resource-tooltip {
    top: auto;
    bottom: 80px;
    right: 10px;
    left: 10px;
    min-width: auto;
  }
  
  .resource-field-circle {
    stroke-width: 2;
  }
}

/* Touch device improvements */
@media (hover: none) {
  .resource-field-circle:active {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
  }
}
