/* ============================================================
   TOKISAMA Platform - platform.css
   ts-* クラス定義
   ============================================================ */

/* ---- ベース ---- */
.ts-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ts-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.ts-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}
.ts-link { color: #6366f1; text-decoration: none; }
.ts-link:hover { text-decoration: underline; }

/* ---- ボタン ---- */
.ts-btn {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    line-height: 1.4;
}
.ts-btn:hover { background: #f3f4f6; }
.ts-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ts-btn-primary  { background: #6366f1; border-color: #6366f1; color: #fff; }
.ts-btn-primary:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }

.ts-btn-secondary { background: #fff; border-color: #6366f1; color: #6366f1; }
.ts-btn-secondary:hover { background: #eef2ff; }

.ts-btn-danger  { background: #ef4444; border-color: #ef4444; color: #fff; }
.ts-btn-danger:hover { background: #dc2626; }

.ts-btn-ghost   { background: transparent; border-color: transparent; color: #6b7280; }
.ts-btn-ghost:hover { background: #f3f4f6; }

.ts-btn-lg      { padding: 12px 28px; font-size: 15px; }
.ts-btn-sm      { padding: 5px 12px;  font-size: 12px; }

/* ---- バッジ ---- */
.ts-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.ts-badge-green  { background: #dcfce7; color: #166534; }
.ts-badge-blue   { background: #dbeafe; color: #1e40af; }
.ts-badge-yellow { background: #fef9c3; color: #854d0e; }
.ts-badge-orange { background: #ffedd5; color: #9a3412; }
.ts-badge-red    { background: #fee2e2; color: #991b1b; }
.ts-badge-gray   { background: #f3f4f6; color: #374151; }

/* ---- フォーム ---- */
.ts-form-group {
    margin-bottom: 18px;
}
.ts-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.ts-form-group input[type="text"],
.ts-form-group input[type="number"],
.ts-form-group input[type="url"],
.ts-form-group input[type="date"],
.ts-form-group input[type="time"],
.ts-form-group input[type="email"],
.ts-form-group select,
.ts-form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    box-sizing: border-box;
    background: #fff;
}
.ts-form-group input:focus,
.ts-form-group select:focus,
.ts-form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.ts-form-row {
    display: flex;
    gap: 16px;
}
.ts-form-row .ts-form-group { flex: 1; }
@media (max-width: 600px) {
    .ts-form-row { flex-direction: column; gap: 0; }
}
.ts-hint       { font-size: 12px; color: #6b7280; margin-top: 4px; }
.ts-req        { color: #ef4444; }
.ts-empty      { color: #9ca3af; text-align: center; padding: 20px 0; }
.ts-char-count { display: inline; }

/* ラジオ・チェックボックス */
.ts-radio-label,
.ts-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 0;
}
.ts-radio-label input,
.ts-checkbox-label input { cursor: pointer; }

/* ジャンル行 */
.ts-genre-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.ts-price-input {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ts-price-input input { width: 100px; }

/* ---- テーブル ---- */
.ts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.ts-table th {
    background: #f9fafb;
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}
.ts-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

/* ---- 通知・メッセージ ---- */
.ts-notice {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #3730a3;
}
.ts-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    font-size: 14px;
    color: #92400e;
}
.ts-success-box {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
}
.ts-success-box h3 { color: #166534; margin-bottom: 12px; }
.ts-error-msg {
    color: #dc2626;
    font-size: 13px;
    padding: 8px 0;
}
.ts-msg-saving,
.ts-msg-saved { font-size: 13px; color: #6b7280; margin-left: 12px; }
.ts-msg-saved  { color: #16a34a; }

/* ---- 検索フォーム ---- */
.ts-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ts-search-form input,
.ts-search-form select { flex: 1; min-width: 160px; }

/* ---- オートコンプリート ---- */
.ts-autocomplete-wrap { position: relative; }
.ts-autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}
.ts-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
}
.ts-autocomplete-item:hover { background: #f3f4f6; }

/* ---- タブ ---- */
.ts-tab-buttons {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
}
.ts-tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.ts-tab-btn.ts-active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 500; }
.ts-tab-panel { display: block; }

/* ---- クリエイター一覧 ---- */
.ts-creator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.ts-creator-card {
    display: block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}
.ts-creator-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.ts-creator-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e5e7eb center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #6b7280;
    margin: 0 auto 12px;
    background-color: #e0e7ff;
    color: #6366f1;
}
.ts-creator-icon-sm {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.ts-creator-info { text-align: center; }
.ts-creator-info h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: #111827; }
.ts-rating { font-size: 13px; color: #f59e0b; }
.ts-min-price { display: block; font-size: 13px; color: #6366f1; font-weight: 500; margin-top: 4px; }
.ts-bio-preview { font-size: 12px; color: #9ca3af; margin-top: 6px; line-height: 1.5; }

/* ---- クリエイタープロフィール ---- */
.ts-creator-header {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg,#00CED1,#1E90FF) center/cover no-repeat;
    border-radius: 14px;
    margin-bottom: -60px;
}
.ts-profile-body { padding: 0 16px 24px; }
.ts-profile-top {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
}
.ts-profile-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg,#e0e7ff,#c7d2fe) center/cover no-repeat;
    border: 5px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: 800;
    color: #6366f1;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
}
.ts-profile-meta { flex: 1; }
.ts-profile-meta h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.ts-sns-links { display: flex; gap: 8px; margin-top: 6px; }
.ts-sns-x, .ts-sns-yt {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    color: #fff;
}
.ts-sns-x  { background: #000; }
.ts-sns-yt { background: #ff0000; }
.ts-profile-bio {
    font-size: 14px;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 24px;
    white-space: pre-wrap;
}
.ts-profile-section { margin-bottom: 24px; }
.ts-profile-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; color: #111827; }
.ts-genre-list { display: flex; flex-direction: column; gap: 8px; }
.ts-genre-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
}
.ts-genre-name  { font-size: 14px; color: #374151; font-weight: 500; }
.ts-genre-price { font-size: 14px; color: #6366f1; font-weight: 600; }
.ts-profile-cta { text-align: center; margin: 24px 0; }

/* ---- レビュー ---- */
.ts-review-card {
    border-bottom: 1px solid #f3f4f6;
    padding: 14px 0;
}
.ts-review-card:last-child { border-bottom: none; }
.ts-review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.ts-reviewer  { font-size: 13px; font-weight: 500; color: #374151; }
.ts-stars     { color: #f59e0b; letter-spacing: 1px; }
.ts-review-comment { font-size: 14px; color: #4b5563; line-height: 1.7; margin: 0; }
.ts-review-done { background: #f9fafb; border-radius: 8px; padding: 10px 14px; margin-top: 8px; }

/* スター評価フォーム */
.ts-star-row { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.ts-star-row input[type="radio"] { display: none; }
.ts-star-row label {
    font-size: 32px;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.1s;
    line-height: 1;
}
.ts-star-row label.ts-hovered,
.ts-star-row label.ts-selected { color: #f59e0b; }
.ts-review-textarea {
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    resize: vertical;
}

/* ---- 依頼カード ---- */
.ts-request-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 12px;
}
.ts-request-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.ts-amount    { font-size: 15px; font-weight: 700; color: #6366f1; }
.ts-genre-tag { font-size: 12px; background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 4px; }
.ts-date      { font-size: 12px; color: #9ca3af; margin-left: auto; }
.ts-request-preview { font-size: 13px; color: #6b7280; line-height: 1.6; margin: 0 0 10px; }
.ts-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ts-delivery-box {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0;
    font-size: 14px;
}
.ts-delivery-box h4 { margin: 0 0 8px; font-size: 13px; color: #166534; }
.ts-review-form { margin-top: 12px; }
.ts-review-form h4 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: #374151; }

/* ---- 売上サマリー ---- */
.ts-stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.ts-stat { flex: 1; min-width: 120px; text-align: center; }
.ts-stat-label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.ts-stat-value { display: block; font-size: 20px; font-weight: 700; color: #111827; }
.ts-highlight  { color: #6366f1 !important; }

/* ---- 決済 ---- */
.ts-order-summary { margin-bottom: 20px; }
.ts-order-summary h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.ts-summary-table th { width: 100px; font-weight: 500; font-size: 13px; color: #6b7280; padding: 8px 0; }
.ts-summary-table td { font-size: 14px; padding: 8px 0; border-bottom: 1px solid #f3f4f6; }
.ts-card-input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 14px 12px;
    margin-bottom: 16px;
    background: #fff;
    min-height: 40px;
}

/* ---- チケット購入 ---- */
.ts-ticket-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ts-price-display { font-size: 22px; font-weight: 700; color: #6366f1; margin: 4px 0; }

/* ---- 画像サムネイル ---- */
.ts-thumb       { max-width: 80px;  max-height: 80px;  border-radius: 50%;  object-fit: cover; display: block; margin-bottom: 8px; }
.ts-thumb-wide  { max-width: 200px; max-height: 80px;  border-radius: 6px;  object-fit: cover; display: block; margin-bottom: 8px; }

/* ---- 通話ルーム ---- */
.ts-countdown-display {
    font-size: 48px;
    font-weight: 700;
    color: #6366f1;
    text-align: center;
    padding: 20px 0;
    letter-spacing: 4px;
}
.ts-timer-display { font-size: 28px; font-weight: 700; color: #374151; }
.ts-call-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.ts-audio-area {
    background: #f9fafb;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6b7280;
}
.ts-call-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.ts-text-warning  { color: #b45309; }

/* ---- 通話スケジュール（クリエイタープロフィール） ---- */
.ts-schedule-list { display: flex; flex-direction: column; gap: 10px; }
.ts-schedule-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f0f4ff;
    border-radius: 10px;
    gap: 12px;
    flex-wrap: wrap;
}
.ts-schedule-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ts-schedule-date { font-size: 14px; font-weight: 600; color: #374151; }
.ts-schedule-dur  { font-size: 12px; background: #e0e7ff; color: #3730a3; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.ts-schedule-price{ font-size: 14px; font-weight: 700; color: #6366f1; }

/* ---- ステップインジケーター ---- */
.ts-step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
}
.ts-step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}
.ts-step-item.ts-step-active { color: #6366f1; font-weight: 700; }
.ts-step-item.ts-step-done   { color: #16a34a; }
.ts-step-num {
    width: 26px; height: 26px; border-radius: 50%;
    background: #e5e7eb; color: #9ca3af;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ts-step-item.ts-step-active .ts-step-num { background: #6366f1; color: #fff; }
.ts-step-item.ts-step-done   .ts-step-num { background: #16a34a; color: #fff; }
.ts-step-sep {
    flex: 1; height: 2px; background: #e5e7eb; margin: 0 8px; min-width: 24px;
}
.ts-step-sep.ts-step-done-line { background: #16a34a; }

/* ---- クリエイタープロフィールページ（2カラム） ---- */
.ts-creator-page-wrap { max-width: 1060px; }
.ts-creator-page-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
}
@media (max-width: 860px) {
    .ts-creator-page-layout { grid-template-columns: 1fr; }
    .ts-creator-page-right  { position: static !important; }
}
.ts-creator-page-right { position: sticky; top: 76px; }

/* プロフィールヘッダー統計 */
.ts-profile-stats-row {
    display: flex;
    gap: 20px;
    margin: 10px 0 6px;
    flex-wrap: wrap;
}
.ts-profile-stat-item { text-align: center; min-width: 52px; }
.ts-profile-stat-item .ts-stat-num {
    display: block;
    font-size: 1.3rem;
    font-weight: 800;
    color: #6366f1;
    line-height: 1.2;
}
.ts-profile-stat-item .ts-stat-label {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}
.ts-badge-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* タブ（style.css の .tabs に合わせるための上書き） */
.ts-creator-page-left .tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 16px;
}
.ts-creator-page-left .tab {
    padding: 10px 20px;
    font-weight: 600;
    color: #9ca3af;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    transition: all .2s;
}
.ts-creator-page-left .tab.active {
    color: #6366f1;
    border-bottom-color: #6366f1;
}