/* イベント一覧フィルタ機能のスタイル */

.shgk-event-list-wrapper {
    margin: 20px 0;
}

.shgk-event-filter {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

/* テキスト検索入力 */
.shgk-event-filter .shgk-filter-search {
    margin-bottom: 12px;
}

.shgk-event-filter .shgk-event-name-filter,
.shgk-event-filter .shgk-school-name-filter {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.shgk-event-filter .shgk-event-name-filter:focus,
.shgk-event-filter .shgk-school-name-filter:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
    outline: none;
}

/* 選択中フィルタ表示エリア */
.shgk-event-filter .shgk-active-filters {
    margin-bottom: 16px;
    padding: 12px;
    background: #f0f7ff;
    border-radius: 8px;
}

.shgk-event-filter .shgk-active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.shgk-event-filter .shgk-active-filters-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.shgk-event-filter .shgk-active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.shgk-event-filter .shgk-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #0073aa;
    color: #fff;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
}

.shgk-event-filter .shgk-active-filter-label {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shgk-event-filter .shgk-remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: background 0.2s ease;
}

.shgk-event-filter .shgk-remove-filter:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* すべてクリアボタン */
.shgk-event-filter .shgk-clear-all-btn {
    padding: 4px 12px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shgk-event-filter .shgk-clear-all-btn:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

/* 条件フィルタエリア */
.shgk-event-filter .shgk-filter-conditions {
    margin-bottom: 16px;
}

/* アコーディオングループ */
.shgk-event-filter .shgk-filter-group {
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.shgk-event-filter .shgk-accordion-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.shgk-event-filter .shgk-accordion-toggle:hover {
    background: #f9f9f9;
}

.shgk-event-filter .shgk-accordion-toggle[aria-expanded="true"] {
    background: #f5f5f5;
}

.shgk-event-filter .shgk-accordion-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.shgk-event-filter .shgk-accordion-toggle[aria-expanded="true"] .shgk-accordion-icon {
    transform: rotate(180deg);
}

.shgk-event-filter .shgk-accordion-content {
    display: none;
    padding: 12px 16px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 8px;
}

/* ピルボタン */
.shgk-event-filter .shgk-pill-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 2px;
}

.shgk-event-filter .shgk-pill-button .shgk-pill-count {
    font-size: 12px;
    color: #999;
}

.shgk-event-filter .shgk-pill-button:hover {
    border-color: #0073aa;
    background: #f0f7ff;
}

.shgk-event-filter .shgk-pill-button.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.shgk-event-filter .shgk-pill-button.active .shgk-pill-count {
    color: rgba(255, 255, 255, 0.8);
}

.shgk-event-filter .shgk-pill-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* フィルタ件数表示 */
.shgk-event-filter .shgk-filter-count {
    margin-top: 16px;
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px solid #ddd;
    font-weight: bold;
    color: #0073aa;
}

.shgk-event-filter .shgk-filter-count span {
    font-size: 1.2em;
}

/* イベントアイテムの非表示時のアニメーション */
.shgk-event-item {
    transition: opacity 0.2s ease-in-out;
}

.shgk-event-item[style*="display: none"] {
    opacity: 0;
}

/* PC版（768px以上で表示） */
.shgk-event-filter .shgk-filter-desktop {
    display: block;
}

/* スマホ版（768px未満で表示） */
.shgk-event-filter .shgk-filter-mobile {
    display: none;
}

/* レスポンシブ切り替え */
@media (max-width: 768px) {
    .shgk-event-filter {
        padding: 14px;
    }

    .shgk-event-filter .shgk-event-name-filter,
    .shgk-event-filter .shgk-school-name-filter {
        padding: 8px 12px;
        font-size: 16px; /* iOS zoom防止 */
    }

    .shgk-event-filter .shgk-filter-desktop {
        display: none;
    }

    .shgk-event-filter .shgk-filter-mobile {
        display: block;
        margin-bottom: 16px;
    }

    .shgk-event-filter .shgk-open-filters-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px 20px;
        background: #0073aa;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        color: #fff;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .shgk-event-filter .shgk-open-filters-btn:hover {
        background: #005a87;
    }

    .shgk-event-filter .shgk-open-filters-btn:active {
        background: #004a6f;
    }

    .shgk-event-filter .shgk-filter-icon {
        font-size: 14px;
    }

    .shgk-event-filter .shgk-filter-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        height: 24px;
        padding: 0 8px;
        background: #fff;
        color: #0073aa;
        border-radius: 12px;
        font-size: 13px;
        font-weight: 700;
    }

    .shgk-event-filter .shgk-pill-button {
        padding: 6px 12px;
        font-size: 13px;
    }

    .shgk-event-filter .shgk-active-filter-tag {
        font-size: 12px;
    }
}

/* ボトムシート（モバイル専用） */
.shgk-event-filter .shgk-bottom-sheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.shgk-event-filter .shgk-bottom-sheet.active {
    display: block;
}

.shgk-event-filter .shgk-bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: shgk-event-fadeIn 0.3s ease;
}

.shgk-event-filter .shgk-bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    animation: shgk-event-slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.shgk-event-filter .shgk-bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.shgk-event-filter .shgk-bottom-sheet-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.shgk-event-filter .shgk-close-bottom-sheet {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: background 0.2s ease;
}

.shgk-event-filter .shgk-close-bottom-sheet:hover {
    background: #f5f5f5;
}

.shgk-event-filter .shgk-bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.shgk-event-filter .shgk-bottom-sheet-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.shgk-event-filter .shgk-bottom-sheet-footer button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shgk-event-filter .shgk-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.shgk-event-filter .shgk-btn-secondary:hover {
    background: #e0e0e0;
}

.shgk-event-filter .shgk-btn-primary {
    background: #0073aa;
    color: #fff;
}

.shgk-event-filter .shgk-btn-primary:hover {
    background: #005a87;
}

.shgk-event-filter .shgk-btn-primary:active {
    background: #004a6f;
}

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

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