/* ============================================================
   VESTRA REALTY — Developer Stories ("My Day")
   Stories strip on buyer dashboard + full-screen viewer overlay
   ============================================================ */

/* ── Stories Strip (Buyer Dashboard) ─────────────────────────── */

.vr-stories-strip {
  max-width: 620px;
  margin: 0 auto var(--vr-space-2);
}

.vr-stories-scroll {
  display: flex;
  gap: var(--vr-space-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0 6px;
}

.vr-stories-scroll::-webkit-scrollbar {
  display: none;
}

/* Individual story card — small rectangle with image preview */
.vr-story-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 148px;
  border-radius: var(--vr-radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--vr-duration-fast) var(--vr-ease-smooth);
  border: 2.5px solid transparent;
}

.vr-story-thumb:active {
  transform: scale(0.95);
}

/* Green ring border for unseen, gray for viewed */
.vr-story-thumb--unseen {
  border-color: var(--vr-green-500);
}

.vr-story-thumb--viewed {
  border-color: var(--vr-text-muted);
  opacity: 0.85;
}

.vr-story-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dark gradient overlay at bottom for text */
.vr-story-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--vr-space-6) var(--vr-space-2) var(--vr-space-2);
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.vr-story-thumb-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  margin-bottom: 1px;
}

/* Initial letter fallback when developer has no logo */
.vr-story-thumb-initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--vr-green-600);
  border: 1.5px solid #fff;
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--vr-font-body);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

.vr-story-thumb-name {
  font-family: var(--vr-font-body);
  font-size: 10px;
  font-weight: 500;
  color: #fff;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

/* Empty state */
.vr-stories-empty {
  display: flex;
  align-items: center;
  gap: var(--vr-space-3);
  padding: var(--vr-space-3) var(--vr-space-4);
  background: var(--vr-surface-card);
  border-radius: var(--vr-radius-lg);
  border: 1px dashed rgba(28,107,63,0.12);
}

.vr-stories-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--vr-radius-md);
  background: var(--vr-surface-body);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--vr-text-muted);
  flex-shrink: 0;
}

.vr-stories-empty-text {
  font-family: var(--vr-font-body);
  font-size: var(--vr-text-xs);
  color: var(--vr-text-muted);
  line-height: 1.4;
}

@media (min-width: 768px) {
  .vr-story-thumb {
    width: 108px;
    height: 168px;
  }
}

/* ── Full-Screen Story Viewer ─────────────────────────────────── */

.vr-story-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}

/* Progress bars container */
.vr-story-progress {
  display: flex;
  gap: 3px;
  padding: var(--vr-space-2) var(--vr-space-3);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
}

.vr-story-progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 1px;
  overflow: hidden;
}

.vr-story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 1px;
  width: 0%;
  transition: none;
}

.vr-story-progress-fill--complete {
  width: 100% !important;
}

.vr-story-progress-fill--animating {
  transition: width linear;
}

/* Header (developer info + close) */
.vr-story-header {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--vr-space-3);
}

.vr-story-dev-info {
  display: flex;
  align-items: center;
  gap: var(--vr-space-2);
}

.vr-story-dev-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,0.4);
}

.vr-story-dev-initial {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--vr-green-600);
  border: 1.5px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--vr-font-body);
  font-size: var(--vr-text-sm);
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

.vr-story-dev-name {
  font-family: var(--vr-font-body);
  font-size: var(--vr-text-sm);
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.vr-story-time {
  font-family: var(--vr-font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-left: var(--vr-space-2);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.vr-story-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: var(--vr-space-1);
  line-height: 1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  -webkit-tap-highlight-color: transparent;
}

/* Image */
.vr-story-image-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.vr-story-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tap zones */
.vr-story-tap-prev,
.vr-story-tap-next {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  z-index: 2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.vr-story-tap-prev { left: 0; }
.vr-story-tap-next { right: 0; width: 60%; }

/* Caption at bottom */
.vr-story-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: var(--vr-space-8) var(--vr-space-4) var(--vr-space-6);
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  font-family: var(--vr-font-body);
  font-size: var(--vr-text-sm);
  color: #fff;
  line-height: 1.4;
  white-space: normal;
}

/* ── Developer Portal — My Day Panel ──────────────────────────── */

.vr-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--vr-space-3);
}

.vr-story-card {
  position: relative;
  border-radius: var(--vr-radius-lg);
  overflow: hidden;
  background: var(--vr-surface-card);
  border: 1px solid rgba(28,107,63,0.08);
  transition: box-shadow var(--vr-duration-fast) var(--vr-ease-smooth);
}

.vr-story-card:hover {
  box-shadow: var(--vr-shadow-md);
}

.vr-story-card-img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
}

.vr-story-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--vr-space-3);
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.vr-story-card-caption {
  font-family: var(--vr-font-body);
  font-size: var(--vr-text-xs);
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vr-story-card-meta {
  display: flex;
  align-items: center;
  gap: var(--vr-space-2);
  margin-top: var(--vr-space-1);
  font-family: var(--vr-font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.8);
}

.vr-story-card-actions {
  position: absolute;
  top: var(--vr-space-2);
  right: var(--vr-space-2);
}

.vr-story-card-delete {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--vr-duration-fast) var(--vr-ease-smooth);
}

.vr-story-card-delete:hover {
  background: var(--vr-coral);
}

/* Upload area in developer panel */
.vr-story-upload-area {
  background: var(--vr-surface-card);
  border: 2px dashed rgba(28,107,63,0.15);
  border-radius: var(--vr-radius-lg);
  padding: var(--vr-space-6);
  text-align: center;
  margin-bottom: var(--vr-space-4);
}

.vr-story-upload-preview {
  max-width: 200px;
  max-height: 300px;
  border-radius: var(--vr-radius-md);
  margin: var(--vr-space-3) auto;
  display: block;
  object-fit: contain;
}

.vr-story-caption-input {
  width: 100%;
  max-width: 400px;
  padding: var(--vr-space-2) var(--vr-space-3);
  border: 1px solid rgba(28,107,63,0.15);
  border-radius: var(--vr-radius-md);
  font-family: var(--vr-font-body);
  font-size: var(--vr-text-sm);
  color: var(--vr-text-dark);
  background: var(--vr-surface-body);
  outline: none;
  margin: var(--vr-space-2) auto;
  display: block;
}

.vr-story-caption-input:focus {
  border-color: var(--vr-green-500);
}

.vr-story-char-count {
  font-family: var(--vr-font-body);
  font-size: 11px;
  color: var(--vr-text-muted);
  text-align: center;
}

@media (max-width: 767px) {
  .vr-stories-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
