/* ============================================
 * BBS風楽曲リクエスト管理システム
 * メインスタイルシート - ネオBBSデザインシステム
 * ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* ============================================
 * CSS Custom Properties (テーマ変数)
 * ============================================ */
:root {
    /* ダークモード (デフォルト) */
    --bg-primary: #1E1E1E;
    --bg-secondary: #252525;
    --bg-tertiary: #2D2D2D;
    --bg-card: #2A2A2E;
    --bg-card-hover: #333338;
    --bg-input: #1A1A1E;
    --bg-modal-overlay: rgba(0, 0, 0, 0.65);
    --bg-sidebar: #191919;

    --text-primary: #E4E4E7;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    --text-accent: #A78BFA;

    --accent-primary: #7C3AED;
    --accent-primary-hover: #6D28D9;
    --accent-secondary: #3B82F6;
    --accent-secondary-hover: #2563EB;

    --border-color: #3F3F46;
    --border-light: #27272A;

    /* ステータスカラー */
    --status-unanswered: #EF4444;
    --status-unanswered-bg: rgba(239, 68, 68, 0.12);
    --status-keeping: #F59E0B;
    --status-keeping-bg: rgba(245, 158, 11, 0.12);
    --status-answered: #10B981;
    --status-answered-bg: rgba(16, 185, 129, 0.12);
    --status-draft: #6B7280;
    --status-draft-bg: rgba(107, 114, 128, 0.12);

    /* タグカラー */
    --tag-bg: rgba(124, 58, 237, 0.15);
    --tag-text: #C4B5FD;
    --tag-border: rgba(124, 58, 237, 0.3);

    /* シャドウ */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 6px 20px rgba(0, 0, 0, 0.4);

    /* レイアウト */
    --sidebar-width: 240px;
    --header-height: 56px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;

    /* アニメーション */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* トースト */
    --toast-bg: #323236;
    --toast-text: #E4E4E7;
}

/* ライトモード */
[data-theme="light"] {
    --bg-primary: #F4F4F5;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E4E4E7;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F9FAFB;
    --bg-input: #FFFFFF;
    --bg-modal-overlay: rgba(0, 0, 0, 0.4);
    --bg-sidebar: #FAFAFA;

    --text-primary: #18181B;
    --text-secondary: #52525B;
    --text-muted: #A1A1AA;
    --text-accent: #7C3AED;

    --border-color: #D4D4D8;
    --border-light: #E4E4E7;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.1);

    --tag-bg: rgba(124, 58, 237, 0.08);
    --tag-text: #7C3AED;
    --tag-border: rgba(124, 58, 237, 0.2);

    --toast-bg: #18181B;
    --toast-text: #F4F4F5;
}

/* ============================================
 * リセット・ベース
 * ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent-secondary-hover);
    text-decoration: underline;
}

::selection {
    background-color: var(--accent-primary);
    color: #fff;
}

/* ============================================
 * レイアウト
 * ============================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- サイドバー --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.data-table th, .data-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    font-size: 14px;
}

.sidebar__logo {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar__logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}
.sidebar__logo-text {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
}

.sidebar__nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.sidebar__section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 12px 12px 6px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}
.sidebar__link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
}
.sidebar__link--active {
    background: var(--accent-primary);
    color: #fff;
}
.sidebar__link--active:hover {
    background: var(--accent-primary-hover);
    color: #fff;
}
.sidebar__link-icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar__user {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.sidebar__user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- メインコンテンツ --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* --- ヘッダー --- */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header__hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--border-radius-sm);
}
.header__hamburger:hover {
    background: var(--bg-tertiary);
}

.header__title {
    font-size: 16px;
    font-weight: 700;
}

.header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- ページコンテンツ --- */
.page-content {
    padding: 24px;
}

/* ============================================
 * コンポーネント：ボタン
 * ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover {
    text-decoration: none;
}
.btn:active {
    transform: scale(0.97);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    background: var(--accent-primary);
    color: #fff;
}
.btn--primary:hover {
    background: var(--accent-primary-hover);
    color: #fff;
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn--secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn--danger {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn--danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn--ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn--sticky {
    position: sticky;
    bottom: 16px;
    width: 100%;
}

/* ============================================
 * コンポーネント：質問カード
 * ============================================ */
.question-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
}
.question-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    border-color: var(--border-color);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    position: relative;
    transition: all var(--transition-fast);
}

.question-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.question-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.question-card__status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.question-card__status--unanswered {
    background: var(--status-unanswered-bg);
    color: var(--status-unanswered);
}
.question-card__status--keeping {
    background: var(--status-keeping-bg);
    color: var(--status-keeping);
}
.question-card__status--answered {
    background: var(--status-answered-bg);
    color: var(--status-answered);
}

.question-card__preview {
    background: var(--bg-input);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 80px;
    overflow: hidden;
    position: relative;
}
.question-card__preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: linear-gradient(transparent, var(--bg-input));
}

.question-card__preview-img {
    max-width: 100%;
    max-height: 120px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
}

/* モーダル内プレビュー: 制限解除してフル表示 */
.modal__body .question-card__preview {
    max-height: none;
    overflow: visible;
    min-height: 120px;
}
.modal__body .question-card__preview::after {
    display: none;
}
.modal__body .question-card__preview-img {
    max-height: 300px;
    object-fit: contain;
}

.question-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.question-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.question-card__platform {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.question-card__info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}
.question-card__info-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ============================================
 * コンポーネント：タグ
 * ============================================ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
    background: var(--tag-bg);
    color: var(--tag-text);
    border: 1px solid var(--tag-border);
}

/* ============================================
 * コンポーネント：モーダル
 * ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn var(--transition-base) ease;
}
.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-slow) ease;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.modal__title {
    font-size: 16px;
    font-weight: 700;
}

.modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}
.modal__close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* スライド型モーダルコンテンツ */
.modal__slider {
    display: flex;
    width: 500%; /* 5画面分 */
    transition: transform var(--transition-slow);
    min-height: 0;
    flex: 1;
}
.modal__slider--view-b {
    transform: translateX(-20%);
}
.modal__slider--view-c {
    transform: translateX(-40%);
}
.modal__slider--view-d {
    transform: translateX(-60%);
}
.modal__slider--view-e {
    transform: translateX(-80%);
}

.modal__view {
    width: 20%; /* 1/5 */
    flex-shrink: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal__body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.modal__footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================
 * コンポーネント：フォーム
 * ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-label--required::after {
    content: ' *';
    color: var(--status-unanswered);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A1A1AA' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-error {
    font-size: 12px;
    color: var(--status-unanswered);
    margin-top: 4px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
 * コンポーネント：ツールバー
 * ============================================ */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
}

.toolbar__group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar__tab {
    padding: 6px 14px;
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}
.toolbar__tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.toolbar__tab--active {
    background: var(--accent-primary);
    color: #fff;
}

/* ============================================
 * コンポーネント：リスト表示
 * ============================================ */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============================================
 * コンポーネント：リマインド連携
 * ============================================ */
.reminder-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
    width: 100%;
}
.reminder-option:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.reminder-option__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.reminder-option__info {
    flex: 1;
}

.reminder-option__title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.reminder-option__desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.bg-red-100 { background: rgba(239, 68, 68, 0.1); }
.bg-blue-100 { background: rgba(59, 130, 246, 0.1); }
.bg-purple-100 { background: rgba(139, 92, 246, 0.1); }
.text-red-500 { color: #EF4444; }
.text-blue-500 { color: #3B82F6; }
.text-purple-500 { color: #8B5CF6; }

/* タグ選択UI (編集画面用) */
.tag-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}
.tag-checkbox-item:hover {
    background: var(--bg-card-hover);
}
.tag-checkbox-item input:checked + span {
    color: var(--accent-primary);
    font-weight: bold;
}
.tag-checkbox-item:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.1);
}

/* ============================================
 * コンポーネント：カンバン表示
 * ============================================ */
.kanban {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.kanban__column {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    border: 1px solid var(--border-light);
}

.kanban__column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.kanban__column-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban__column-count {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 12px;
    color: var(--text-muted);
}

.kanban__cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ============================================
 * コンポーネント：回答プレビュー
 * ============================================ */
.response-preview {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
}

.response-preview__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.response-preview__output {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.response-preview__thumbnail {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.response-preview__thumb-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    width: 200px;
}
.response-preview__thumb-card img {
    width: 100%;
    height: 112px;
    object-fit: cover;
}
.response-preview__thumb-card-info {
    padding: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
 * コンポーネント：回答リスト（モーダル内）
 * ============================================ */
.response-item {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 12px;
    border: 1px solid var(--border-light);
    margin-bottom: 8px;
}

.response-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.response-item__author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}
.response-item__author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.response-item__status-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 99px;
}

.response-item__content {
    font-size: 14px;
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 1.6;
}

.response-item__urls {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.response-item__url {
    font-size: 12px;
    color: var(--accent-secondary);
    word-break: break-all;
}

/* ============================================
 * コンポーネント：ページネーション
 * ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
}

.pagination__btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.pagination__btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}
.pagination__btn--active {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}
.pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
 * コンポーネント：トースト通知
 * ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: var(--toast-bg);
    color: var(--toast-text);
    padding: 12px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    pointer-events: auto;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.toast--success {
    border-left: 3px solid var(--status-answered);
}
.toast--error {
    border-left: 3px solid var(--status-unanswered);
}
.toast--info {
    border-left: 3px solid var(--accent-secondary);
}

/* ============================================
 * コンポーネント：確認ダイアログ
 * ============================================ */
.confirm-modal {
    max-width: 400px;
}
.confirm-modal__message {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    padding: 24px 20px;
    line-height: 1.7;
}

/* ============================================
 * コンポーネント：統計カード
 * ============================================ */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.stat-card__label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card__change {
    font-size: 12px;
    margin-top: 4px;
}
.stat-card__change--up {
    color: var(--status-answered);
}

/* ============================================
 * コンポーネント：管理タブ
 * ============================================ */
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 24px;
}

.admin-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color var(--transition-fast);
    font-family: inherit;
}
.admin-tab:hover {
    color: var(--text-primary);
}
.admin-tab--active {
    color: var(--accent-primary);
}
.admin-tab--active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px 2px 0 0;
}

.admin-panel {
    display: none;
}
.admin-panel.active {
    display: block;
}

/* ============================================
 * コンポーネント：空状態
 * ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state__icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.empty-state__text {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ============================================
 * コンポーネント：ログイン画面
 * ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 380px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.login-card__logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.login-card__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-card__desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

.btn--discord {
    background: #5865F2;
    color: #fff;
    width: 100%;
    padding: 12px;
    font-size: 15px;
}
.btn--discord:hover {
    background: #4752C4;
    color: #fff;
}

/* ============================================
 * コンポーネント：キープ表示
 * ============================================ */
.keeper-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--status-keeping-bg);
    color: var(--status-keeping);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 500;
}
.keeper-badge__avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

/* ============================================
 * コンポーネント：動的URL追加
 * ============================================ */
.url-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.url-field-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.url-field-row .form-input:first-child {
    width: 140px;
    flex-shrink: 0;
}
.url-field-row .form-input:nth-child(2) {
    flex: 1;
}

.url-field-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 10px 4px;
    transition: color var(--transition-fast);
}
.url-field-remove:hover {
    color: var(--status-unanswered);
}

/* ============================================
 * アニメーション
 * ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ============================================
 * テーブル・レスポンシブ
 * ============================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* ============================================
 * レスポンシブ対応
 * ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header__hamburger {
        display: block;
    }

    .page-content {
        padding: 16px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar__group {
        justify-content: center;
    }

    .kanban {
        grid-template-columns: 1fr;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .url-field-row {
        flex-direction: column;
    }
    .url-field-row .form-input:first-child {
        width: 100%;
    }

    .login-card {
        width: 100%;
        margin: 16px;
    }

    .w-full-mobile {
        width: 100%;
    }
    .w-full-mobile > * {
        flex: 1;
    }
    .flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .tag-add-area {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .tag-add-area .form-input {
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }
}

/* --- モバイルドロワー用オーバーレイ --- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
}
.sidebar-overlay.active {
    display: block;
}

/* ============================================
 * ユーティリティ
 * ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
 * コンポーネント：動画サムネイル
 * ============================================ */
.video-thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.video-thumbnail {
    max-width: 600px;
    max-height: 315px;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
}

/* --- タグチップ入力UI --- */
.tag-input-container {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 42px;
    position: relative;
}
.tag-input-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

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

.tag--removable {
    padding-right: 4px;
    gap: 4px;
}

.tag__remove {
    background: none;
    border: none;
    color: currentColor;
    opacity: 0.6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}
.tag__remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

#js-edit-tags-input {
    border: 1px solid var(--border-color) !important;
    background: var(--bg-input) !important;
    box-shadow: none !important;
    padding: 8px 12px !important;
    flex: 1;
    min-width: 120px;
    height: auto !important;
    border-radius: var(--border-radius);
}

#js-edit-tags-input:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15) !important;
}

.tag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.suggest-item {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.1s;
}

.suggest-item:hover {
    background: var(--bg-tertiary);
}

.tag-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    transition: background var(--transition-fast);
}
.tag-suggestion-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

/* --- タグバッジ（選択済みタグ表示） --- */
.tag-badge-selected {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.tag-badge-selected .remove-tag {
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.8;
    font-size: 14px;
}
.tag-badge-selected .remove-tag:hover {
    opacity: 1;
}
