/* Custom Colors & Base Styles */
:root {
  --color-primary: #002247;
  /* Dark Blue */
  --color-secondary-light: #f3f4f4;
  /* Very Light Gray */
  --color-secondary-white: #ffffff;
  /* White */
  --color-accent-gold: #d9b860;
  /* Gold */
  --color-accent-blue: #007fc3;
  /* Bright Blue */
  --color-text-light: #ffffff;
  --color-text-dark: #1f2937;
  --color-text-medium: #343a40;
  /* Gray-600 */
  --nav-height: 64px;
  /* Height of the sticky nav */
}

html {
  scroll-padding-top: var(--nav-height);
  /* Offset for sticky nav */
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Noto Sans TC", sans-serif;
  background-color: var(--color-secondary-white);
  color: var(--color-text-dark);
  padding-top: var(--nav-height);
  /* Prevent content overlap */
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
  vertical-align: middle;
}

.expand-button .material-symbols-outlined {
  transition: transform 0.3s ease;
}

.expand-button.inline-expanded .material-symbols-outlined {
  transform: rotate(180deg);
}

/* Container for max-width */
.content-container {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  /* px-6 */
  padding-right: 1.5rem;
  /* px-6 */
}

/* Sticky Navigation */
.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: var(--color-primary);
  color: var(--color-text-light);
  z-index: 50;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sticky-nav .nav-content {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sticky-nav .nav-links {
  display: flex;
  gap: 1rem;
}

.sticky-nav .nav-links a {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.sticky-nav .nav-links a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.text-sm {
  vertical-align: top;
}

.list-disc {
  margin-left: 1.25rem;
  padding-bottom: 1rem;
}

@media (max-width: 768px) {
  .sticky-nav .nav-links {
    gap: 0.5rem;
  }

  .sticky-nav .nav-links {
    margin-left: 20px;
  }

  .sticky-nav .nav-links .nav-text {
    display: none;
  }

  .sticky-nav .nav-links a {
    padding: 0.5rem;
  }

  .sticky-nav .nav-content {
    justify-content: space-around;
  }

  /* .sticky-nav .nav-logo {
        display: none;
      } */
}

h1 {
  text-shadow: 1px 1px #002247, 2px 2px #002247, 3px 3px #002247,
    4px 4px #002247, 5px 5px #002247, 6px 6px #002247, 7px 7px #002247,
    8px 8px #002247, 9px 9px #002247;
  letter-spacing: 0.2rem;
  padding-bottom: 1rem;
}

h4 {
  /* Titles in cards or details */
  font-size: 1.125rem !important;
  /* text-lg */
  font-weight: 600 !important;
  color: var(--color-accent-blue);
  margin-bottom: 0.75rem !important;
  /* mb-3 */
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Specific styles for allocation section subtitles */
#allocation h3.allocation-main-subtitle {
  font-size: 1.25rem;
  /* text-xl */
  margin-bottom: 1rem;
  /* mb-4 */
  color: var(--color-primary);
  text-align: left;
}

#allocation .allocation-subsection h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  /* mb-6 */
  font-size: 1.5rem;
  /* text-2xl */
}

/* Card Styles */
.card {
  background-color: var(--color-secondary-white);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.07),
    0 4px 6px -4px rgb(0 0 0 / 0.07);
}

.card-content-wrapper {
  flex-grow: 1;
}

/* Make trend cards clickable */
#focus-trends .card {
  cursor: pointer;
}

/* Horizontal Scroll (Generic Styles) */
.scroll-wrapper {
  position: relative;
  padding-left: 1rem;
  padding-right: 1rem;
}

.scroll-container {
  display: flex;
  overflow-x: auto;
  padding-bottom: 1rem;
  margin-bottom: -1rem;
  gap: 1.5rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Add cursor style for dragging */
  cursor: grab;
  user-select: none;
  /* Prevent text selection during drag */
}

.scroll-container.grabbing {
  cursor: grabbing;
  scroll-behavior: auto;
  /* Disable smooth scroll during drag */
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

.scroll-item {
  flex: 0 0 auto;
  width: 280px;
  display: flex;
  flex-direction: column;
}

/* Specific widths for different sections */
#market-outlook .scroll-item {
  width: 280px;
}

/* --- UPDATED: Allocation scroll item width --- */
#allocation .allocation-subsection .scroll-item {
  width: 240px;
  /* Adjusted width for new layout */
}

.scroll-item > .card {
  flex-grow: 1;
}

.newTrends {
  padding-top: 1.25rem;
}

.space-y-2 {
  line-height: 1.55rem;
  margin-bottom: 1rem;
}

.mb-3 strong {
  color: #c8a854;
  font-weight: 800;
}

.mb-3 span {
  color: #c5d7f7;
}

.mb-3 a {
  color: #007fc3;
}

@media (min-width: 640px) {
  #market-outlook .scroll-item {
    width: 300px;
  }

  #allocation .allocation-subsection .scroll-item {
    width: 260px;
  }
}

@media (min-width: 1024px) {
  #market-outlook .scroll-item {
    width: 320px;
  }

  /* Adjust allocation scroll item width for 5 cards */
  #allocation .allocation-subsection .scroll-item {
    width: calc(33.33% - 1.5rem);
  }

  /* Aim for 3 cards visible like FX, adjust gap */
}

/* Scroll Button Style Update */
.scroll-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background-color: var(--color-primary);
  color: var(--color-text-light);
  border-radius: 9999px;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease, opacity 0.3s ease;
  opacity: 0.85;
}

.scroll-button:hover {
  background-color: var(--color-accent-blue);
  opacity: 1;
}

.scroll-button.left {
  left: -0.25rem;
}

.scroll-button.right {
  right: -0.25rem;
}

@media (max-width: 640px) {
  .scroll-button.left {
    left: 0.5rem;
  }

  .scroll-button.right {
    right: 0.5rem;
  }
}

/* Fade-in animation */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* CTA Button Style */
.cta-button {
  display: inline-block;
  background-color: var(--color-accent-gold);
  color: var(--color-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
  background-color: #c8a854;
  transform: translateY(-2px);
  box-shadow: 0 6px 10px -1px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.08);
}

/* Icon Text Style */
.icon-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-accent-blue);
}

.icon-text .material-symbols-outlined {
  color: var(--color-accent-gold);
  font-size: 1.75em;
}

/* Footer Style */
footer {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

/* Section Backgrounds */
#intro {
  background-color: var(--color-secondary-white);
  position: relative;
  /* For video background */
  overflow: hidden;
  /* To contain video */
  padding-top: 10rem;
}

#allocation {
  background-color: var(--color-secondary-light);
  position: relative;
  overflow: hidden;
}

#market-outlook {
  background-color: var(--color-secondary-white);
  position: relative;
  overflow: hidden;
}

#focus-trends {
  background-color: var(--color-secondary-light);
}

#recommended-funds {
  background: linear-gradient(
    135deg,
    var(--color-secondary-light) 0%,
    #e0e8f0 100%
  );
}

/* --- Video Background for Intro Section --- */
#intro-video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 0;
  /* Behind content */
  transform: translateX(-50%) translateY(-50%);
  object-fit: cover;
  /* Cover the area */
}

#intro .content-container {
  position: relative;
  /* Ensure content is above video */
  z-index: 2;
}

#intro-video-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 34, 71, 0.7);
  /* Light overlay */
  z-index: 1;
}

/* --- End Video Background --- */

/* Parallax Background for Allocation */
.parallax-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("images/02.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.parallax-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(243, 244, 244, 0.7);
  z-index: 1;
}

#allocation .content-container {
  position: relative;
  z-index: 2;
}

#allocation .card {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
}

/* Styles for Below-Card Expanded Content (Generic) */
.details-container {
  background-color: var(--color-secondary-white);
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  padding: 1.5rem 2rem;
  margin-top: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-out;
  z-index: 3;
}

.details-container.visible {
  display: block;
  opacity: 1;
}

.details-close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--color-text-medium);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.details-close-button:hover {
  color: var(--color-text-dark);
}

.details-close-button .material-symbols-outlined {
  font-size: 1.5rem;
}

.details-content-area {
  min-height: 1rem;
}

/* Styles for Inline Mobile Expandable Content (Generic) */
.mobile-expandable-content {
  display: none;
  font-size: 0.875rem;
  color: var(--color-text-medium);
  border-top: 1px solid transparent;
  margin-top: 0;
  padding-top: 0;
  transition: margin-top 0.3s ease-out, padding-top 0.3s ease-out,
    border-color 0.3s ease-out;
}

.mobile-expandable-content.expanded {
  display: block;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top-color: #e5e7eb;
}

@media (min-width: 768px) {
  /* Hide all mobile containers on desktop */
  .mobile-expandable-content {
    display: none !important;
  }
}

/* Style for the button in card */
.expand-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent-blue);
  cursor: pointer;
  border: none;
  background: none;
  pointer-events: none;
  /* Disable pointer events by default */
}

/* Re-enable pointer events for non-trend buttons */
#market-outlook .expand-button,
#recommended-funds .expand-button {
  pointer-events: auto;
}

.expand-button span:first-child {
  margin-right: 0.25rem;
}

.expand-button .material-symbols-outlined {
  font-size: 1.125rem;
}

/* --- Updated Subscribe Button Style --- */
.subscribe-button {
  display: inline-flex;
  /* Use inline-flex for better alignment with icon */
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: auto;
  /* Push to bottom */
  padding: 0.75rem 1rem;
  /* py-3 px-4 */
  font-size: 1rem;
  /* */
  color: var(--color-secondary-white);
  background-color: var(--color-accent-gold);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  /* rounded-lg */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* Smoother transition */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.subscribe-button:hover {
  background-color: #c8a854;
  /* Darker Gold */
  transform: translateY(-3px) scale(1.03);
  /* Slight lift and scale */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.subscribe-button:active {
  transform: translateY(-1px) scale(0.98);
  /* Slight press down */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.subscribe-button .material-symbols-outlined {
  font-size: 1.125rem;
  /* text-lg */
  margin-left: 0.5rem;
  /* ml-2 */
}

/* --- End Subscribe Button Style --- */

/* Tab Styles */
.tab-list {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid #d1d5db;
  position: relative;
  z-index: 10;
}

.tab-button {
  flex-grow: 1;
  text-align: center;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: var(--color-text-medium);
  background-color: transparent;
  border: none;
  border-bottom: 6px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  background-color: 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.3rem !important;
  backdrop-filter: blur(80%);
}

.tab-button .material-symbols-outlined {
  font-size: 1.25rem;
  color: var(--color-text-medium);
  transition: color 0.2s ease;
}

.tab-button:hover {
  color: var(--color-primary);
  background-color: rgba(0, 34, 71, 0.15);
  backdrop-filter: blur(80%);
}

.tab-button:hover .material-symbols-outlined {
  color: var(--color-primary);
}

.tab-button.active {
  color: var(--color-primary);
  font-weight: 600;
  border-bottom-color: var(--color-primary);
  background-color: transparent;
}

.tab-button.active .material-symbols-outlined {
  color: var(--color-primary);
}

.tab-content {
  display: none;
  position: relative;
  z-index: 5;
  background-color: rgba(255, 255, 255, 0.65);
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.tab-content.active {
  display: block;
}

/* Market Outlook Background Styles */
#market-backgrounds {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

#market-backgrounds img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.7s ease-in-out;
}

#market-backgrounds img.active-bg {
  opacity: 0.15;
}

/* --- FX & Allocation Card Style --- */
.info-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.info-card .info-icon .material-symbols-outlined {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.info-card .info-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.info-card .info-description {
  font-size: 1rem;
  color: var(--color-text-medium);
  flex-grow: 1;
}

/* Specific colors for rating icons */
.info-card .info-title .text-green-600 .material-symbols-outlined {
  color: #16a34a;
}

.info-card .info-title .text-gray-800 .material-symbols-outlined {
  color: #4b5563;
}

.info-card .info-title .text-red-600 .material-symbols-outlined {
  color: #dc2626;
}

h2 {
  font-size: 2.5rem !important;
  line-height: 3.5rem !important;
  font-weight: 700 !important;
  margin-bottom: 1.5rem !important;
  text-align: center;
  /* color: var(--color-primary); */
  text-shadow: 1px 1px #ffffff, 2px 2px #c5d7f7, 3px 3px #c5d7f7,
    4px 4px #c5d7f7, 5px 5px #c5d7f7, 6px 6px #c5d7f7;
}

/* 以上是舊的 */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: "Noto Sans TC", sans-serif;
  background-color: #f8fafc;
}

h1 {
  text-shadow: 5px 5px 10px #002247;
  letter-spacing: 0.2rem;
  padding-bottom: 1rem;
}

.heroH2 {
  text-shadow: 0px 0px 5px #000000;
  letter-spacing: 0.2rem;
}

p.remark {
  font-size: 12px;
  padding-top: 0.5rem;
}

.text-gold-600 {
  --tw-text-opacity: 1;
  color: rgb(221 191 112 / var(--tw-text-opacity, 1));
}

.bg-blue {
  background-color: #002247;
}

.text-white-600 {
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}

.introduction {
  padding: 20px;
  background: #002247;
  border-radius: 6px;
  opacity: 0.9;
  box-shadow: 10px 10px 10px -6px #0005;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 2px;
  bottom: -6px;
  left: 0;
  background-color: #ddbf70;
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
}

.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.fade-up-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.boxImg {
  margin-top: 1rem;
  border-radius: 6px;
}

#hero-bg {
  background-image: url("img/hero.jpg");
  will-change: transform;
  opacity: 0;
  transition: opacity 1s ease-in;
}

#analysis {
  background-image: url("img/analysis.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 0;
}

#analysis::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.96);
  z-index: -1;
}

#outlook {
  background-image: url("img/outlook.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  z-index: 0;
}

#outlook::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(248, 250, 252, 0.8);
  z-index: -1;
}

.market-selector.is-active {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  border-color: #3b82f6;
}

/* [新增] PC 版選擇器卡片上圖示的樣式與旋轉動畫 */
.pc-accordion-icon {
  transition: transform 0.3s ease-in-out;
}

.market-selector.is-active .pc-accordion-icon {
  transform: rotate(180deg);
}
.py-12b {
  padding-top: 2rme;
  padding-bottom: 3rem;
}

.bg-warning {
  --tw-bg-opacity: 1;
  background-color: #a8b3c0;
}
.bg-footer {
  --tw-bg-opacity: 1;
  background-color: #002247;
}

.text-warning {
  font-size: 0.85rem;
  line-height: 1.2rem;
}

@media (max-width: 768px) {
  h1 {
    letter-spacing: 0rem;
  }
  h2 {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
  }
  .heroH2 {
    letter-spacing: 0rem;
  }
  .remark {
    margin-bottom: 1rem;
  }
  .remark {
    margin-top: 0;
  }
}

.mobile-nav-link {
  color: #ffffff;
}
