/* ==========================================
   サイト共通の基本スタイル（このページ用）
   ========================================== */
body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: #f3f4f6;
    color: #374151;
    display: flex;
    flex-direction: column; 
    align-items: center;
    min-height: 100vh;
    padding: 1rem 0.5rem;
    margin: 0;
    box-sizing: border-box;
}
* {
    box-sizing: inherit;
}

/* メインコンテナ */
main {
    width: 100%;
    max-width: 64rem;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 1.5rem; 
}
main h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #0078D7;
    border-bottom: 2px solid #0078D7;
    padding-bottom: 8px;
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ==========================================
   カレンダーツール専用のスタイル
   ========================================== */
.container {
    display: flex;
    gap: 25px;
    flex-direction: column;
}
@media (min-width: 768px) {
    .container {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* 左側：カレンダーエリア */
.calendar-section {
    flex: 0 0 320px;
    background: #f8fafc; 
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 20px;
}
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.calendar-controls select {
    padding: 5px 10px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.weekday {
    font-weight: bold;
    padding: 5px 0;
    font-size: 13px;
    background-color: #e2e8f0;
    border-radius: 4px;
}
.weekday:nth-child(1) { color: #e81123; } /* 日曜 */
.weekday:nth-child(7) { color: #0078D7; } /* 土曜 */

.day {
    padding: 10px 0;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
    user-select: none;
}
.day:hover:not(.empty) { background-color: #cbd5e1; }
.day.empty { cursor: default; }
.day.today {
    background-color: #e1f0fa;
    font-weight: bold;
    color: #0078D7;
}
.day.selected {
    background-color: #0078D7 !important;
    color: #fff !important;
    font-weight: bold;
}

/* 右側：結果表示エリア */
.result-section {
    flex: 1;
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    min-height: 400px;
    position: relative;
}
.sticky-header {
    position: sticky;
    top: 0;
    background-color: #f8fafc;
    z-index: 10;
    padding: 20px 20px 10px 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #e2e8f0;
}
.result-header {
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    border-left: 5px solid #0078D7;
    padding-left: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#loading {
    font-size: 0.8em;
    color: #6b7280;
    font-style: italic;
    display: none;
}

/* 切り替えボタン */
.tab-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    display: none;
}
.tab-btn {
    padding: 8px 14px;
    font-size: 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s;
}
.tab-btn:hover { background-color: #f1f5f9; }
.tab-btn.active {
    background: #0078D7;
    color: #fff;
    border-color: #0078D7;
    font-weight: bold;
}

#resultContent {
    padding: 10px 20px 20px 20px;
}
#resultContent h3 {
    color: #0078D7;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 4px;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

/* テーブル */
#resultContent table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
#resultContent th, 
#resultContent td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}
#resultContent th {
    background-color: #e2e8f0;
    font-weight: bold;
    color: #475569;
    width: 150px; 
    white-space: nowrap;
}
#resultContent tr:hover td { 
    background-color: #f1f5f9; 
}

.no-data {
    color: #94a3b8;
    font-style: italic;
    padding: 20px 0;
    text-align: center;
}

/* 注意書きエリア */
.notes-section {
    margin-top: 25px;
    font-size: 0.875rem;
    padding: 1rem;
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
    color: #92400e;
    line-height: 1.6;
}
.notes-section h2 {
    font-size: 1rem;
    color: #b45309;
    margin-top: 0;
    margin-bottom: 10px;
    border-left: 4px solid #b45309;
    padding-left: 8px;
}
.notes-section ul {
    margin: 0;
    padding-left: 20px;
}
.notes-section li { margin-bottom: 6px; }
.notes-section li:last-child { margin-bottom: 0; }