@keyframes skeleton-shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton-block {
  display: block;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
  background-size: 1200px 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
}

[data-theme="dark"] .skeleton-block {
  background: linear-gradient(90deg, #1e293b 25%, #273548 50%, #1e293b 75%);
  background-size: 1200px 100%;
}

.review-section {
  margin-bottom: 2rem;
}

.review-section__empty {
  padding: 1rem 0;
}

.review {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.review__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.review__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.review__edit-link {
  font-size: 0.85rem;
  color: #6b7280;

  &:hover {
    color: #374151;
  }
}

.review__note {
  color: #374151;
  line-height: 1.6;
  white-space: pre-wrap;

  & p {
    margin: 0 0 0.5rem;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

.review-form {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.review-form__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.input--textarea {
  width: 100%;
  height: auto;
  min-height: 100px;
  resize: vertical;
}

.form__group--time-range {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  width: 100%;

  & .form__time-field {
    flex: 1;

    & .input {
      width: 100%;
    }
  }
}

.form__time-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  & .label {
    flex-shrink: 0;
    margin: 0;
  }
}

.form__time-separator--arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  & svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }
}

.form__group--rating {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;

  & .rating-bar {
    flex: 1;
    margin-top: 0;
    max-width: 200px;
  }
}

.label--rating {
  flex-shrink: 0;
  width: 150px;
  font-size: 0.85rem;
  color: #374151;
}

/* Rating bar */
.rating-bar {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  /* border: 1px solid #e5e7eb; */
  border-radius: 2rem;
  margin-top: 0.35rem;
}

.rating-bar__segment {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0;
  /* border-right: 1px solid #e5e7eb; */
  background: #f9fafb;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;

  &:last-child {
    border-right: none;
  }

  &:hover:not(.rating-bar__segment--filled) {
    background: #f3f4f6;
    color: #6b7280;
  }
}

.rating-bar__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.rating-bar__segment--filled {
  color: white;
}

.rating-bar--level-1 .rating-bar__segment--filled {
  background: #ef4444;
  border-right-color: #dc2626;
}

.rating-bar--level-2 .rating-bar__segment--filled,
.rating-bar--level-3 .rating-bar__segment--filled {
  background: #f97316;
  border-right-color: #ea580c;
}

.rating-bar--level-4 .rating-bar__segment--filled,
.rating-bar--level-5 .rating-bar__segment--filled {
  background: #10b981;
  border-right-color: #059669;
}

.rating-bar--readonly .rating-bar__segment {
  cursor: default;
  pointer-events: none;
}

.rating-bar__hint {
  font-weight: 400;
  color: #9ca3af;
  font-size: 0.85rem;
}

/* Readonly display rows */
.review__ratings {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.review__rating-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.review__rating-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.review__rating-label {
  font-size: 0.8rem;
  color: #6b7280;
  flex-shrink: 0;
}

.crowd-rating__read-label {
  margin-left: 0.4rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* ---- Spot show: horizontal report card list ---- */
.review-card-list {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  gap: 1rem;
  padding-bottom: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.review-card-list__empty {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.review-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.review-card__action-edit {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  text-decoration: none;

  &:hover {
    background: #e5e7eb;
    color: #111827;
  }
}

.review-card__action-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;

  & svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
  }

  &:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #ef4444;
  }
}

.review-card {
  position: relative;
  flex-shrink: 0;
  width: 360px;
  max-width: 100%;
  scroll-snap-align: start;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;

  &:hover {
    border-color: #d1d5db;
    background: #fafafa;
  }
}

.review-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.review-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.review-card__overall-rating {
  display: flex;
  gap: 0.05rem;
  line-height: 1;
}

.review-card__star {
  font-size: 1.05rem;
  line-height: 1;
}

.review-card__star--full {
  color: #eab308;
}

.review-card__star--empty {
  color: transparent;
  -webkit-text-stroke: 1.5px #d1d5db;
}

[data-theme="dark"] .review-card__star--empty {
  -webkit-text-stroke-color: #475569;
}

.review-card__date {
  font-weight: 700;
  font-size: 0.95rem;
  color: #111827;
}

.review-card__time {
  /* font-size: 0.75rem; */
  color: #9ca3af;
  white-space: nowrap;
}

.review-card__sport,
.review-card__wind {
  font-size: 0.7rem;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}

/* Rating rows */
.review-card__ratings {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.review-card__rating-row {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.review-card__rating-label {
  /* font-size: 0.72rem; */
  color: #6b7280;
  white-space: nowrap;
  width: 111px;
  flex-shrink: 0;
}

.review-card__rating-bar {
  flex: 1;
  height: 24px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
}

.review-card__rating-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.review-card__rating-bar--r1 .review-card__rating-fill { background: #ef4444; }
.review-card__rating-bar--r2 .review-card__rating-fill { background: #f97316; }
.review-card__rating-bar--r3 .review-card__rating-fill { background: #eab308; }
.review-card__rating-bar--r4 .review-card__rating-fill { background: #84cc16; }
.review-card__rating-bar--r5 .review-card__rating-fill { background: #10b981; }

.review-card__note {
  /* font-size: 0.78rem; */
  color: #6b7280;
  /* line-height: 1.4; */
  margin: 0;
}

.review-card__forecast {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.25rem 0;
  /* border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6; */
}

.review-card__forecast-item {
  /* font-size: 0.78rem; */
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.review-card__forecast-item--temp {
  font-size: 1.5em;
}

.review-card__forecast-muted {
  color: #9ca3af;
}

.review-card__forecast .wind-arrow {
  font-size: 0.85rem;
  display: inline;
}

[data-theme="dark"] .review-card__forecast {
  border-top-color: #334155;
}

[data-theme="dark"] .review-card__forecast-item { color: #cbd5e1; }
[data-theme="dark"] .review-card__forecast-muted { color: #64748b; }

[data-theme="dark"] .review-card {
  background: #1e293b;
  border-color: #334155;

  &:hover { background: #273548; }
}

[data-theme="dark"] .review-card__date { color: #f1f5f9; }
[data-theme="dark"] .review-card__time { color: #64748b; }
[data-theme="dark"] .review-card__rating-label { color: #94a3b8; }
[data-theme="dark"] .review-card__rating-bar { background: #334155; }
[data-theme="dark"] .review-card__note { color: #94a3b8; }

/* Wind experience picker */
.wind-experience-picker {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wind-experience-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.6rem 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  min-width: 6rem;
  flex: 1;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;

  &:has(input:checked) {
    background: #eff6ff;
    border-color: #3b82f6;
  }

  &:hover {
    border-color: #93c5fd;
  }
}

.wind-experience-card__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.wind-experience-card__icon {
  font-size: 1.3rem;
  line-height: 1;
}

.wind-experience-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.wind-experience-card__desc {
  font-size: 0.65rem;
  color: #6b7280;
  line-height: 1.3;
}
