/**
 * ============================================================================
 * PRYASKAY ABDY — DREAMS SECTION (/dreams) MODERN HERITAGE / MANUSCRIPT LUXE
 * Harmonized with the Native Exterior Shell (#landingPage.app-exterior-shell):
 * Warm Ivory-Cream Canvas + Fading Islamic Gold Lattice,
 * Emerald Sage Canopy (#6EA389 -> #4A7D66 -> #315B48), Copper Trim (#B67943).
 * ============================================================================
 */

/* 1. WARM IVORY-CREAM CANVAS + FADING GOLD GEOMETRIC LATTICE (MATCHES EXTERIOR PAGE) */
html:not(.dark),
html:not(.dark) body,
body.light-mode,
body.light-theme {
  background-color: #F4EFE6 !important;
  background-image:
    radial-gradient(ellipse 68% 72% at 50% 45%, rgba(244, 239, 230, 0.94) 0%, rgba(244, 239, 230, 0.70) 56%, rgba(244, 239, 230, 0.08) 100%),
    url("/images/exterior-gold-pattern.svg?v=3.0"),
    linear-gradient(180deg, #F7F3EB 0%, #EDE5D7 100%) !important;
  background-size: 100% 100%, min(414px, 100%) auto, 100% 100% !important;
  background-position: 0 0, left top, 0 0 !important;
  background-repeat: no-repeat, repeat-y, no-repeat !important;
  color: #1E242B !important;
}

.dreams-header-spacer {
  display: block !important;
  width: 100% !important;
  height: 3.75rem !important;
  flex-shrink: 0 !important;
}

@media (min-width: 640px) {
  .dreams-header-spacer {
    height: 4.5rem !important;
  }
}

html.dark,
html.dark body {
  background: linear-gradient(180deg, #12171D 0%, #161C24 100%) !important;
  background-color: #12171D !important;
  color: #FAF6F0 !important;
}

.dreams-grid-pattern {
  display: none !important;
}

/* 2. EMERALD SAGE TOP NAVBAR (#dreamsHeader) MATCHING .app-top-canopy */
html:not(.dark) #dreamsHeader {
  background:
    radial-gradient(ellipse 90% 70% at 85% 15%, rgba(218, 194, 170, 0.22) 0%, transparent 62%),
    radial-gradient(ellipse 65% 60% at 12% 88%, rgba(182, 121, 67, 0.20) 0%, transparent 62%),
    linear-gradient(156deg, #6EA389 0%, #4A7D66 48%, #315B48 100%) !important;
  backdrop-filter: blur(18px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(140%) !important;
  border-bottom: 1.5px solid rgba(182, 121, 67, 0.56) !important;
  box-shadow: 0 10px 26px -12px rgba(30, 36, 43, 0.28) !important;
}

html.dark #dreamsHeader {
  background:
    radial-gradient(ellipse 80% 60% at 80% 20%, rgba(110, 163, 137, 0.18) 0%, transparent 65%),
    radial-gradient(ellipse 60% 55% at 15% 85%, rgba(182, 121, 67, 0.16) 0%, transparent 62%),
    linear-gradient(156deg, #274A3B 0%, #1B3329 58%, #12201A 100%) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border-bottom: 1.5px solid rgba(182, 121, 67, 0.42) !important;
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.45) !important;
}

@keyframes dreamsPryaskaEmergence {
  0%, 10% {
    opacity: 0;
    transform: translateX(38px) scale(0.72) rotate(-2deg);
    filter: blur(6px);
    clip-path: inset(-30% -20% -35% 100%);
    pointer-events: none;
  }
  22% {
    opacity: 1;
    transform: translateX(-3px) scale(1.04) rotate(0deg);
    filter: blur(0px) drop-shadow(0 2px 8px rgba(217, 119, 6, 0.28));
    clip-path: inset(-30% -20% -35% -20%);
    pointer-events: auto;
  }
  27% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg);
    filter: blur(0px) drop-shadow(0 1px 4px rgba(23, 73, 47, 0.15));
    clip-path: inset(-30% -20% -35% -20%);
  }
  55% {
    opacity: 1;
    transform: translateX(-1.5px) translateY(-1px) scale(1.02);
    filter: blur(0px) drop-shadow(0 3px 10px rgba(217, 119, 6, 0.30));
    clip-path: inset(-30% -20% -35% -20%);
  }
  84% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg);
    filter: blur(0px);
    clip-path: inset(-30% -20% -35% -20%);
    pointer-events: auto;
  }
  95%, 100% {
    opacity: 0;
    transform: translateX(38px) scale(0.72) rotate(-2deg);
    filter: blur(6px);
    clip-path: inset(-30% -20% -35% 100%);
    pointer-events: none;
  }
}

@keyframes dreamsPryaskaStrokeDance {
  0%, 17% {
    opacity: 0;
    transform: scaleX(0) translateX(10px);
    transform-origin: right center;
    background-position: 100% 50%;
    filter: blur(2px);
  }
  28% {
    opacity: 1;
    transform: scaleX(1.08) translateX(-2px);
    transform-origin: right center;
    background-position: 60% 50%;
    filter: blur(0px) drop-shadow(0 1px 6px rgba(245, 158, 11, 0.65));
  }
  34% {
    opacity: 0.96;
    transform: scaleX(0.96) translateX(0);
    transform-origin: center center;
    background-position: 35% 50%;
  }
  48% {
    opacity: 1;
    transform: scaleX(1.05) translateX(-3px);
    transform-origin: center center;
    background-position: 0% 50%;
    filter: blur(0px) drop-shadow(0 2px 8px rgba(251, 191, 36, 0.8));
  }
  64% {
    opacity: 0.95;
    transform: scaleX(0.92) translateX(2px);
    transform-origin: center center;
    background-position: -60% 50%;
    filter: blur(0px) drop-shadow(0 1px 5px rgba(217, 119, 6, 0.5));
  }
  77% {
    opacity: 1;
    transform: scaleX(1.02) translateX(0);
    transform-origin: right center;
    background-position: -100% 50%;
  }
  87%, 100% {
    opacity: 0;
    transform: scaleX(0) translateX(12px);
    transform-origin: right center;
    background-position: 100% 50%;
    filter: blur(2px);
  }
}

#dreamsHeader .logo-text-wrapper {
  overflow: visible !important;
  padding: 0.1rem 0.2rem !important;
}

#dreamsHeader .logo-text-animated,
#dreamsHeader .landing-brand-word,
body.light-mode #dreamsHeader .landing-brand-word,
body.light-theme #dreamsHeader .landing-brand-word,
html.dark #dreamsHeader .landing-brand-word {
  display: inline-block !important;
  animation: none !important;
  clip-path: none !important;
  opacity: 1 !important;
  color: #FAF6F0 !important;
  -webkit-text-fill-color: #FAF6F0 !important;
  font-family: 'Aref Ruqaa', 'Scheherazade New', 'Amiri', serif !important;
  font-size: clamp(1.22rem, 3vw, 1.6rem) !important;
  line-height: 1.3 !important;
  font-weight: 400 !important;
  font-synthesis: none !important;
  letter-spacing: 0 !important;
  padding: 0.04rem 0.25rem 0.14rem !important;
  text-shadow: 0 1px 6px rgba(15, 25, 32, 0.26) !important;
}

#dreamsHeader .landing-brand-word::after {
  content: "" !important;
  display: block !important;
  width: 90% !important;
  height: 1.5px !important;
  margin: -0.02rem auto 0 !important;
  border-radius: 999px !important;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(218, 194, 170, 0.45) 20%,
    rgba(250, 246, 240, 0.85) 50%,
    rgba(218, 194, 170, 0.45) 80%,
    transparent 100%
  ) !important;
}

#dreamsHeader .landing-emblem-box,
#dreamsHeader a[title*="سەرەکی"] > div:first-child {
  background: linear-gradient(145deg, #fdf6ec 0%, #e4d4bd 100%) !important;
  border: 1.5px solid rgba(182, 121, 67, 0.52) !important;
  box-shadow:
    0 4px 12px -2px rgba(15, 25, 32, 0.22),
    inset 0 1px 1px rgba(255, 255, 255, 0.8) !important;
  padding: 2px !important;
}

#dreamsHeader a[title*="سەرەکی"] > div:first-child > div {
  background: transparent !important;
}

#dreamsHeader #btnBackToHome,
#dreamsHeader .pgs-trigger-btn,
#dreamsHeader #btnDialectDropdown {
  background: rgba(250, 246, 240, 0.15) !important;
  border: 1px solid rgba(250, 246, 240, 0.28) !important;
  color: #FAF6F0 !important;
  box-shadow: 0 2px 8px rgba(15, 25, 32, 0.14) !important;
  transition: all 0.2s ease !important;
}

#dreamsHeader #btnBackToHome i,
#dreamsHeader .pgs-trigger-btn i,
#dreamsHeader #btnDialectDropdown i {
  color: #FAF6F0 !important;
}

#dreamsHeader #btnBackToHome:hover,
#dreamsHeader .pgs-trigger-btn:hover,
#dreamsHeader #btnDialectDropdown:hover {
  background: rgba(250, 246, 240, 0.26) !important;
  border-color: rgba(250, 246, 240, 0.45) !important;
  transform: translateY(-1px);
}

/* 3. HERO STAGE — COMPACT WARM IVORY FOLIO */
#dreamsHeroCard {
  background: linear-gradient(168deg, rgba(250, 246, 240, 0.99) 0%, rgba(242, 232, 217, 0.97) 100%) !important;
  border: 1.5px solid rgba(182, 121, 67, 0.42) !important;
  border-radius: 1.5rem !important;
  padding-top: 1.45rem !important;
  padding-bottom: 1.45rem !important;
  box-shadow:
    0 18px 40px -14px rgba(30, 36, 43, 0.18),
    0 6px 14px -6px rgba(30, 36, 43, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
  position: relative !important;
  overflow: hidden !important;
}

@media (max-width: 639px) {
  #dreamsHeroCard {
    padding: 1.15rem 1rem !important;
    border-radius: 1.35rem !important;
  }
}

html.dark #dreamsHeroCard {
  background: linear-gradient(168deg, rgba(28, 36, 46, 0.96) 0%, rgba(21, 28, 36, 0.96) 100%) !important;
  border-color: rgba(182, 121, 67, 0.34) !important;
  box-shadow: 0 20px 44px -14px rgba(0, 0, 0, 0.48) !important;
}

#dreamsHeroCard::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 1.15rem;
  border: 1px solid rgba(182, 121, 67, 0.22);
  pointer-events: none;
  z-index: 1;
}

#dreamsHeroCard::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 1.15rem;
  background: radial-gradient(ellipse 65% 45% at 50% 0%, rgba(255, 250, 232, 0.42) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

html.dark #dreamsHeroCard::after {
  background: radial-gradient(ellipse 65% 45% at 50% 0%, rgba(110, 163, 137, 0.08) 0%, transparent 70%);
}

#dreamsHeroCard > .relative {
  position: relative;
  z-index: 3 !important;
}

.dreams-hero-top-beam {
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(182, 121, 67, 0.72) 50%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}

/* Jewel-Crafted Moon Emblem with Warm Copper-Bronze Glow & Luminous Ivory Moon */
#dreamsHeroMoonBadge {
  width: 3.25rem !important;
  height: 3.25rem !important;
  border-radius: 1rem !important;
  background: linear-gradient(145deg, #D39355 0%, #B67943 52%, #8F5829 100%) !important;
  border: 1px solid rgba(250, 246, 240, 0.55) !important;
  box-shadow:
    0 10px 22px -6px rgba(143, 88, 41, 0.45),
    0 0 18px rgba(182, 121, 67, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.45) !important;
  transition: transform 0.25s ease !important;
}

#dreamsHeroMoonBadge i {
  color: #FAF6F0 !important;
  filter: drop-shadow(0 1px 3px rgba(30, 20, 10, 0.28));
}

#dreamsHeroCard:hover #dreamsHeroMoonBadge {
  transform: scale(1.04);
}

#dreamsPageTitle {
  font-family: 'Aref Ruqaa', 'Scheherazade New', 'Amiri', serif !important;
  font-size: clamp(1.65rem, 3.2vw, 2.25rem) !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
  color: #1E242B !important;
  letter-spacing: 0 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) !important;
  margin-top: 0.15rem !important;
}

html.dark #dreamsPageTitle {
  color: #FAF6F0 !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35) !important;
}

/* Engraved Copper Ornamental Divider Under Hero Title */
#dreamsPageTitle::after {
  content: "";
  display: block;
  width: 5rem;
  height: 2px;
  margin: 0.35rem auto 0.1rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(182, 121, 67, 0.55) 20%,
    #B67943 50%,
    rgba(182, 121, 67, 0.55) 80%,
    transparent 100%
  );
}

#dreamsPageSubtitle {
  font-family: 'Scheherazade New', 'Amiri', serif !important;
  color: #463A2E !important;
  line-height: 1.75 !important;
}

html.dark #dreamsPageSubtitle {
  color: #D7CEBF !important;
}

#dreamsCountBadge,
#dreamsExpertBadgePill {
  background: linear-gradient(145deg, rgba(255, 253, 249, 0.96), rgba(242, 231, 215, 0.94)) !important;
  border: 1px solid rgba(182, 121, 67, 0.38) !important;
  color: #1E242B !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 3px 8px -3px rgba(30, 36, 43, 0.10) !important;
}

/* Eliminate nested box border on the inner label span cleanly across light/dark specificity */
html body #dreamsExpertBadgePill #dreamsExpertBadge,
body.light-mode #dreamsExpertBadgePill #dreamsExpertBadge,
body.light-theme #dreamsExpertBadgePill #dreamsExpertBadge,
html.dark body #dreamsExpertBadgePill #dreamsExpertBadge,
#dreamsExpertBadgePill #dreamsExpertBadge {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: inherit !important;
}

html.dark #dreamsCountBadge,
html.dark #dreamsExpertBadgePill {
  background: rgba(250, 246, 240, 0.08) !important;
  border-color: rgba(182, 121, 67, 0.36) !important;
  color: #FAF6F0 !important;
  box-shadow: none !important;
}

html body #dreamsHeroCard #btnHeroPublishDream,
html body #dreamsHeroCard #btnHeroPublishDream span,
html body #dreamsHeroCard #btnHeroPublishDream i {
  color: #FAF6F0 !important;
  -webkit-text-fill-color: #FAF6F0 !important;
}

#btnHeroPublishDream {
  background: linear-gradient(135deg, #4A7D66 0%, #315B48 100%) !important;
  border: 1px solid rgba(182, 121, 67, 0.45) !important;
  color: #FAF6F0 !important;
  box-shadow: 0 10px 22px -8px rgba(49, 91, 72, 0.45) !important;
}

#btnHeroPublishDream:hover {
  background: linear-gradient(135deg, #568C74 0%, #386853 100%) !important;
  transform: translateY(-1px);
}

/* 4. DREAM POST CARDS — WARM SAND PARCHMENT WITH DUAL TEAL & COPPER ACCENTS */
#dreamPostsFeed .fb-post-card {
  position: relative !important;
  border-radius: 1.55rem !important;
  background: linear-gradient(166deg, rgba(250, 246, 240, 0.99) 0%, rgba(239, 227, 212, 0.97) 100%) !important;
  border: 1.5px solid rgba(218, 194, 170, 0.92) !important;
  box-shadow:
    0 20px 44px -14px rgba(30, 36, 43, 0.24),
    0 6px 14px -4px rgba(30, 36, 43, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.80) !important;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease !important;
  overflow: hidden !important;
}

/* Inner hairline frame around each Dream card */
#dreamPostsFeed .fb-post-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 1.18rem;
  border: 1px solid rgba(182, 121, 67, 0.24);
  pointer-events: none;
  z-index: 1;
  transition: border-color 0.28s ease;
}

#dreamPostsFeed .fb-post-card:hover {
  transform: translateY(-3px) !important;
  border-color: rgba(182, 121, 67, 0.62) !important;
  box-shadow:
    0 26px 52px -14px rgba(30, 36, 43, 0.28),
    0 8px 18px -4px rgba(182, 121, 67, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

#dreamPostsFeed .fb-post-card:hover::before {
  border-color: rgba(74, 125, 102, 0.42);
}

/* Keep card content above ::before hairline */
#dreamPostsFeed .fb-post-card > * {
  position: relative;
  z-index: 2;
}

html.dark #dreamPostsFeed .fb-post-card {
  background: linear-gradient(166deg, rgba(28, 36, 46, 0.96) 0%, rgba(21, 28, 36, 0.96) 100%) !important;
  border-color: rgba(182, 121, 67, 0.34) !important;
  color: #FAF6F0 !important;
}

html.dark #dreamPostsFeed .fb-post-title {
  color: #FAF6F0 !important;
}

#dreamPostsFeed .fb-post-title {
  font-family: 'Vazirmatn', 'Amiri', sans-serif !important;
  font-size: clamp(1.18rem, 2vw, 1.42rem) !important;
  line-height: 1.6 !important;
  color: #1E242B !important;
}

/* Refined Dream (Emerald) & Interpretation (Copper) Boxes inside Card */
#dreamPostsFeed .fb-post-dream-box,
#dreamPostsFeed .fb-post-interpretation-box,
#dreamPostsFeed .fb-post-text-box {
  background: linear-gradient(180deg, rgba(253, 251, 247, 0.98) 0%, rgba(246, 239, 230, 0.96) 100%) !important;
  border-color: rgba(218, 194, 170, 0.55) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 4px 12px -4px rgba(30, 36, 43, 0.08) !important;
}

html.dark #dreamPostsFeed .fb-post-dream-box,
html.dark #dreamPostsFeed .fb-post-interpretation-box,
html.dark #dreamPostsFeed .fb-post-text-box {
  background: rgba(18, 23, 29, 0.72) !important;
  border-color: rgba(182, 121, 67, 0.25) !important;
  color: #FAF6F0 !important;
}

#dreamPostsFeed .fb-post-dream-box {
  border-right-color: #4A7D66 !important;
}

#dreamPostsFeed .fb-post-interpretation-box,
#dreamPostsFeed .fb-post-text-box {
  border-right-color: #B67943 !important;
}

/* Editorial Footer Strip & Simple Clean Reaction Pills */
#dreamPostsFeed .fb-post-card > div:last-child {
  border-top-color: rgba(182, 121, 67, 0.24) !important;
}

#dreamPostsFeed .btn-share-post {
  background: linear-gradient(145deg, rgba(250, 246, 240, 0.98), rgba(235, 222, 206, 0.95)) !important;
  border: 1px solid rgba(182, 121, 67, 0.38) !important;
  color: #1E242B !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 2px 6px rgba(30, 36, 43, 0.08) !important;
  transition: all 0.2s ease !important;
}

#dreamPostsFeed .btn-share-post:hover {
  background: linear-gradient(135deg, #C8894E 0%, #B67943 100%) !important;
  border-color: rgba(154, 94, 47, 0.65) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
}

#dreamPostsFeed .btn-share-post:hover i {
  color: #ffffff !important;
}

/* 5. BOTTOM RETURN PILL & HARMONIZED EMERALD FOOTER */
#dreamsBottomReturnBtn {
  background: linear-gradient(145deg, rgba(250, 246, 240, 0.98), rgba(240, 231, 217, 0.96)) !important;
  border: 1px solid rgba(182, 121, 67, 0.40) !important;
  border-radius: 9999px !important;
  padding: 0.55rem 1.15rem !important;
  color: #1E242B !important;
  box-shadow:
    0 8px 20px -8px rgba(30, 36, 43, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html.dark #dreamsBottomReturnBtn {
  background: rgba(250, 246, 240, 0.08) !important;
  border-color: rgba(182, 121, 67, 0.36) !important;
  color: #FAF6F0 !important;
  box-shadow: none !important;
}

@media (max-width: 640px) {
  #dreamsBottomReturnBtn,
  button[onclick*="openNewDreamModal"],
  button[onclick*="openDreamPostModal"] {
    padding-left: 1.15rem !important;
    padding-right: 1.15rem !important;
  }
}

#dreamsBottomReturnBtn:hover {
  border-color: rgba(74, 125, 102, 0.65) !important;
  transform: translateY(-2px) !important;
  box-shadow:
    0 12px 24px -8px rgba(49, 91, 72, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
}

html body footer,
body.light-mode footer,
body.light-theme footer {
  background: linear-gradient(180deg, rgba(49, 91, 72, 0.96) 0%, rgba(30, 56, 44, 0.98) 100%) !important;
  border-top: 1.5px solid rgba(182, 121, 67, 0.52) !important;
  color: #FAF6F0 !important;
  box-shadow: inset 0 1px 0 rgba(255, 251, 244, 0.12) !important;
}

html body footer span,
html body footer p,
body.light-mode footer span,
body.light-mode footer p {
  color: #FAF6F0 !important;
}

html.dark body footer {
  background: rgba(18, 32, 26, 0.96) !important;
}
