/* ============================================
   YOITOKI - Tools Page Styles
   ============================================ */

/* ===== Tool Page Layout ===== */
.tool-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ===== Tool Hero (background image, no overlay) ===== */
.tool-hero {
  width: 100%;
  height: 300px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-xl);
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.tool-hero-header {
  text-align: center;
  padding: 32px 24px 24px;
  margin-bottom: 28px;
  position: relative;
}

.tool-hero-header .tool-hero-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-cute);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(240,128,128,0.25);
}

.tool-hero-header .tool-hero-icon svg {
  width: 28px;
  height: 28px;
}

.tool-hero-header h1 {
  font-family: var(--font-title);
  font-size: 26px;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.tool-hero-header p {
  font-size: 14px;
  color: var(--color-text-sub);
  max-width: 500px;
  margin: 0 auto;
}

/* ===== SVG Icon System ===== */
.svg-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
}

.svg-ic svg {
  width: 100%;
  height: 100%;
}

.svg-ic-sm { width: 18px; height: 18px; }
.svg-ic-md { width: 22px; height: 22px; }
.svg-ic-lg { width: 28px; height: 28px; }
.svg-ic-xl { width: 36px; height: 36px; }

/* Icon in heading */
.tool-card-box h2 .svg-ic {
  width: 22px;
  height: 22px;
  margin-right: 4px;
}

/* Icon in style card */
.style-card .style-icon-box {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-base);
  border-radius: 12px;
  transition: var(--transition);
}

.style-card.active .style-icon-box {
  background: #FFE8E0;
}

.style-card .style-icon-box svg {
  width: 24px;
  height: 24px;
}

/* Icon in breakdown */
.breakdown-item .icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-warm);
  border-radius: 50%;
  flex-shrink: 0;
}

.breakdown-item .icon svg {
  width: 18px;
  height: 18px;
}

/* Icon in info card */
.info-card .info-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF5E6;
  border-radius: 10px;
  flex-shrink: 0;
}

.info-card .info-icon svg {
  width: 20px;
  height: 20px;
}

/* Icon in category tab */
.cat-tab .svg-ic {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

/* Icon in label */
.tool-label .svg-ic {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

/* Icon in option pill */
.option-pill .svg-ic {
  width: 16px;
  height: 16px;
}

/* ===== Option Pills ===== */
.option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--color-base);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-sub);
  transition: var(--transition);
  border: 2px solid transparent;
}

.option-pill:hover {
  background: #FFF5F0;
  border-color: var(--color-primary-light);
}

.option-pill input {
  display: none;
}

.option-pill.checked {
  background: #FFE8E0;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.option-pill .svg-ic {
  width: 16px;
  height: 16px;
}

/* ===== Tool Card Container ===== */
.tool-card-box {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.tool-card-box h2 {
  font-size: 18px;
  color: var(--color-text-main);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Form Elements ===== */
.tool-form-group {
  margin-bottom: 24px;
}

.tool-form-group:last-child {
  margin-bottom: 0;
}

.tool-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.tool-label .hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-light);
  margin-left: 6px;
}

.tool-select,
.tool-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font-jp);
  color: var(--color-text-main);
  background: var(--color-white);
  transition: var(--transition);
  outline: none;
}

.tool-select:focus,
.tool-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(240, 128, 128, 0.1);
}

/* ===== Radio/Style Cards ===== */
.style-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.style-card {
  padding: 20px 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--color-white);
}

.style-card:hover {
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
}

.style-card.active {
  border-color: var(--color-primary);
  background: #FFF5F0;
  box-shadow: 0 4px 12px rgba(240, 128, 128, 0.15);
}

.style-card .icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.style-card .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
}

.style-card .price {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ===== Range Slider ===== */
.range-wrapper {
  position: relative;
}

.tool-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, var(--color-primary-light), var(--color-primary));
  outline: none;
}

.tool-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-white);
  border: 3px solid var(--color-primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(240, 128, 128, 0.3);
  transition: var(--transition);
}

.tool-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.tool-range::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-white);
  border: 3px solid var(--color-primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(240, 128, 128, 0.3);
}

.range-value {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 8px;
  font-family: var(--font-title);
}

.range-value .unit {
  font-size: 14px;
  color: var(--color-text-sub);
  font-weight: 400;
}

/* ===== Tool Buttons ===== */
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-jp);
  cursor: pointer;
  transition: var(--transition);
  background: var(--gradient-cute);
  color: var(--color-white);
  box-shadow: 0 4px 16px rgba(240, 128, 128, 0.3);
}

.tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(240, 128, 128, 0.4);
}

.tool-btn:active {
  transform: translateY(0);
}

.tool-btn-secondary {
  background: var(--color-white);
  color: var(--color-primary);
  border: 2px solid var(--color-primary-light);
  box-shadow: none;
}

.tool-btn-secondary:hover {
  background: #FFF5F0;
  box-shadow: 0 4px 12px rgba(240, 128, 128, 0.1);
}

.tool-btn-lg {
  padding: 16px 48px;
  font-size: 18px;
  width: 100%;
}

/* ===== Result Display ===== */
.tool-result {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.5s ease;
}

.tool-result.hidden {
  display: none;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-total {
  text-align: center;
  margin-bottom: 24px;
  padding: 24px;
  background: var(--gradient-warm);
  border-radius: var(--radius-lg);
}

.result-total .label {
  font-size: 14px;
  color: var(--color-text-sub);
  margin-bottom: 8px;
}

.result-total .amount {
  font-size: 42px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-title);
}

.result-total .amount .yen {
  font-size: 24px;
}

.result-total .note {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 8px;
}

/* ===== Breakdown Table ===== */
.breakdown-list {
  list-style: none;
}

.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px dashed var(--color-border);
}

.breakdown-item:last-child {
  border-bottom: none;
}

.breakdown-item .left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.breakdown-item .icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-warm);
  border-radius: 50%;
  flex-shrink: 0;
}

.breakdown-item .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-main);
}

.breakdown-item .price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-title);
}

/* ===== Category Tabs ===== */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.cat-tab {
  padding: 8px 18px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-sub);
  cursor: pointer;
  transition: var(--transition);
  background: var(--color-white);
}

.cat-tab:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.cat-tab.active {
  border-color: var(--color-primary);
  background: var(--gradient-cute);
  color: var(--color-white);
}

/* ===== Topic Card ===== */
.topic-card {
  background: var(--gradient-warm);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.topic-card .topic-cat {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 16px;
}

.topic-card .topic-text {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.6;
  font-family: var(--font-title);
}

.topic-card .topic-icon-box {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.7);
  border-radius: 16px;
}

.topic-card .topic-icon-box svg {
  width: 28px;
  height: 28px;
}

.topic-shuffle {
  animation: shuffleAnim 0.4s ease;
}

@keyframes shuffleAnim {
  0% { opacity: 0; transform: scale(0.9) rotate(-2deg); }
  50% { opacity: 0.5; transform: scale(1.02) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* ===== Saved Topics ===== */
.saved-topics {
  margin-top: 24px;
}

.saved-topics h3 {
  font-size: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-topics h3 .svg-ic {
  width: 20px;
  height: 20px;
}

.saved-topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--color-base);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-size: 14px;
  transition: var(--transition);
}

.saved-topic-item:hover {
  background: #FFF5F0;
}

.saved-topic-item .remove-btn {
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  transition: var(--transition);
}

.saved-topic-item .remove-btn:hover {
  color: var(--color-primary);
}

/* ===== Compatibility Result ===== */
.compat-result {
  text-align: center;
}

.compat-score-circle {
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compat-score-circle svg {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.compat-score-circle .score-num {
  font-size: 56px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-title);
  z-index: 1;
}

.compat-score-circle .score-label {
  font-size: 14px;
  color: var(--color-text-sub);
  position: absolute;
  bottom: 30px;
}

.compat-names {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.compat-message {
  font-size: 16px;
  color: var(--color-text-sub);
  line-height: 1.8;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--gradient-warm);
  border-radius: var(--radius-lg);
}

.compat-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.compat-bar {
  text-align: center;
  padding: 16px 8px;
  background: var(--color-base);
  border-radius: var(--radius-md);
}

.compat-bar .bar-label {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-bottom: 8px;
}

.compat-bar .bar-track {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 8px;
}

.compat-bar .bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

.compat-bar .bar-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ===== Checklist ===== */
.checklist {
  list-style: none;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--color-base);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.checklist-item:hover {
  background: #FFF5F0;
}

.checklist-item .check-box {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  margin-top: 1px;
}

.checklist-item.checked .check-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.checklist-item .check-box::after {
  content: '';
  opacity: 0;
  transition: var(--transition);
}

.checklist-item.checked .check-box::after {
  content: '✓';
  opacity: 1;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
}

.checklist-item .check-content {
  flex: 1;
}

.checklist-item .check-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 2px;
}

.checklist-item.checked .check-title {
  text-decoration: line-through;
  color: var(--color-text-light);
}

.checklist-item .check-desc {
  font-size: 12px;
  color: var(--color-text-sub);
}

/* ===== Info Cards ===== */
.info-card {
  padding: 16px 20px;
  background: var(--color-base);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.info-card .info-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.info-card .info-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 4px;
}

.info-card .info-content p {
  font-size: 13px;
  color: var(--color-text-sub);
  line-height: 1.6;
}

/* ===== Date Planner ===== */
.spot-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.spot-form .full {
  grid-column: 1 / -1;
}

.spot-list {
  margin-top: 20px;
}

.spot-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--color-base);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: var(--transition);
  border: 2px solid transparent;
}

.spot-item:hover {
  border-color: var(--color-primary-light);
}

.spot-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--gradient-cute);
  border-radius: var(--radius-md);
  color: var(--color-white);
  font-weight: 700;
  flex-shrink: 0;
}

.spot-time .hour {
  font-size: 18px;
  line-height: 1;
}

.spot-time .min {
  font-size: 11px;
}

.spot-info {
  flex: 1;
}

.spot-info .spot-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 4px;
}

.spot-info .spot-detail {
  font-size: 12px;
  color: var(--color-text-sub);
  display: flex;
  gap: 12px;
}

.spot-actions {
  display: flex;
  gap: 6px;
}

.spot-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-white);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.spot-btn:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.plan-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.plan-stat {
  text-align: center;
  padding: 20px 12px;
  background: var(--gradient-warm);
  border-radius: var(--radius-md);
}

.plan-stat .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  font-family: var(--font-title);
}

.plan-stat .stat-label {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-top: 4px;
}

/* ===== Bar Chart ===== */
.chart-container {
  margin-top: 24px;
  padding: 24px 16px;
  background: var(--color-base);
  border-radius: var(--radius-lg);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 200px;
  padding: 0 8px;
  border-bottom: 2px solid var(--color-border);
  position: relative;
}

.chart-bar {
  flex: 1;
  min-width: 0;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
  position: relative;
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.85;
}

.chart-bar .bar-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text-main);
  color: var(--color-white);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
  margin-bottom: 6px;
}

.chart-bar:hover .bar-tooltip {
  opacity: 1;
}

.chart-labels {
  display: flex;
  gap: 4px;
  padding: 8px 8px 0;
}

.chart-labels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--color-text-light);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .tool-hero h1 {
    font-size: 22px;
  }

  .tool-card-box {
    padding: 20px;
  }

  .style-cards {
    grid-template-columns: 1fr 1fr;
  }

  .spot-form {
    grid-template-columns: 1fr;
  }

  .plan-summary {
    grid-template-columns: 1fr;
  }

  .result-total .amount {
    font-size: 32px;
  }

  .topic-card .topic-text {
    font-size: 18px;
  }
}
