.zier-water-widget {
  max-width: 1290px;
  margin: 24px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.zier-water-header {
  background: #0070e1;
  color: white;
  padding: 40px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.zier-water-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

.zier-water-title {
  margin: 0 0 16px 0;
  font-size: 2.2em;
  font-weight: 800;
  position: relative;
  z-index: 1;
  background: linear-gradient(45deg, #ffffff, #f8f9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.zier-water-subtitle {
  margin: 0;
  opacity: 0.95;
  font-size: 1.1em;
  position: relative;
  z-index: 1;
  font-weight: 400;
  letter-spacing: 0.3px;
}

.zier-water-search-container {
  padding: 40px 32px;
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

.zier-water-input-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.zier-water-input {
  width: 100%;
  padding: 20px 28px;
  border: 2px solid #e1e8ed;
  border-radius: 60px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #2d3748;
}

.zier-water-input::placeholder {
  color: #a0aec0;
  font-weight: 400;
}

.zier-water-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12),
    0 8px 32px rgba(102, 126, 234, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  background: #ffffff;
}

.zier-water-loading {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

.zier-water-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #f1f5f9;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: zier-spin 1s linear infinite;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

@keyframes zier-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.zier-water-results-section {
  padding: 0 32px 40px;
  background: #ffffff;
}

.zier-water-results-title {
  margin: 0 0 24px 0;
  color: #1a202c;
  font-size: 1.4em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f7fafc;
}

.zier-water-results-title::before {
  content: "📍";
  font-size: 1.3em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.zier-water-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  animation: fadeInUp 0.6s ease-out;
}

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

.zier-water-result-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.zier-water-result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(180deg, #5dcae4 0%, #0070e1 100%);
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 16px 16px 0 0;
}

.zier-water-result-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12),
    0 6px 12px rgba(102, 126, 234, 0.08);
  border-color: rgba(102, 126, 234, 0.2);
}

.zier-water-result-card:hover::before {
  transform: scaleX(1);
}

.zier-water-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.zier-water-result-location {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zier-water-result-plz {
  background: linear-gradient(180deg, #5dcae4 0%, #0070e1 100%);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85em;
  box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
  display: inline-block;
  width: fit-content;
}

.zier-water-result-city {
  font-size: 1.1em;
  font-weight: 700;
  color: #1a202c;
  line-height: 1.3;
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.zier-water-result-canton {
  background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.8em;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(113, 128, 150, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
  height: fit-content;
}

.zier-water-result-hardness {
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  z-index: 1;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.zier-water-result-hardness::before {
  content: "💧";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.2em;
  opacity: 0.6;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.zier-water-hardness-label {
  font-size: 0.8em;
  color: #718096;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.zier-water-hardness-value {
  font-size: 1.6em;
  font-weight: 900;
  background: #0070e1;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.5px;
}

.zier-water-result-footer {
  text-align: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.zier-water-updated-date {
  color: #718096;
  font-size: 0.8em;
  font-weight: 500;
  background: linear-gradient(135deg, #f7fafc, #edf2f7);
  padding: 4px 12px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  display: inline-block;
}

.zier-water-no-results,
.zier-water-error {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
  background: linear-gradient(135deg, #f7fafc 0%, #ffffff 100%);
  border-radius: 16px;
  border: 2px dashed #cbd5e0;
  margin: 20px 0;
  animation: fadeInUp 0.6s ease-out;
  grid-column: 1 / -1;
}

.zier-water-no-results-icon,
.zier-water-error-icon {
  font-size: 3em;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

.zier-water-no-results h4,
.zier-water-error h4 {
  margin: 0 0 12px 0;
  color: #1a202c;
  font-size: 1.3em;
  font-weight: 700;
}

.zier-water-no-results p,
.zier-water-error p {
  margin: 0;
  font-size: 1em;
  line-height: 1.6;
  color: #4a5568;
}

/* Адаптивний дизайн */
@media (max-width: 1200px) {
  .zier-water-results {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .zier-water-widget {
    margin: 16px;
    border-radius: 20px;
  }

  .zier-water-header {
    padding: 32px 24px;
  }

  .zier-water-title {
    font-size: 1.8em;
  }

  .zier-water-subtitle {
    font-size: 1em;
  }

  .zier-water-search-container,
  .zier-water-results-section {
    padding: 32px 24px;
  }

  .zier-water-input {
    padding: 18px 24px;
    font-size: 16px;
  }

  .zier-water-results {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .zier-water-result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .zier-water-result-location {
    width: 100%;
  }

  .zier-water-result-city {
    font-size: 1em;
  }

  .zier-water-hardness-value {
    font-size: 1.4em;
  }

  .zier-water-result-card {
    padding: 16px;
    min-height: 180px;
  }
}

@media (max-width: 480px) {
  .zier-water-widget {
    margin: 12px;
    border-radius: 16px;
  }

  .zier-water-header,
  .zier-water-search-container,
  .zier-water-results-section {
    padding: 24px 20px;
  }

  .zier-water-result-card {
    padding: 16px;
    border-radius: 12px;
    min-height: 160px;
  }

  .zier-water-title {
    font-size: 1.6em;
  }

  .zier-water-input {
    padding: 16px 20px;
  }

  .zier-water-hardness-value {
    font-size: 1.3em;
  }
}

/* Темна тема */
@media (prefers-color-scheme: dark) {
  .zier-water-widget {
    background: #1a202c;
    border-color: #2d3748;
  }

  .zier-water-search-container {
    background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
  }

  .zier-water-results-section {
    background: #1a202c;
  }

  .zier-water-input {
    background: #2d3748;
    border-color: #4a5568;
    color: #f7fafc;
  }

  .zier-water-input::placeholder {
    color: #718096;
  }

  .zier-water-result-card {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: #4a5568;
  }

  .zier-water-result-city {
    color: #f7fafc;
  }

  .zier-water-results-title {
    color: #f7fafc;
    border-color: #4a5568;
  }

  .zier-water-result-hardness {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: #4a5568;
  }

  .zier-water-result-footer {
    border-color: #4a5568;
  }

  .zier-water-updated-date {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    border-color: #718096;
    color: #cbd5e0;
  }
}

@media (prefers-contrast: high) {
  .zier-water-result-card {
    border-width: 2px;
  }

  .zier-water-input {
    border-width: 2px;
  }

  .zier-water-result-hardness {
    border-width: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zier-water-result-card,
  .zier-water-input,
  .zier-water-spinner,
  .zier-water-no-results-icon,
  .zier-water-header::before {
    animation: none;
    transition: none;
  }

  .zier-water-result-card:hover {
    transform: none;
  }

  .zier-water-input:focus {
    transform: none;
  }
}

.zier-water-input.focused {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1),
    0 4px 12px rgba(102, 126, 234, 0.15);
}

.zier-water-result-card {
  cursor: pointer;
  animation: slideInUp 0.4s ease-out both;
}

.zier-water-result-card.selected {
  border-color: #667eea;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15),
    0 0 0 2px rgba(102, 126, 234, 0.1);
}

.zier-water-hardness-category {
  font-size: 0.9em;
  margin-top: 8px;
  font-weight: 600;
  opacity: 0.8;
}

.zier-water-retry-btn {
  background: linear-gradient(180deg, #5dcae4 0%, #0070e1 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.3s ease;
}

.zier-water-retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.zier-water-loading[aria-hidden="true"] {
  display: none !important;
}

.zier-water-results-section[aria-hidden="true"] {
  display: none !important;
}

.zier-water-spinner {
  animation: zier-spin 1s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .zier-water-result-card {
    animation: none;
  }

  .zier-water-spinner {
    animation: none;
  }
}

/* color bar */

.wqi-water-quality-indicator {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 20px;
  margin-top: 15px;
  font-family: Arial, sans-serif;
}

.wqi-content {
  width: 100%;
}

.wqi-message {
  color: #2c5aa0;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 20px;
  text-align: left;
}

.wqi-message strong {
  font-weight: bold;
}

.wqi-scale-container {
  position: relative;
  width: 100%;
}

.wqi-scale-bar {
  position: relative;
  height: 40px;
  margin-bottom: 10px;
  width: 100%;
}

.wqi-gradient-bar {
  width: 100%;
  height: 40px;
  background: linear-gradient(
    to right,
    #4caf50 0%,
    #8bc34a 12%,
    #cddc39 30%,
    #ffc107 50%,
    #ff9800 70%,
    #f44336 90%,
    #b71c1c 100%
  );
  border-radius: 4px;
}

.wqi-indicator-arrow {
  position: absolute;
  bottom: -20px;
  width: 20px;
  height: 25px;
  transform: translateX(50%) rotate(180deg);
  z-index: 10;
  top: -15px;
}

.wqi-scale-labels {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 12px;
  color: #2c5aa0;
  margin-top: 8px;
}

.wqi-label-soft,
.wqi-label-hard {
  color: #2c5aa0;
}

@media (max-width: 768px) {
  .wqi-water-quality-indicator {
    padding: 15px;
  }

  .wqi-message {
    font-size: 14px;
  }

  .wqi-scale-bar {
    height: 35px;
  }

  .wqi-gradient-bar {
    height: 35px;
  }

  .wqi-indicator-arrow {
    width: 18px;
    height: 22px;
    bottom: -18px;
  }
}
