/* ========= スケジュールページ（再構築版）カラー変数 ========= */
:root {
    --schedule-primary: #2563EB;
    --schedule-secondary: #3B82F6;
    --schedule-accent: #F97316;
    --schedule-bg: #FFFFFF;
    --schedule-bg-alt: #F8FAFC;
    --schedule-text: #1E293B;
    --schedule-text-muted: #64748B;
    --schedule-border: #E2E8F0;
}

body {
    align-items: center;
    background-color: #f8fafc; /* セクション接続色と統一 */
}

.inner-hero {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../images/IMG_4129.webp");
}


/* ========= スケジュール：通常授業カレンダー ========= */

.schedule-2nd {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 2rem 1rem;
    margin-bottom: 0; /* 年間スケジュールとの接続 */
}

.schedule-content {
    max-width: 1000px;
    margin: 0 auto;
}

/* カレンダーカード */
.calendar-card {
    max-width: 960px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px; /* 20px → 16px で洗練 */
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.04), 0 8px 32px rgba(0, 86, 179, 0.06);
    border: 1px solid rgba(6, 158, 252, 0.08);
    overflow: hidden;
}

/* 凡例バー */
.calendar-legend-bar {
    background: linear-gradient(135deg, #f8fafc 0%, #eef4fb 100%);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(6, 158, 252, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.legend-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.calendar-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #4a5568;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

/* 外側リングは過剰装飾のため削除 */
/* .legend-dot::after は使用しない */

.legend-dot--exam {
    background: #4285f4;
    color: #4285f4;
}

.legend-dot--contest {
    background: #d50000;
    color: #d50000;
}

.legend-dot--external {
    background: #0b8043;
    color: #0b8043;
}

.legend-dot--internal {
    background: #06b6d4;
    color: #06b6d4;
}

.legend-dot--closed {
    background: #f6bf26;
    color: #f6bf26;
}

/* カレンダー埋め込み */
.calendar-embed {
    padding: 1rem;
}

.calendar-embed iframe {
    width: 100%;
    height: 520px;
    border: none;
    border-radius: 12px;
    display: block;
}

/* 操作ヒント */
.calendar-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fafbfc;
    border-top: 1px solid rgba(6, 158, 252, 0.06);
    font-size: 0.8rem;
    color: #64748b; /* #94a3b8 → 濃くしてコントラスト改善 */
}

.calendar-hint i,
.calendar-hint svg {
    width: 14px;
    height: 14px;
}

/* ========= 年間スケジュール ========= */

.schedule-annual {
    background: #f8fafc; /* グラデーション不要、単色で統一 */
    padding: 4rem 0;
    margin-top: 0; /* カレンダーセクションからの接続 */
}

.schedule-annual .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 12ヶ月グリッド */
.annual-timeline {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem; /* 0.75rem → 1rem でバッジ余地確保 */
    margin-bottom: 2rem;
}

.timeline-month {
    background: var(--schedule-bg);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    text-align: center;
    border: 1px solid var(--schedule-border);
    transition: box-shadow 0.2s ease; /* all → box-shadow のみ */
    min-height: 120px;
    position: relative;
}

.timeline-month:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    /* translateY削除 - 浮き上がりなし */
}

/* 現在の月バッジ */
/* 現在月バッジ - カード外側右上に配置 */
.timeline-month.current-month::before {
    content: '今月';
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    z-index: 10;
    letter-spacing: 0.02em;
    /* アニメーション削除 - 静的な強調に */
}

/* キーフレームは残すが使用しない（将来用） */
@keyframes badge-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6); }
}

.timeline-month.current-month {
    border: 2px solid #EF4444;
    background: var(--schedule-bg);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
    overflow: visible;
}

.timeline-month.current-month .month-label {
    color: var(--schedule-text);
    font-weight: 700;
}

/* 月ラベルと季節アイコン */
.month-label {
    font-weight: 700;
    color: var(--schedule-text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.month-icon {
    font-size: 1em; /* 0.85em → 1em で視認性向上 */
    line-height: 1;
}

.month-events {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* イベントタグ */
.event-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem; /* 明示的に指定 */
    font-weight: 600;
    line-height: 1.4;
}

.event-tag--exam {
    background: rgba(249, 115, 22, 0.12);
    color: #C2410C;
}

.event-tag--contest {
    background: rgba(37, 99, 235, 0.12);
    color: #1D4ED8;
}

.event-tag--event {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

/* 凡例 */
.annual-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.annual-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* ドットとテキストの間隔 */
    font-size: 0.85rem; /* calendar-legendと統一 */
    color: #4a5568;
}


/* ========= レスポンシブ対応 ========= */

@media (max-width: 992px) {
    .annual-timeline {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .schedule-2nd {
        margin: 0;
        padding: 2rem 1rem;
    }
    
    /* カレンダーカード */
    .calendar-card {
        border-radius: 14px;
    }
    
    .calendar-legend-bar {
        padding: 0.75rem 1rem;
    }
    
    /* 凡例：縦並び→横並びwrapに変更（横幅有効活用） */
    .calendar-legend {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 1rem; /* 縦0.5rem、横1rem */
        justify-content: center;
        align-items: center;
    }
    
    .calendar-embed iframe {
        height: 420px;
    }
    
    /* 年間スケジュール */
    .annual-timeline {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem; /* PCより狭く */
    }
    
    .timeline-month {
        min-height: 110px; /* 100px → 110px でタグ2つ対応 */
        padding: 0.75rem 0.5rem; /* 横0.25rem → 0.5rem で余裕 */
    }
    
    .event-tag {
        font-size: 0.7rem; /* モバイル用に縮小 */
        padding: 0.2rem 0.5rem;
    }
    
    /* バッジサイズ調整（外側配置） */
    .timeline-month.current-month::before {
        font-size: 0.6rem;
        padding: 3px 8px;
        top: -8px;
        right: -8px;
    }
}

@media (max-width: 480px) {
    .annual-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    /* カレンダーカード */
    .calendar-card {
        border-radius: 12px;
    }
    
    /* 凡例：2列グリッドで効率的に配置 */
    .calendar-legend {
        display: grid;
        grid-template-columns: repeat(2, auto);
        gap: 0.4rem 0.75rem;
        justify-content: center;
    }
    
    .calendar-legend .legend-item {
        font-size: 0.8rem; /* さらに縮小 */
    }
    
    .legend-dot {
        width: 10px; /* 12px → 10px */
        height: 10px;
    }
    
    .calendar-embed iframe {
        height: 360px;
    }
    
    .calendar-hint {
        font-size: 0.75rem;
    }
    
    /* イベントタグさらに縮小 */
    .event-tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    /* 月カード調整 */
    .timeline-month {
        min-height: 100px;
        padding: 0.6rem 0.4rem;
    }
    
    /* バッジサイズ調整（外側配置） */
    .timeline-month.current-month::before {
        font-size: 0.55rem;
        padding: 2px 6px;
        top: -6px;
        right: -6px;
    }
}


/* ========= アニメーション ========= */

/* fadeInキーフレームはbase.cssで定義 */

/* ====================================================
   シャイニングアニメーション（予定表ページ）
   ====================================================
   美術的効果：カレンダーカードのプレミアム感演出
   心理学効果：スケジュール情報への信頼性向上
   ==================================================== */

/* --- カレンダーカード シャイニング効果 --- */
.calendar-card {
    position: relative;
    overflow: hidden;
}

.calendar-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 70%,
        transparent 100%
    );
    transform: skewX(-25deg);
    animation: cardShine 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* --- 月カード（年間スケジュール）シャイニング --- */
.timeline-month {
    position: relative;
    overflow: visible; /* バッジ表示のため */
}

.timeline-month::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 70%,
        transparent 100%
    );
    transform: skewX(-25deg);
    animation: monthShine 12s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
    border-radius: 8px;
}

/* 各月で異なるタイミング */
.timeline-month:nth-child(1)::after { animation-delay: 0s; }
.timeline-month:nth-child(2)::after { animation-delay: 1s; }
.timeline-month:nth-child(3)::after { animation-delay: 2s; }
.timeline-month:nth-child(4)::after { animation-delay: 3s; }
.timeline-month:nth-child(5)::after { animation-delay: 4s; }
.timeline-month:nth-child(6)::after { animation-delay: 5s; }
.timeline-month:nth-child(7)::after { animation-delay: 6s; }
.timeline-month:nth-child(8)::after { animation-delay: 7s; }
.timeline-month:nth-child(9)::after { animation-delay: 8s; }
.timeline-month:nth-child(10)::after { animation-delay: 9s; }
.timeline-month:nth-child(11)::after { animation-delay: 10s; }
.timeline-month:nth-child(12)::after { animation-delay: 11s; }

/* ホバー時は一時停止 */
.timeline-month:hover::after {
    animation-play-state: paused;
    opacity: 0;
}

/* --- キーフレーム --- */
/* cardShineキーフレームはbase.cssで定義 */

@keyframes monthShine {
    0% {
        left: -100%;
        opacity: 0;
    }
    3% {
        opacity: 1;
    }
    10% {
        left: 150%;
        opacity: 1;
    }
    11% {
        opacity: 0;
    }
    100% {
        left: 150%;
        opacity: 0;
    }
}

/* --- モバイルでの最適化 --- */
@media screen and (max-width: 768px) {
    .calendar-card::after {
        animation-duration: 10s;
    }
    
    .timeline-month::after {
        animation-duration: 15s;
    }
}

/* --- アクセシビリティ --- */
@media (prefers-reduced-motion: reduce) {
    .calendar-card::after,
    .timeline-month::after {
        animation: none;
        display: none;
    }
}

/* --- フォーカス状態（キーボードアクセシビリティ） --- */
.calendar-card:focus-within {
    outline: 3px solid #4dabf7;
    outline-offset: 2px;
}

.timeline-month:focus-within {
    outline: 3px solid #4dabf7;
    outline-offset: 2px;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.15);
}

/* タブ切り替えボタンのフォーカス */
.nav-tabs .nav-link:focus {
    outline: 3px solid #4dabf7;
    outline-offset: 2px;
}