/* =============================================
   共通コンポーネント
   ============================================= */

/* ======= ボタン ======= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

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

.btn-primary:hover { opacity: 0.9; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-accent {
    background: var(--accent);
    color: var(--text-white);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-round {
    border-radius: 50px;
}

/* ======= カード ======= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 1px 4px var(--shadow);
    overflow: hidden;
}

.card-body {
    padding: 14px 16px;
}

/* ======= 鑑定師カード ======= */
.teller-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 1px 6px var(--shadow);
    padding: 14px;
    display: flex;
    gap: 12px;
    transition: transform 0.15s;
    cursor: pointer;
}

.teller-card:active {
    transform: scale(0.98);
}

.teller-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-bg);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 24px;
}

.teller-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teller-info {
    flex: 1;
    min-width: 0;
}

.teller-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online  { background: var(--online); }
.status-dot.busy    { background: var(--busy); }
.status-dot.offline { background: var(--offline); }

.teller-catch {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teller-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.teller-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--star);
    font-weight: 600;
}

.teller-rate {
    color: var(--primary);
    font-weight: 600;
}

/* ======= 鑑定師ミニカード（横スクロール用）======= */
.teller-mini-card {
    width: 140px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 1px 6px var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s;
}

.teller-mini-card:active {
    transform: scale(0.97);
}

.teller-mini-avatar {
    width: 100%;
    height: 100px;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 36px;
    position: relative;
}

.teller-mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teller-mini-status {
    position: absolute;
    top: 6px;
    right: 6px;
}

.teller-mini-body {
    padding: 8px 10px;
}

.teller-mini-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teller-mini-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ======= タグ ======= */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 500;
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.tag-active {
    background: var(--primary) !important;
    color: var(--text-white) !important;
    cursor: pointer;
}

.tag-sm {
    padding: 2px 8px;
    font-size: 10px;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag.method { background: #e8e0f0; color: #6b4c8a; }
.tag.style  { background: var(--accent-light); color: #8a7440; }

/* ======= 評価星 ======= */
.stars {
    display: inline-flex;
    gap: 1px;
    color: var(--star);
    font-size: 14px;
}

.stars .empty {
    color: var(--border);
}

/* ======= フォーム ======= */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--bg-card);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-select {
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ======= モーダル ======= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
    animation: slideUp 0.3s ease;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* ======= レビューカード ======= */
.review-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px var(--shadow);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.review-user {
    font-size: 13px;
    font-weight: 600;
}

.review-date {
    font-size: 11px;
    color: var(--text-muted);
}

.review-content {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.7;
}

/* ======= リスト ======= */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s;
}

.list-item:active {
    background: var(--bg-card-alt);
}

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

.list-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.list-body {
    flex: 1;
    min-width: 0;
}

.list-title {
    font-size: 14px;
    font-weight: 500;
}

.list-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.list-arrow {
    color: var(--text-muted);
    font-size: 16px;
}

/* ======= フィルターバー ======= */
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-light);
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-chip.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

/* ======= ページネーション ======= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
}

.pagination button.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ======= 通知 ======= */
.notification-unread {
    border-left: 3px solid var(--primary);
}

/* ======= ステータスバッジ ======= */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.status-online  { background: #e8f5e9; color: #2e7d32; }
.status-busy    { background: #fff3e0; color: #e65100; }
.status-offline { background: #f5f5f5; color: #9e9e9e; }

/* ======= 法的ページ ======= */
.legal-page {
    padding: 20px 16px 40px;
}

.legal-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4px;
}

.legal-update {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.legal-section {
    margin-bottom: 24px;
}

.legal-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary-dark);
    border-left: 3px solid var(--primary);
    padding-left: 10px;
}

.legal-section p,
.legal-section li {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-light);
}

.legal-section ol,
.legal-section ul {
    padding-left: 20px;
    margin: 8px 0;
}

.legal-section li {
    margin-bottom: 4px;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.legal-table th,
.legal-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: top;
    line-height: 1.7;
}

.legal-table th {
    width: 30%;
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--text);
    white-space: nowrap;
}

.legal-table td {
    color: var(--text-light);
}

/* ======= FAQ・ヘルプ ======= */
.faq-category-title {
    font-size: 14px;
    font-weight: 700;
    padding: 12px 16px 8px;
    color: var(--primary-dark);
}

.faq-item {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    gap: 12px;
}

.faq-question:active {
    background: var(--bg-card-alt);
}

.faq-toggle {
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.faq-item.open .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    display: none;
    padding: 0 16px 14px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-light);
}

.faq-item.open .faq-answer {
    display: block;
}

/* ======= 設定ページ ======= */
.settings-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 16px 16px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ======= コンセプトページ（オンボーディング） ======= */
.concept-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: #1a0a2e;
    overflow: hidden;
}

.concept-slider {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.concept-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.concept-image {
    flex: 1;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.concept-text {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    padding: 32px 24px 80px;
    background: linear-gradient(to top, rgba(20, 8, 40, 0.95) 0%, rgba(20, 8, 40, 0.7) 60%, transparent 100%);
    text-align: center;
    color: #fff;
}

.concept-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.concept-subtitle {
    font-size: 14px;
    margin: 0;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

.concept-start-btn {
    display: inline-block;
    margin-top: 24px;
    padding: 14px 56px;
    background: linear-gradient(135deg, #d4758c, #b85a9a);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 117, 140, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

.concept-start-btn:active {
    transform: scale(0.96);
}

.concept-dots {
    position: fixed;
    bottom: 32px;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 10000;
}

.concept-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.concept-dot.active {
    background: #fff;
    transform: scale(1.3);
}

.concept-skip {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 13px;
    cursor: pointer;
}

.concept-fade-out {
    animation: conceptFadeOut 0.4s ease forwards;
}

@keyframes conceptFadeOut {
    to { opacity: 0; }
}

/* ======= ヘッダーロゴ ======= */
.header-logo {
    height: 32px;
    width: auto;
    vertical-align: middle;
}
