/* ===== Web Job Tree - WordPress Scoped CSS ===== */

.wjt-wrap {
    --bg: #0d1b2a;
    --bg-card: #152238;
    --bg-card-hover: #1b2d45;
    --border: #243750;
    --tag-bg: #1b2d45;
    --bg-subtle: rgba(160, 184, 208, 0.06);
    --border-subtle: rgba(160, 184, 208, 0.1);
    --text: #ffffff;
    --text-sub: #8899aa;
    --star-inactive: #243750;
    --accent: #a0c4e8;
    --star-active: #ffd700;
    --gold: #ffc837;
    --silver: #b0c0d0;
    --bronze: #d4956a;
    --unlock: #5599cc;
  }

  .wjt-wrap[data-theme="light"] {
    --bg: #f5f0e8;
    --bg-card: #ffffff;
    --bg-card-hover: #f0ebe0;
    --border: #ddd5c8;
    --tag-bg: #ede6da;
    --bg-subtle: rgba(13, 27, 42, 0.04);
    --border-subtle: rgba(13, 27, 42, 0.08);
    --text: #1a1a2e;
    --text-sub: #666680;
    --star-inactive: #d0c8bb;
    --accent: #2a5580;
    --star-active: #c89a00;
    --gold: #b8860b;
    --silver: #607080;
    --bronze: #a06830;
    --unlock: #2a6699;
  }

  .wjt-wrap * { margin: 0; padding: 0; box-sizing: border-box; }

  .wjt-wrap {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
  }

  .wjt-wrap .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
  }

  .wjt-wrap h1 {
    text-align: center;
    font-size: 1.8rem;
    margin: 0;
    color: var(--text);
  }

  .wjt-wrap .subtitle {
    text-align: center;
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-bottom: 12px;
  }

  /* ===== Equip Panel ===== */
  .wjt-wrap .equip-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
  }

  .wjt-wrap .equip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }

  .wjt-wrap .equip-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 0.05em;
  }

  .wjt-wrap .equip-mode-tabs {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
  }

  .wjt-wrap .equip-mode-tab {
    padding: 4px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-sub);
    border: none;
    transition: background 0.15s, color 0.15s;
  }

  .wjt-wrap .equip-mode-tab:not(:last-child) {
    border-right: 1px solid var(--border);
  }

  .wjt-wrap .equip-mode-tab.active {
    background: var(--accent);
    color: #fff;
  }

  .wjt-wrap .equip-mode-tab:hover:not(.active) {
    background: var(--bg-subtle);
  }

  .wjt-wrap .equip-sim-label {
    font-size: 0.72rem;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 8px;
  }

  .wjt-wrap .equip-slots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  .wjt-wrap .equip-slot {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
  }

  .wjt-wrap .equip-slot select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238899aa' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
  }

  .wjt-wrap[data-theme="light"] .equip-slot select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666680' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  }

  .wjt-wrap .equip-slot select:focus {
    outline: none;
    border-color: var(--accent);
  }

  .wjt-wrap .equip-slot select option {
    background: var(--bg);
    color: var(--text);
  }

  .wjt-wrap .equip-cross {
    font-size: 1.2rem;
    color: var(--text-sub);
    flex-shrink: 0;
  }

  .wjt-wrap .equip-result {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .wjt-wrap .equip-result-empty {
    color: var(--text-sub);
    font-size: 0.85rem;
    text-align: center;
  }

  .wjt-wrap .equip-result-content {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
  }

  .wjt-wrap .equip-result-content .result-label {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-bottom: 8px;
  }

  .wjt-wrap .equip-result-content .result-text {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.9;
    text-align: left;
  }

  .wjt-wrap .equip-result-content .result-same {
    color: var(--accent);
    font-size: 0.85rem;
  }

  /* ===== Tier Section ===== */
  .wjt-wrap .tier-section {
    margin-bottom: 40px;
  }

  .wjt-wrap .tier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  .wjt-wrap .tier-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.05em;
  }

  .wjt-wrap .tier-badge.base { background: var(--bronze); color: #fff; }
  .wjt-wrap .tier-badge.advanced { background: var(--silver); color: #fff; }
  .wjt-wrap .tier-badge.master { background: var(--gold); color: #fff; }

  .wjt-wrap .tier-title {
    font-size: 1.1rem;
    color: var(--text-sub);
  }

  .wjt-wrap .tier-desc {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-left: auto;
  }

  /* ===== Job Card ===== */
  .wjt-wrap .job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
  }

  .wjt-wrap .job-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s;
  }

  .wjt-wrap .job-card:hover {
    background: var(--bg-card-hover);
  }

  .wjt-wrap .job-card.locked {
    opacity: 0.4;
  }

  .wjt-wrap .job-card.locked .star,
  .wjt-wrap .job-card.locked .job-detail-toggle {
    pointer-events: none;
  }

  .wjt-wrap .job-card.unlocked {
    border-color: var(--unlock);
  }

  .wjt-wrap .job-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }

  .wjt-wrap .job-name {
    font-size: 1rem;
    font-weight: bold;
  }

  .wjt-wrap .job-lock-icon {
    font-size: 0.8rem;
    color: var(--text-sub);
  }

  .wjt-wrap .job-requires {
    font-size: 0.72rem;
    color: var(--text-sub);
    margin-bottom: 10px;
    padding: 4px 8px;
    background: var(--bg-subtle);
    border-radius: 4px;
    display: inline-block;
  }

  /* ===== Star Rating ===== */
  .wjt-wrap .star-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    align-items: center;
  }

  .wjt-wrap .star {
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--star-inactive);
    transition: color 0.15s, transform 0.15s;
    user-select: none;
    line-height: 1;
  }

  .wjt-wrap .star:hover {
    transform: scale(1.2);
  }

  .wjt-wrap .star.active {
    color: var(--star-active);
  }

  .wjt-wrap .star-level {
    font-size: 0.75rem;
    color: var(--text-sub);
    margin-left: 8px;
  }

  .wjt-wrap .star-desc {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 8px;
    min-height: 1.2em;
    line-height: 1.6;
  }

  /* ===== Skills & Details ===== */
  .wjt-wrap .job-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
  }

  .wjt-wrap .skill-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: var(--tag-bg);
    border-radius: 12px;
    color: var(--text-sub);
  }

  .wjt-wrap .job-desc {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 8px;
  }

  .wjt-wrap .job-desc ul {
    padding-left: 16px;
    margin: 0;
  }

  .wjt-wrap .job-desc li {
    margin-bottom: 2px;
  }

  .wjt-wrap .job-value {
    font-size: 0.8rem;
    color: var(--text-sub);
    font-style: italic;
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }

  .wjt-wrap .job-detail-toggle {
    font-size: 0.75rem;
    color: var(--text-sub);
    cursor: pointer;
    margin-top: 8px;
    text-align: right;
  }

  .wjt-wrap .job-detail-toggle:hover {
    color: var(--text);
  }

  .wjt-wrap .job-detail {
    display: none;
    margin-top: 8px;
  }

  .wjt-wrap .job-detail.open {
    display: block;
  }

  /* ===== Summary ===== */
  .wjt-wrap .summary-section {
    margin-top: 48px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
  }

  .wjt-wrap .summary-title {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }

  .wjt-wrap .summary-unlocked {
    margin-bottom: 16px;
  }

  .wjt-wrap .summary-unlocked h3 {
    font-size: 0.9rem;
    color: var(--unlock);
    margin-bottom: 8px;
  }

  .wjt-wrap .summary-job-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .wjt-wrap .summary-job-chip {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
  }

  .wjt-wrap .summary-job-chip.advanced {
    background: rgba(176, 192, 208, 0.1);
    border: 1px solid var(--silver);
    color: var(--silver);
  }

  .wjt-wrap .summary-job-chip.master {
    background: rgba(255, 200, 55, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
  }

  .wjt-wrap .summary-next {
    margin-top: 16px;
  }

  .wjt-wrap .summary-next h3 {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 8px;
  }

  .wjt-wrap .summary-hint {
    font-size: 0.8rem;
    color: var(--text-sub);
    padding: 8px 12px;
    background: var(--bg-subtle);
    border-radius: 6px;
    margin-bottom: 6px;
  }

  .wjt-wrap .summary-hint strong {
    color: var(--text);
  }

  .wjt-wrap .empty-message {
    color: var(--text-sub);
    font-size: 0.85rem;
  }

  /* ===== Modal ===== */
  .wjt-wrap .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
  }

  .wjt-wrap .modal-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .wjt-wrap .modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
  }

  .wjt-wrap .modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.2rem;
    color: var(--text-sub);
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
  }

  .wjt-wrap .modal-close:hover {
    color: var(--text);
  }

  .wjt-wrap .modal-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 16px;
    padding-right: 24px;
    color: var(--accent);
  }

  .wjt-wrap .modal-level-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .wjt-wrap .modal-level-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .wjt-wrap .modal-level-item:last-child {
    border-bottom: none;
  }

  .wjt-wrap .modal-level-star {
    color: var(--star-active);
    font-weight: bold;
    white-space: nowrap;
    min-width: 36px;
  }

  .wjt-wrap .modal-level-desc {
    color: var(--text-sub);
  }

  /* ===== Clickable job name (base tier) ===== */
  .wjt-wrap .job-name.clickable {
    cursor: pointer;
    transition: color 0.15s;
  }

  .wjt-wrap .job-name.clickable:hover {
    color: var(--accent);
  }

  /* ===== Theme Toggle ===== */
  .wjt-wrap .header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 8px;
  }

  .wjt-wrap .header-buttons {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
  }

  .wjt-wrap .header-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-sub);
    font-size: 1.1rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
  }

  .wjt-wrap .header-btn:hover {
    border-color: var(--accent);
    color: var(--text);
  }

  @media (max-width: 600px) {
    .wjt-wrap h1 { font-size: 1.4rem; }
    .wjt-wrap .job-grid { grid-template-columns: 1fr; }
    .wjt-wrap .star { font-size: 1.4rem; }
    .wjt-wrap .equip-slots { flex-direction: column; align-items: stretch; }
    .wjt-wrap .equip-slot { max-width: 100%; }
    .wjt-wrap .equip-cross { text-align: center; }
  }
