/* Weekly weekend-flights email: results button + preview modal */

/* ---------- Results bar button ---------- */
.btn-weekly-email {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 5px 14px;
  background: #fff;
  border: 1px solid #139676;
  border-radius: 6px !important;
  color: #0d7159;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.btn-weekly-email:hover {
  background: #eef7f5;
  box-shadow: 0 4px 12px rgba(19, 150, 118, .22);
  transform: translateY(-1px);
}
.btn-weekly-email:active { transform: translateY(0); box-shadow: 0 1px 4px rgba(19, 150, 118, .2); }
.btn-weekly-email:focus { outline: none; }
.btn-weekly-email:focus-visible { box-shadow: 0 0 0 3px rgba(19, 150, 118, .3); }
.btn-weekly-email-icon { display: inline-flex; width: 15px; height: 15px; }
.btn-weekly-email-icon svg,
.ftw-weekly-modal svg {
  width: 100%; height: 100%;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.btn-weekly-email-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 3px rgba(61, 220, 151, .25); animation: weeklyPulse 2s ease-in-out infinite; }
.btn-weekly-email.is-on { background: linear-gradient(135deg, #0d7159 0%, #139676 100%); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(19, 150, 118, .25); }
.btn-weekly-email.is-on .btn-weekly-email-dot { display: inline-block; }
.btn-weekly-email.is-on:hover { box-shadow: 0 4px 12px rgba(19, 150, 118, .35); }
@keyframes weeklyPulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(61, 220, 151, .3); } 50% { box-shadow: 0 0 0 5px rgba(61, 220, 151, .08); } }

@media (max-width: 575.98px) {
  .top-wishlist-actions .btn-weekly-email { flex: 1 1 auto; }
}

/* ---------- Modal shell ---------- */
.ftw-weekly-modal .modal-dialog { max-width: min(1000px, 94vw); margin-top: 28px; margin-bottom: 28px; }
.ftw-weekly-modal .modal-content {
  padding: 0;
  border: 0;
  border-radius: 24px;
  overflow: clip;
  background: #f6faf8;
  box-shadow: 0 30px 90px rgba(6, 30, 24, .38);
  text-align: center;
}
.ftw-weekly-modal.fade .modal-dialog { transform: translateY(24px) scale(.97); transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
.ftw-weekly-modal.show .modal-dialog { transform: none; }

/* Hero */
.weekly-hero {
  position: relative;
  padding: 34px 40px 30px;
  background: radial-gradient(circle at 15% 0%, rgba(61, 220, 151, .25) 0%, rgba(61, 220, 151, 0) 45%),
              linear-gradient(135deg, #0d7159 0%, #123d32 60%, #0b2b23 100%);
  color: #fff;
}
.weekly-close {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px; padding: 9px;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%;
  background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.weekly-close:hover { background: rgba(255, 255, 255, .2); transform: rotate(90deg); }
.weekly-close:focus { outline: none; }
.weekly-close:focus-visible { box-shadow: 0 0 0 3px rgba(158, 226, 202, .5); }
.weekly-hero-icon {
  width: 62px; height: 62px; margin: 0 auto 14px; padding: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #9ee2ca;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .05), 0 10px 30px rgba(0, 0, 0, .25);
  animation: weeklyFloat 3.2s ease-in-out infinite;
}
@keyframes weeklyFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.weekly-kicker { color: #9ee2ca; font-size: 12px; letter-spacing: 2.2px; text-transform: uppercase; }
.weekly-title { margin: 8px 0 6px; color: #fff; font-size: 28px; font-weight: 500; line-height: 1.25; }
.weekly-sub { margin: 0; color: rgba(255, 255, 255, .78); font-size: 15px; }

/* Body */
.weekly-body { padding: 26px 34px 8px; }
.weekly-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.weekly-tile {
  padding: 18px 14px 16px;
  background: #fff;
  border: 1px solid rgba(19, 150, 118, .14);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(12, 50, 63, .06);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: weeklyRise .4s cubic-bezier(.2, .8, .2, 1) both;
}
.weekly-tile:nth-child(2) { animation-delay: .06s; }
.weekly-tile:nth-child(3) { animation-delay: .12s; }
.weekly-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(12, 50, 63, .1); }
.weekly-tile-icon { width: 40px; height: 40px; margin: 0 auto 10px; padding: 9px; border-radius: 12px; background: #eef7f5; color: #139676; }
.weekly-tile-value { color: #173d35; font-size: 18px; font-weight: 500; line-height: 1.3; }
.weekly-tile-email { font-size: 15px; word-break: break-all; }
.weekly-tile-label { margin-top: 3px; color: #7d8d89; font-size: 13px; }
@keyframes weeklyRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.weekly-first,
.weekly-notice {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 16px auto 0; padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px; color: #173d35;
  background: #e5f4ee;
  width: fit-content; max-width: 100%;
}
.weekly-first svg, .weekly-notice svg { width: 18px; height: 18px; flex-shrink: 0; color: #139676; }
.weekly-em { color: #0d7159; font-weight: 500; }
.weekly-notice { background: #fff; border: 1px solid rgba(19, 150, 118, .25); animation: weeklyRise .3s ease both; }
.weekly-notice.is-warn { border-color: rgba(230, 150, 40, .45); background: #fff8ec; }
.weekly-notice.is-warn svg { color: #d98a1c; }

/* Preview */
.weekly-preview-label {
  position: relative;
  margin: 26px 0 12px;
  color: #7d8d89; font-size: 12px; letter-spacing: 1.8px; text-transform: uppercase;
}
.weekly-preview-label::before,
.weekly-preview-label::after { content: ''; position: absolute; top: 50%; width: calc(50% - 120px); height: 1px; background: rgba(19, 150, 118, .18); }
.weekly-preview-label::before { left: 0; }
.weekly-preview-label::after { right: 0; }

.weekly-mail {
  border-radius: 18px;
  overflow: clip;
  background: #fff;
  border: 1px solid rgba(11, 46, 60, .1);
  box-shadow: 0 18px 46px rgba(12, 50, 63, .14);
}
.weekly-mail-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid rgba(11, 46, 60, .08);
}
.weekly-mail-avatar {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d7159 0%, #139676 100%);
  color: #fff; font-size: 12px; letter-spacing: .5px;
}
.weekly-mail-meta { flex: 1; min-width: 0; text-align: center; }
.weekly-mail-from { color: #173d35; font-size: 14px; font-weight: 500; }
.weekly-mail-from span { color: #9aa8a4; font-weight: 400; margin-left: 6px; }
.weekly-mail-subject { margin-top: 2px; color: #61716d; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weekly-mail-when { flex-shrink: 0; color: #9aa8a4; font-size: 12px; }

.weekly-mail-stage { position: relative; background: #eef5f2; min-height: 120px; }
#weekly_preview_iframe { display: block; width: 100%; height: 0; border: 0; opacity: 0; transition: opacity .35s ease; }
#weekly_preview_iframe.is-ready { opacity: 1; }

/* Skeleton */
.weekly-skeleton { padding: 28px 10% 36px; }
.weekly-skeleton .sk {
  border-radius: 14px;
  background: linear-gradient(90deg, #dfeae6 0%, #f3f8f6 50%, #dfeae6 100%);
  background-size: 200% 100%;
  animation: weeklyShimmer 1.3s linear infinite;
}
.sk-head { height: 150px; }
.sk-chips { height: 34px; width: 70%; margin: 16px auto 0; border-radius: 999px !important; }
.sk-hero { height: 220px; margin-top: 18px; }
.sk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.sk-card { height: 170px; }
.weekly-skeleton-text { margin-top: 18px; color: #61716d; font-size: 14px; }
@keyframes weeklyShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Error */
.weekly-error { padding: 50px 20px; }
.weekly-error-icon { width: 46px; height: 46px; margin: 0 auto 10px; color: #d9534f; }
.weekly-error-text { margin-bottom: 16px; color: #173d35; font-size: 15px; }

/* Actions (sticks to the bottom of the window while the modal scrolls) */
.weekly-actions {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin-top: 22px;
  padding: 16px 34px 20px;
  background: rgba(246, 250, 248, .94);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(19, 150, 118, .14);
}
.weekly-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 24px;
  border-radius: 999px; border: 1px solid transparent;
  font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, opacity .18s ease;
}
.weekly-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.weekly-btn:focus { outline: none; }
.weekly-btn:focus-visible { box-shadow: 0 0 0 3px rgba(19, 150, 118, .35); }
.weekly-btn:disabled { opacity: .55; cursor: default; transform: none !important; box-shadow: none !important; }
.weekly-btn-primary {
  min-width: 270px;
  background: linear-gradient(135deg, #0d7159 0%, #139676 100%);
  color: #fff;
  box-shadow: 0 8px 22px rgba(19, 150, 118, .32);
}
.weekly-btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(19, 150, 118, .4); }
.weekly-btn-primary:active:not(:disabled) { transform: translateY(0); box-shadow: 0 4px 12px rgba(19, 150, 118, .3); }
.weekly-btn-primary.is-done { background: linear-gradient(135deg, #139676 0%, #3ddc97 100%); opacity: 1 !important; animation: weeklyPop .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes weeklyPop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.weekly-btn.is-busy { position: relative; }
.weekly-btn.is-busy svg { animation: weeklySpin .9s linear infinite; }
@keyframes weeklySpin { to { transform: rotate(360deg); } }
.weekly-btn-ghost { background: #fff; color: #0d7159; border-color: rgba(19, 150, 118, .3); }
.weekly-btn-ghost:hover:not(:disabled) { background: #eef7f5; transform: translateY(-1px); }
.weekly-btn-ghost:active:not(:disabled) { transform: translateY(0); }
.weekly-btn-danger { background: #fff; color: #c0463f; border-color: rgba(192, 70, 63, .3); }
.weekly-btn-danger:hover:not(:disabled) { background: #fdf0ef; transform: translateY(-1px); }
.weekly-btn-danger:active:not(:disabled) { transform: translateY(0); }

@media (max-width: 767.98px) {
  .weekly-hero { padding: 30px 22px 24px; }
  .weekly-title { font-size: 22px; }
  .weekly-body { padding: 20px 14px 4px; }
  .weekly-tiles { grid-template-columns: 1fr; gap: 8px; }
  .weekly-tile { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 14px; }
  .weekly-tile-icon { width: 34px; height: 34px; margin: 0; padding: 7px; flex-shrink: 0; }
  .weekly-tile-value { font-size: 15px; }
  .weekly-tile-label { margin-top: 0; font-size: 12px; }
  .weekly-first, .weekly-notice { border-radius: 16px; font-size: 13px; }
  .weekly-mail-when { display: none; }
  .weekly-actions { padding: 14px 14px 18px; }
  .weekly-btn-primary { min-width: 0; flex: 1 1 100%; }
}

/* ---------- Several weekly emails per user ---------- */
.btn-weekly-email-count {
  min-width: 19px; height: 19px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: #139676; color: #fff;
  font-size: 11px; line-height: 1;
  animation: weeklyPop .35s cubic-bezier(.2, .8, .2, 1);
}
.btn-weekly-email.is-on .btn-weekly-email-count { background: #fff; color: #0d7159; }

.weekly-mine .weekly-preview-label { margin-top: 22px; }
.weekly-mine-list { display: flex; flex-direction: column; gap: 10px; }
.weekly-mine-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid rgba(19, 150, 118, .14);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(12, 50, 63, .05);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .25s ease;
  animation: weeklyRise .35s cubic-bezier(.2, .8, .2, 1) both;
}
.weekly-mine-row:hover { border-color: rgba(19, 150, 118, .35); box-shadow: 0 8px 22px rgba(12, 50, 63, .09); transform: translateY(-1px); }
.weekly-mine-row.is-current { border-color: rgba(19, 150, 118, .55); box-shadow: 0 0 0 3px rgba(19, 150, 118, .1), 0 8px 22px rgba(12, 50, 63, .08); }
.weekly-mine-row.is-leaving { opacity: .35; transform: scale(.98); }
.weekly-mine-icon { width: 40px; height: 40px; flex-shrink: 0; padding: 9px; border-radius: 12px; background: #eef7f5; color: #139676; }
.weekly-mine-row.is-current .weekly-mine-icon { background: linear-gradient(135deg, #0d7159 0%, #139676 100%); color: #fff; }
.weekly-mine-main { flex: 1; min-width: 0; text-align: center; }
.weekly-mine-from { color: #173d35; font-size: 16px; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.weekly-mine-badge { padding: 2px 9px; border-radius: 999px; background: #139676; color: #fff; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; font-weight: 400; }
.weekly-mine-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 7px; }
.weekly-mine-chip { padding: 3px 10px; border-radius: 999px; background: #f3fbf8; border: 1px solid rgba(19, 150, 118, .18); color: #0d7159; font-size: 12px; white-space: nowrap; }
.weekly-btn-sm { min-height: 36px; padding: 0 16px; font-size: 13px; flex-shrink: 0; }
.weekly-btn-sm svg { width: 15px; height: 15px; }
.weekly-btn-primary.is-subscribed { background: linear-gradient(135deg, #139676 0%, #3ddc97 100%); opacity: 1 !important; }

@media (max-width: 767.98px) {
  .weekly-mine-row { flex-wrap: wrap; justify-content: center; padding: 12px; }
  .weekly-mine-icon { display: none; }
  .weekly-mine-main { flex: 1 1 100%; }
}
