/**
 * CDT Filter UI Styles
 * フィルタUIのスタイル
 */

/* フィルタコンテナ */
.cdt-filter-container {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* フィルタラベル */
.cdt-filter-label {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

/* タイプ選択フィルタ */
.cdt-filter-select {
    margin-bottom: 20px;
}

.cdt-filter-select:last-child {
    margin-bottom: 0;
}

/* フィルタオプション（ボタン群） */
.cdt-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* フィルタオプションボタン */
.cdt-filter-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    min-height: 40px;
}

.cdt-filter-option:hover {
    background: #f5f5f5;
    border-color: #999;
}

.cdt-filter-option.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    font-weight: bold;
}

/* 「すべて」ボタン */
.cdt-filter-option-all.active {
    background: #666;
    border-color: #666;
}

/* フィルタアイコン */
.cdt-filter-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* フィルタラベルテキスト */
.cdt-filter-label-text {
    line-height: 1.4;
}

/* トグルフィルタ */
.cdt-filter-toggle {
    margin-bottom: 15px;
}

.cdt-filter-toggle:last-child {
    margin-bottom: 0;
}

/* トグルラベル */
.cdt-toggle-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #333;
}

.cdt-toggle-checkbox {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.cdt-toggle-text {
    line-height: 1.4;
}

/* 結果件数表示 */
.cdt-filter-count {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-size: 13px;
    color: #666;
    text-align: right;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .cdt-filter-options {
        gap: 8px;
    }

    .cdt-filter-option {
        padding: 6px 12px;
        font-size: 13px;
        min-height: 36px;
    }

    .cdt-filter-icon {
        width: 20px;
        height: 20px;
    }

    .cdt-filter-container {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .cdt-filter-options {
        gap: 6px;
    }

    .cdt-filter-option {
        padding: 5px 10px;
        font-size: 12px;
        min-height: 32px;
    }

    .cdt-filter-icon {
        width: 18px;
        height: 18px;
    }

    .cdt-filter-label-text {
        font-size: 12px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .cdt-filter-container {
        background: #2a2a2a;
        border-color: #444;
    }

    .cdt-filter-label {
        color: #e0e0e0;
    }

    .cdt-filter-option {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }

    .cdt-filter-option:hover {
        background: #3a3a3a;
        border-color: #777;
    }

    .cdt-filter-option.active {
        background: #0073aa;
        border-color: #0073aa;
        color: #fff;
    }

    .cdt-filter-option-all.active {
        background: #777;
        border-color: #777;
    }

    .cdt-toggle-label {
        color: #e0e0e0;
    }

    .cdt-filter-count {
        border-top-color: #444;
        color: #aaa;
    }
}

/* アクセシビリティ対応 */
.cdt-filter-option:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.cdt-toggle-checkbox:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* アニメーション */
.cdt-filter-option {
    transition: all 0.2s ease-in-out;
}

.cdt-filter-option.active {
    transform: scale(1.05);
}

/* アイコン付きボタンの調整 */
.cdt-filter-option:has(.cdt-filter-icon) {
    padding: 6px 12px;
}

/* 長いテキストの省略 */
.cdt-filter-label-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

@media (max-width: 768px) {
    .cdt-filter-label-text {
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    .cdt-filter-label-text {
        max-width: 80px;
    }
}
