/* GymDiet Master — Story Share Modal & Preview Styles (9:16 Viral Cards) */

.story-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: storyFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes storyFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.story-modal-box {
  width: 100%;
  max-width: 440px;
  max-height: 94vh;
  background: linear-gradient(165deg, #111827 0%, #0c121d 60%, #080d14 100%);
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(0, 240, 255, 0.15);
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: storySlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

@keyframes storySlideUp {
  from {
    transform: translateY(30px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.story-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.story-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.story-modal-title span.badge-viral {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 118, 0.2));
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: #00f0ff;
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.04em;
}

.story-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #cbd5e1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.story-modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: scale(1.05);
}

.story-modal-body {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  gap: 14px;
}

/* Mode Switcher Tabs */
.story-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
  border-radius: 14px;
  width: 100%;
  box-sizing: border-box;
}

.story-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.story-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 118, 0.15));
  color: #00f0ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 240, 255, 0.35);
}

/* 9:16 Story Card Preview Container */
.story-card-preview-wrap {
  width: 100%;
  max-width: 270px;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 240, 255, 0.25);
  border: 2px solid rgba(0, 240, 255, 0.3);
  background: #090d16;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.story-card-preview-wrap:hover {
  transform: scale(1.02);
}

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

.story-card-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(9, 13, 22, 0.9);
  color: #00f0ff;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
}

.story-spinner-circle {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 240, 255, 0.2);
  border-top-color: #00f0ff;
  border-radius: 50%;
  animation: storySpin 0.8s linear infinite;
}

@keyframes storySpin {
  to {
    transform: rotate(360deg);
  }
}

/* Action Buttons */
.story-modal-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 8px;
  padding: 6px 20px 18px;
  box-sizing: border-box;
}

.btn-story-primary {
  background: linear-gradient(135deg, #00f0ff 0%, #00f076 100%);
  color: #050a12;
  font-size: 15px;
  font-weight: 800;
  padding: 13px 20px;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.35);
  transition: all 0.2s;
  letter-spacing: 0.01em;
}

.btn-story-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(0, 240, 255, 0.45);
}

.btn-story-secondary-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.btn-story-sub {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-story-sub:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.3);
  color: #ffffff;
}

/* Completion View Integration Buttons */
.btn-story-share-trigger {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(0, 240, 118, 0.15));
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: #00f0ff;
  font-size: 15px;
  font-weight: 800;
  padding: 13px 20px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.15);
}

.btn-story-share-trigger:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 240, 118, 0.25));
  border-color: #00f0ff;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-pr-share-trigger {
  background: linear-gradient(135deg, #ffd600 0%, #ff9100 100%);
  color: #000000;
  border: none;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(255, 214, 0, 0.35);
  transition: all 0.2s;
}

.btn-pr-share-trigger:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}
