/* ==========================================================================
   DeepSeek V4.1 Flash Weekend Campaign - High-Performance UI Styles
   - Hero Banner (Only on / and /dashboard)
   - Sticky Top Announcement Bar (Non-intrusive)
   - Welcome Modal Popup
   - Floating Action Gift Pill
   - Universal Scrolling Fixes
   ========================================================================== */

/* Universal Scroll Protection - Native Document Scrolling */
html {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-behavior: smooth;
}

body {
  height: auto !important;
  min-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch !important;
}

:root {
  --ds-topbar-height: 42px;
}

body.has-ds-topbar {
  padding-top: 0 !important;
}

/* Push down fixed navigation header so it never collides with the announcement bar */
body.has-ds-topbar header,
body.has-ds-topbar header.fixed,
body.has-ds-topbar header[class*="fixed"] {
  top: var(--ds-topbar-height, 42px) !important;
  transition: top 0.2s ease-in-out;
}

/* Offset dashboard sticky headers if present */
body.has-ds-topbar [data-slot="sidebar-inset"] > header,
body.has-ds-topbar header.sticky,
body.has-ds-topbar header[class*="sticky"] {
  top: var(--ds-topbar-height, 42px) !important;
}

/* Offset page main container to preserve natural vertical spacing */
body.has-ds-topbar main,
body.has-ds-topbar main.container,
body.has-ds-topbar [data-slot="page-content"] {
  padding-top: 0 !important;
}

/* Offset mobile slide-out menu drawer if active */
body.has-ds-topbar div[class*="fixed inset-0 z-40"] {
  top: var(--ds-topbar-height, 42px) !important;
  height: calc(100vh - var(--ds-topbar-height, 42px)) !important;
}

#root,
[data-slot="sidebar-wrapper"],
[data-slot="sidebar-inset"] {
  height: auto !important;
  min-height: 100svh !important;
  overflow: visible !important;
}

[data-slot="sidebar-inset"] > div,
[data-slot="sidebar-inset"] > div.flex.min-h-0.flex-1.flex-col,
[data-slot="sidebar-inset"] main,
[data-slot="page-content"],
.min-h-0.flex-1.overflow-auto {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Ensure bottom key cards & tables are never cut off by mobile browser chrome */
.container,
.container.mx-auto,
.container.mx-auto.max-w-5xl,
[data-slot="sidebar-inset"] .container,
[data-slot="sidebar-inset"] main .container {
  padding-bottom: 9rem !important;
}

/* Prevent text overflow on narrow mobile screens */
[data-slot="sidebar-inset"] table,
[data-slot="sidebar-inset"] .table,
[data-slot="sidebar-inset"] code {
  overflow-wrap: anywhere !important;
}

/* 1. Hero In-Page Banner (Dashboard / Home only) */
#deepseek-weekend-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 360px;
  margin: 0 0 24px;
  border: 1.5px solid #35d9eb66;
  border-radius: 20px;
  background: #061221;
  color: #fff;
  box-shadow: 0 16px 48px rgba(0, 23, 38, 0.4), 0 0 30px rgba(53, 217, 235, 0.15);
  font-family: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#deepseek-weekend-banner:hover {
  box-shadow: 0 20px 56px rgba(0, 23, 38, 0.5), 0 0 40px rgba(53, 217, 235, 0.25);
}
#deepseek-weekend-banner .ds-weekend-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  z-index: -3;
}
#deepseek-weekend-banner .ds-weekend-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #061221f8 0%, #061221e6 42%, #06122188 68%, #06122110 100%);
  z-index: -2;
}
#deepseek-weekend-banner .ds-weekend-content {
  position: relative;
  padding: 28px 32px;
  max-width: 720px;
}
#deepseek-weekend-banner .ds-weekend-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8ceff4;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
#deepseek-weekend-banner .ds-weekend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48e5c5;
  box-shadow: 0 0 14px #48e5c5;
  animation: dsPulseDot 2s infinite;
}
#deepseek-weekend-banner h2 {
  margin: 12px 0 8px;
  font-size: clamp(24px, 3.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -1.2px;
  font-weight: 850;
  color: #fff;
}
#deepseek-weekend-banner h2 strong {
  background: linear-gradient(135deg, #66eef4 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}
#deepseek-weekend-banner .ds-weekend-model {
  margin: 0 0 16px;
  color: #a6bed7;
  font-size: 15px;
}
#deepseek-weekend-banner .ds-weekend-model b {
  color: #eefbff;
}
#deepseek-weekend-banner .ds-weekend-tiers {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
#deepseek-weekend-banner .ds-weekend-tiers > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 16px;
  border: 1px solid #8ed7f144;
  border-radius: 12px;
  background: #12334cb3;
  backdrop-filter: blur(8px);
}
#deepseek-weekend-banner .ds-weekend-tiers b {
  font-size: 22px;
  line-height: 1.15;
  color: #fff;
}
#deepseek-weekend-banner .ds-weekend-tiers small {
  font-size: 12px;
  font-weight: 500;
  color: #94c5d7;
}
#deepseek-weekend-banner .ds-weekend-tiers span {
  font-size: 11.5px;
  color: #d1e7f5;
}
#deepseek-weekend-banner .ds-weekend-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 12px;
}
#deepseek-weekend-banner .ds-weekend-action a,
#deepseek-weekend-banner .ds-weekend-action button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 12px 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
  color: #031525;
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
  transition: all 0.2s ease;
}
#deepseek-weekend-banner .ds-weekend-action a:hover,
#deepseek-weekend-banner .ds-weekend-action button:hover {
  background: linear-gradient(135deg, #7dd3fc 0%, #67e8f9 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(56, 189, 248, 0.5);
}
#deepseek-weekend-banner .ds-weekend-state {
  font-size: 12.5px;
  color: #bcdfeb;
  font-weight: 600;
}
#deepseek-weekend-banner .ds-weekend-rules {
  margin: 0;
  color: #acc4d7;
  font-size: 11px;
  line-height: 1.6;
}
#deepseek-weekend-banner .ds-weekend-rules b {
  color: #d5e9f9;
  font-weight: 700;
}

/* 2. Fixed Top Announcement Bar (Always sits cleanly above navigation header) */
#ds-weekend-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--ds-topbar-height, 42px);
  min-height: 40px;
  z-index: 60;
  background: linear-gradient(90deg, #021a2f 0%, #06395c 40%, #08436c 60%, #021a2f 100%);
  border-bottom: 1px solid #38bdf877;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  box-sizing: border-box;
  overflow: hidden;
}
#ds-weekend-topbar .ds-topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
  width: 100%;
  justify-content: center;
  flex-wrap: nowrap;
}
#ds-weekend-topbar .ds-topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38bdf8;
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
#ds-weekend-topbar .ds-topbar-text {
  font-weight: 650;
  color: #f0f9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#ds-weekend-topbar .ds-topbar-text b {
  color: #38bdf8;
}
#ds-weekend-topbar .ds-topbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 100%);
  color: #031525;
  font-size: 12px;
  font-weight: 850;
  padding: 4px 12px;
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
}
#ds-weekend-topbar .ds-topbar-cta:hover {
  background: linear-gradient(135deg, #7dd3fc 0%, #67e8f9 100%);
  transform: scale(1.04);
}
#ds-weekend-topbar .ds-topbar-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  margin-left: 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s;
}
#ds-weekend-topbar .ds-topbar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* 3. Welcome Modal Dialog */
#ds-weekend-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(2, 10, 20, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: dsFadeIn 0.25s ease-out;
}
#ds-weekend-modal-backdrop[style*="display: none"] {
  display: none !important;
  pointer-events: none !important;
}
#ds-weekend-modal {
  position: relative;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: #061527;
  border: 1.5px solid #38bdf888;
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.25);
  color: #fff;
  font-family: inherit;
  box-sizing: border-box;
  animation: dsModalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#ds-weekend-modal .ds-modal-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  z-index: 0;
}
#ds-weekend-modal .ds-modal-body {
  position: relative;
  z-index: 1;
  padding: 30px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
#ds-weekend-modal .ds-modal-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}
#ds-weekend-modal .ds-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: scale(1.08);
}
#ds-weekend-modal .ds-modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 4px 12px;
  border-radius: 9999px;
  width: fit-content;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
#ds-weekend-modal h3 {
  margin: 0;
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.15;
  font-weight: 850;
  color: #fff;
  letter-spacing: -0.5px;
}
#ds-weekend-modal h3 span {
  background: linear-gradient(135deg, #67e8f9 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
#ds-weekend-modal .ds-modal-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #cbd5e1;
}
#ds-weekend-modal .ds-modal-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 2px 0;
}
#ds-weekend-modal .ds-modal-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(14, 42, 68, 0.7);
  border: 1px solid #38bdf844;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
#ds-weekend-modal .ds-modal-card.highlight {
  border-color: #38bdf8;
  background: rgba(14, 55, 90, 0.85);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}
#ds-weekend-modal .ds-modal-card-val {
  font-size: 20px;
  font-weight: 850;
  color: #fff;
  line-height: 1.2;
}
#ds-weekend-modal .ds-modal-card-val small {
  font-size: 12px;
  font-weight: 600;
  color: #7dd3fc;
}
#ds-weekend-modal .ds-modal-card-sub {
  font-size: 11.5px;
  color: #cbd5e1;
  font-weight: 550;
}
#ds-weekend-modal .ds-modal-note {
  font-size: 11.5px;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0;
}
#ds-weekend-modal .ds-modal-note b {
  color: #e2e8f0;
}
#ds-weekend-modal .ds-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
#ds-weekend-modal .ds-modal-btn-claim {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8 0%, #06b6d4 100%);
  color: #031525;
  font-size: 14.5px;
  font-weight: 850;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
  transition: all 0.2s ease;
}
#ds-weekend-modal .ds-modal-btn-claim:hover {
  background: linear-gradient(135deg, #7dd3fc 0%, #22d3ee 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.6);
}
#ds-weekend-modal .ds-modal-btn-later {
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.2s ease;
}
#ds-weekend-modal .ds-modal-btn-later:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* 4. Floating Action Gift Pill */
#ds-weekend-float-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  text-decoration: none;
  box-shadow: 0 10px 30px -5px rgba(6, 182, 212, 0.6), 0 0 25px rgba(56, 189, 248, 0.4);
  border: 1.5px solid #7dd3fc;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: dsFloatPill 3s infinite ease-in-out;
}
#ds-weekend-float-pill:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 38px -5px rgba(6, 182, 212, 0.8), 0 0 35px rgba(56, 189, 248, 0.6);
  color: #fff;
}
#ds-weekend-float-pill .ds-pill-icon {
  font-size: 16px;
  animation: dsWiggle 2s infinite ease-in-out;
}

/* Animations */
@keyframes dsPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
@keyframes dsFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dsModalPop {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes dsFloatPill {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes dsWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  #deepseek-weekend-banner {
    border-radius: 16px;
    min-height: 0;
  }
  #deepseek-weekend-banner .ds-weekend-content {
    padding: 22px 18px;
  }
  #deepseek-weekend-banner .ds-weekend-art {
    opacity: 0.45;
    object-position: 75% center;
  }
  #deepseek-weekend-banner .ds-weekend-shade {
    background: linear-gradient(90deg, #061221ef, #061221a8);
  }
  #deepseek-weekend-banner h2 {
    font-size: clamp(22px, 7.5vw, 34px);
    letter-spacing: -0.7px;
  }
  #deepseek-weekend-banner .ds-weekend-tiers {
    gap: 8px;
  }
  #deepseek-weekend-banner .ds-weekend-tiers > div {
    padding: 8px 12px;
    flex: 1;
    min-width: 120px;
  }
  #ds-weekend-topbar {
    font-size: 11.5px;
    padding: 0 8px;
    height: var(--ds-topbar-height, 38px);
    min-height: 38px;
  }
  #ds-weekend-topbar .ds-topbar-text {
    max-width: 210px;
  }
  #ds-weekend-topbar .ds-topbar-cta {
    font-size: 10.5px;
    padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  #ds-weekend-topbar .ds-topbar-badge {
    display: none;
  }
  #ds-weekend-topbar .ds-topbar-text {
    max-width: 180px;
  }
  #ds-weekend-modal .ds-modal-cards {
    grid-template-columns: 1fr;
  }
  #ds-weekend-float-pill {
    bottom: 16px;
    right: 16px;
    padding: 8px 14px;
    font-size: 12px;
  }
}
