/* ============================================
   コアサテライト専用スタイル (core_satellite.html)
   画像準拠リデザイン — コア1 + サテライト1
   ============================================ */

/* --- Ratio Slider Section --- */
.cs-ratio-section {
  background: #ffffff;
  padding: 30px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cs-ratio-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 500px;
}

.cs-ratio-value {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  min-width: 90px;
  text-align: center;
}

.cs-ratio-value--core {
  color: var(--color-left-bg);
}

.cs-ratio-value--sat {
  color: var(--color-right-bg);
}

.cs-ratio-slider-wrap {
  flex: 1;
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}

.cs-ratio-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 12px;
  border-radius: 6px;
  transform: translateY(-50%);
  overflow: hidden;
  pointer-events: none;
}

.cs-ratio-track-core {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-left-bg);
  border-radius: 6px 0 0 6px;
  transition: width 0.15s ease;
}

.cs-ratio-track-sat {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background: var(--color-right-bg);
  border-radius: 0 6px 6px 0;
  transition: width 0.15s ease;
}

.cs-ratio-slider-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  position: relative;
  z-index: 2;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

/* WebKit トラックを完全に透明化 */
.cs-ratio-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  background: transparent;
  border: none;
}

/* Firefox トラックを完全に透明化 */
.cs-ratio-slider-wrap input[type="range"]::-moz-range-track {
  height: 12px;
  background: transparent;
  border: none;
}

.cs-ratio-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #aaa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: grab;
  margin-top: -8px;
  /* (28 - 12) / 2 = 8  サムをトラック中心に合わせる */
}

.cs-ratio-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #aaa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: grab;
}

.cs-ratio-slider-wrap input[type="range"]:active::-webkit-slider-thumb {
  cursor: grabbing;
  border-color: #666;
}

/* --- Main 2-Column Layout --- */
.cs-main-split {
  display: flex;
  flex: 1;
  position: relative;
}

/* --- CS Panel (each side) --- */
.cs-panel {
  flex: 1;
  width: 50%;
  min-width: 0;
  padding: 40px 40px 40px;
  display: flex;
  flex-direction: column;
}

.cs-panel--core {
  background: var(--color-left-bg);
  color: var(--color-text-white);
}

.cs-panel--sat {
  background: var(--color-right-bg);
  color: var(--color-text-white);
}

/* --- Badge（画像準拠: コア=マゼンタピル、サテライト=ブルーピル） --- */
.cs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 5px 22px;
  border-radius: 30px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.cs-badge--core {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: 0 2px 8px rgba(216, 0, 95, 0.3);
  width: 240px;
}

.cs-badge--sat {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46, 107, 198, 0.3);
  width: 240px;
}

/* --- Fund Name Header（画像準拠: ファンド名を大きく直接表示） --- */
.cs-fund-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  min-height: 62px; /* 2行分の高さを確保して左右を揃える */
}

.cs-fund-name {
  flex: 1;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin: 0;
  letter-spacing: -0.01em;
  min-height: calc(1.5rem * 1.4 * 2); /* 2行分の高さを確保 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

.cs-fund-change-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 4px;
}

.cs-fund-change-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: #fff;
}

.cs-base-date {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin: -12px 0 16px;
}

/* --- Plus Divider Between Panels --- */
.cs-plus-divider {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- Panel Fund Search Button (Override for white bg) --- */
.cs-panel .panel-fund-search-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.cs-panel .panel-fund-search-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #fff;
}

/* --- Stats override for CS panels --- */
.cs-panel .panel-stats {
  margin-bottom: 30px;
}

.cs-panel .stat-row {
  margin-bottom: 16px;
}

.cs-panel .nav-value {
  font-size: 4.5rem;
}

/* --- Chart Area inside CS Panel --- */
.cs-panel .panel-chart-area {
  background: #fff;
  border-radius: 6px;
  padding: 20px;
  color: #333;
  margin-bottom: 24px;
}

.cs-panel .period-tab {
  padding: 6px 0;
  font-size: 0.8rem;
}

.cs-panel .period-tab.active {
  background: var(--color-tab-active);
  border-color: var(--color-tab-active);
  color: #fff;
}

.cs-panel .chart-container {
  position: relative;
  height: 200px;
}

.cs-panel .chart-container canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* --- Detail Tables inside CS Panel --- */
.cs-panel .panel-detail-area {
  background: transparent;
  border-radius: 4px;
  padding: 20px 0;
  margin-top: 10px;
  color: var(--color-text-white);
}

.cs-panel .detail-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.cs-panel .detail-section-title:not(:first-child) {
  margin-top: 20px;
}

.cs-panel .detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cs-panel .detail-table th,
.cs-panel .detail-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.cs-panel .detail-table th {
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.15);
  font-size: 0.8rem;
}

.cs-panel .detail-table th:first-child,
.cs-panel .detail-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: #fff;
  min-width: 80px;
}

.cs-panel .detail-table td {
  font-weight: 500;
  color: #fff;
}

/* --- NAV Range inside CS Panel --- */
.cs-panel .nav-range {
  padding: 4px 0;
}

.cs-panel .nav-range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}

.cs-panel .nav-range-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  width: 50px;
  flex-shrink: 0;
}

.cs-panel .nav-range-value {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  min-width: 80px;
}

.cs-panel .nav-range-date {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.cs-panel .nav-range-bar-track {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 6px 0;
  overflow: visible;
}

.cs-panel .nav-range-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.7));
  transition: width 0.8s ease;
}

.cs-panel .nav-range-bar-current {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: left 0.8s ease;
  z-index: 2;
}

.cs-panel--core .nav-range-bar-current {
  background: var(--color-left-bg);
}

.cs-panel--sat .nav-range-bar-current {
  background: var(--color-right-bg);
}

/* --- Combined (Portfolio Simulation) Section --- */
/* Uses styles from style.css (.combined-section etc.) */

/* --- Responsive --- */
@media (max-width: 900px) {
  .cs-main-split {
    flex-direction: column;
  }

  .cs-panel {
    width: 100%;
    padding: 30px 20px;
  }

  .cs-plus-divider {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: -20px auto -20px;
    z-index: 10;
  }

  .cs-ratio-value {
    font-size: 2rem;
  }

  .cs-panel .nav-value {
    font-size: 3rem;
  }
}