/* ====================================
   リセットとベース
   ==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ====================================
   ヘッダー
   ==================================== */
header {
    background-color: #000000;
    background-image: url('../images/header_back_img.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    margin: 0 auto;
    width: 100%;
    padding: 20px 0;
}

#top {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 10px;
    text-align: center;
}

#top img {
    width: 80%;
    margin: 0 auto;
}

/* ====================================
   メインコンテナ
   ==================================== */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 10px;
    background-color: #fff;
    min-height: 600px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 3px solid #CC0000;
}

/* ====================================
   注意書きボックス
   ==================================== */
.notice-box {
    background-color: #FFF9E6;
    border: 1px solid #F90;
    padding: 10px 15px;
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: #666;
    border-radius: 3px;
}

.notice-box ul {
    list-style: none;
    padding-left: 0;
}

.notice-box li {
    position: relative;
    padding-left: 1em;
    margin-bottom: 3px;
}

.notice-box li:before {
    content: "※";
    position: absolute;
    left: 0;
}

.notice-box a {
    color: #0066c4;
    text-decoration: underline;
}

.notice-box a:hover {
    color: #CC0000;
}

/* ====================================
   フィルターコンテナ
   ==================================== */
.filter-container {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.filter-select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.filter-label {
    font-weight: bold;
    font-size: 0.875rem;
    color: #333;
}

.filter-select {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

.filter-select:focus {
    outline: none;
    border-color: #007c00;
}

.filter-select optgroup {
    font-weight: bold;
    color: #333;
    background-color: #f5f5f5;
}

.filter-select option {
    padding: 5px;
    font-weight: normal;
}

.filter-select option[data-count="0"] {
    color: #ccc;
}

.filter-select option[value="all"] {
    font-weight: bold;
    background-color: #f9f9f9;
}

.filter-select option[data-recent="true"] {
    background-color: #fff9e6;
}

.filter-select option[data-popular="true"] {
    background-color: #e6f7ff;
    font-weight: bold;
}

.filter-select option[data-nearby="true"] {
    background-color: #f0f9ff;
}

.filter-status {
    font-size: 0.75rem;
    color: #666;
    padding: 5px;
    background-color: #fff;
    border-radius: 3px;
    display: inline-block;
}

.filter-status.filtered {
    color: #CC0000;
    font-weight: bold;
}

.filter-loading {
    display: none;
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4BC24B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.filter-select-wrapper.loading .filter-loading {
    display: block;
}

/* フィルター適用時の非表示 */
.event-item.filtered-out,
.schedule-date-row.filtered-out {
    display: none;
}

/* ====================================
   月選択ナビゲーション
   ==================================== */
.month-nav-container {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    touch-action: pan-y;
    position: relative;
    overflow: visible;
    user-select: none;
}

.month-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nav-button {
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 20px;
    color: #666;
    flex-shrink: 0;
}

.nav-button:hover:not(:disabled) {
    background: #CC0000;
    color: white;
    transform: scale(1.05);
}

.nav-button:active:not(:disabled) {
    transform: scale(0.95);
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.month-display {
    flex: 1;
    text-align: center;
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
    padding: 10px;
    position: relative;
    min-width: 0;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.month-display:hover {
    background-color: #f0f0f0;
}

.month-display.active {
    background-color: #f0f0f0;
}

.month-display::after {
    content: '▼';
    font-size: 0.75rem;
    margin-left: 8px;
    color: #999;
    transition: transform 0.3s;
}

.month-display.active::after {
    transform: rotate(180deg);
}

/* 月表示のアニメーション */
.month-display.sliding-left {
    animation: slideLeft 0.3s ease;
}

.month-display.sliding-right {
    animation: slideRight 0.3s ease;
}

@keyframes slideLeft {
    0% { transform: translateX(30px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes slideRight {
    0% { transform: translateX(-30px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* 月選択ドロップダウン */
.month-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    overflow: hidden;
    min-width: 250px;
    max-width: 90%;
    max-height: 400px;
    overflow-y: auto;
}

.month-dropdown.show {
    display: block;
    animation: dropIn 0.3s ease;
}

@keyframes dropIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.month-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-option:last-child {
    border-bottom: none;
}

.month-option:hover:not(.disabled) {
    background: #f9f9f9;
}

.month-option.current {
    background: #CC0000;
    color: white;
    font-weight: bold;
}

.month-option.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #fafafa;
}

.month-option .event-count {
    font-size: 0.75rem;
    opacity: 0.7;
    background: rgba(0,0,0,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.month-option.current .event-count {
    background: rgba(255,255,255,0.2);
}

/* スワイプインジケーター */
.swipe-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
    padding: 5px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s;
    cursor: pointer;
}

.dot:hover {
    background: #aaa;
}

.dot.active {
    background: #CC0000;
    width: 24px;
    border-radius: 4px;
}

.swipe-hint {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.swipe-hint.show {
    opacity: 1;
}

/* ====================================
   スケジュール表示
   ==================================== */
.schedule-container {
    display: none;
}

.schedule-container.active {
    display: block;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    table-layout: auto;
}

/* 日付行 */
.schedule-date-row {
    border-top: 2px solid #ddd;
}

.schedule-date-row td {
    padding: 12px 15px;
    vertical-align: top;
}

.schedule-date-row td:first-child {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
}

.date-cell {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
    white-space: nowrap;
    text-align: center;  /* 全サイズで中央揃え */
}

.date-cell .date-number {
    display: inline-block;
    font-weight: bold;
}

.date-cell .date-number.sunday {
    color: #CC0000;
}

.date-cell .date-number.saturday {
    color: #0066c4;
}

.date-cell .day-of-week {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.875rem;
    font-weight: bold;
}

.date-cell .sunday {
    color: #CC0000;
}

.date-cell .saturday {
    color: #0066c4;
}

/* イベント情報 */
.event-list {
    width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.event-item {
    padding: 8px 10px;
    border-bottom: 1px dotted #ddd;
    cursor: pointer;
    transition: background-color 0.2s;
    /* border-radius削除 */
}

.event-item:first-child {
    padding-top: 3px;
}

.event-item:hover {
    background-color: #f9f9f9;
}

.event-item:last-child {
    border-bottom: none;
}

.event-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    transition: opacity 0.3s;
}

.event-item:hover .event-header {
    opacity: 0.9;
}

/* 県名タグ */
.prefecture-tag {
    display: inline-block;
    padding: 2px 12px;  /* 全サイズ共通に変更 */
    font-size: 0.75rem;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    /* border-radius削除 */
}

.prefecture-tag.online {
    background-color: #0066c4;
}

.prefecture-tag.prefecture {
    background-color: #007c00;
}

.prefecture-tag.other {
    background-color: #999;
}

/* イベントタイトル */
.event-title {
    flex: 1;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    word-break: break-word;
    overflow-wrap: break-word;
}

.event-title:hover {
    color: #CC0000;
    text-decoration: underline;
}

/* イベント詳細 */
.event-details {
    margin-bottom: 5px;
    font-size: 0.875rem;
    color: #666;
    line-height: 1.6;
}

.event-venue {
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: #666;
}

.event-desc-text {
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: #666;
}

.venue-link {
    color: #333;
    text-decoration: none;
    word-break: break-word;
    overflow-wrap: break-word;
}

.venue-link:hover {
    color: #CC0000;
    text-decoration: underline;
}

.venue-link i {
    margin-right: 4px;
    color: #666;
}

.venue-text {
    color: #666;
}

.event-description {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #CC0000;
    border-radius: 0 3px 3px 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.event-description.show {
    display: block;
}

.event-link {
    display: inline-block;
    margin-top: 8px;
    color: #0099CC;
    font-size: 0.875rem;
    text-decoration: underline;
}

.event-link:hover {
    color: #CC0000;
}

.event-link i {
    margin-right: 4px;
}

.event-time i {
    margin-right: 4px;
    color: #666;
}

/* ====================================
   ユーティリティ
   ==================================== */
.no-events {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 1rem;
}

.loading {
    padding: 40px;
    text-align: center;
    color: #999;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #CC0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====================================
   広告エリア
   ==================================== */
.adsense-container {
    margin: 20px 0;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    text-align: center;
    min-height: 100px;
}

.adsense-top {
    margin-top: 0;
    margin-bottom: 20px;
}

.adsense-bottom {
    margin-top: 30px;
    margin-bottom: 10px;
}

/* モバイルでの広告表示調整 */
@media (max-width: 750px) {
    .adsense-container {
        margin: 15px -10px;
        padding: 10px;
    }
}

/* ====================================
   フッター
   ==================================== */
footer {
    background-color: #000000;
    color: #FFFFFF;
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
}

footer p {
    font-size: 0.75rem;
    margin: 5px 0;
}

/* ====================================
   レスポンシブデザイン
   ==================================== */

/* PC向けの追加スタイル */
@media (min-width: 751px) {
    .filter-select-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }
    
    .filter-select {
        max-width: 400px;
    }
}

/* タブレット・大型スマホ対応 */
@media (max-width: 750px) {
    .container {
        padding: 15px 10px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    /* 月ナビゲーション調整 */
    .month-nav-container {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .month-nav-header {
        gap: 5px;
    }
    
    .nav-button {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .month-display {
        font-size: 1rem;
        padding: 8px 5px;
    }
    
    .month-dropdown {
        left: 10px;
        right: 10px;
        transform: none;
        width: calc(100% - 20px);
        min-width: auto;
    }
    
    .swipe-indicator {
        margin-top: 10px;
    }
    
    /* スケジュールテーブル調整 */
    .schedule-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .schedule-table {
        min-width: 100%;
    }
    
    .schedule-date-row td {
        padding: 10px 8px;
    }
    
    .schedule-date-row td:first-child {
        width: 85px;
        min-width: 85px;
        max-width: 85px;
    }
    
    .date-cell {
        font-size: 0.875rem;
        text-align: center;  /* left → centerに変更 */
    }
    
    .date-cell .date-number {
        font-size: 1rem;
    }
    
    .date-cell .day-of-week {
        font-size: 0.8rem;
        margin-left: 3px;
    }
    
    /* イベント表示調整（重要：フォントサイズを大きく） */
    .event-item {
        padding: 10px 8px;
    }
    
    .event-header {
        gap: 8px;
    }
    
    .prefecture-tag {
        font-size: 0.7rem;
        /* paddingは共通の2px 12pxを使用 */
    }
    
    /* モバイルでタイトルを大きく表示 */
    .event-title {
        font-size: 1.1rem;  /* 1.05rem → 1.1remに拡大 */
        line-height: 1.4;
        font-weight: 600;
    }
    
    .event-details,
    .event-time,
    .event-venue,
    .event-desc-text {
        font-size: 0.875rem;  /* 0.85rem → 0.875remに統一 */
    }
    
    .event-description {
        padding: 8px;
    }
    
    .filter-container {
        padding: 10px;
    }
    
    .filter-select {
        font-size: 0.875rem;
    }
}

/* 小型スマホ対応 */
@media (max-width: 500px) {
    .schedule-date-row td:first-child {
        width: 60px;  /* 75px → 60pxに変更 */
        min-width: 60px;
        max-width: 60px;
        padding: 8px 4px;
    }
    
    .date-cell {
        font-size: 0.95rem;  /* 0.9rem → 0.95remに拡大 */
    }
    
    .date-cell .date-number {
        font-size: 1.1rem;  /* 1.05rem → 1.1remに拡大 */
        display: block;  /* 縦並びを確実にする */
    }
    
    .date-cell .day-of-week {
        font-size: 0.9rem;  /* 0.85rem → 0.9remに拡大 */
        margin-left: 0;  /* 2px → 0に変更 */
        display: block;  /* 縦並びにする */
    }
    
    /* イベントヘッダーを縦並びに */
    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .prefecture-tag {
        margin-bottom: 2px;
        /* paddingは共通の2px 12pxを使用 */
    }
    
    /* 小型スマホでもタイトルを読みやすく */
    .event-title {
        width: 100%;
        font-size: 1.1rem;  /* 1rem → 1.1remに拡大 */
        line-height: 1.5;
    }
    
    .event-details,
    .event-time {
        font-size: 0.9rem;  /* 0.875rem → 0.9remに拡大 */
    }
    
    .event-venue,
    .event-desc-text {
        font-size: 0.875rem;  /* 0.85rem → 0.875remに拡大 */
    }
    
    .event-description.show {
        font-size: 0.85rem;  /* 詳細表示時も読みやすく */
    }
}