/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* コース凡例 */
/* コース情報 */
.course-info {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.info-box {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 14px;
    line-height: 1.6;
}

.info-note {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 12px;
    color: #856404;
}

/* 月選択 */
.month-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    border-bottom: 2px solid #e9ecef;
}

.month-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.month-btn:hover {
    background: #764ba2;
    transform: scale(1.05);
}

.month-btn:active {
    transform: scale(0.95);
}

#currentMonth {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/* カレンダー */
.calendar {
    padding: 15px;
    transition: opacity 0.3s ease;
}

/* ローディング表示 */
.loading {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #999;
    font-size: 14px;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 5px;
}

.calendar-day-header {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    background: #f8f9fa;
    border-radius: 5px;
    color: #666;
}

.calendar-day-header.sunday {
    color: #f44336;
}

.calendar-day-header.saturday {
    color: #2196F3;
}

.calendar-day {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 8px;
    min-height: 100px;
    cursor: pointer;
    transition: all 0.3s;
}

.calendar-day:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.calendar-day.other-month {
    background: #f8f9fa;
    opacity: 0.5;
}

.calendar-day.holiday {
    background: #ffebee;
    border-color: #ffcdd2;
}

.calendar-day.closed {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.day-number {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.calendar-day.holiday .day-number,
.calendar-day.closed .day-number {
    color: #999;
}

.day-label {
    font-size: 10px;
    color: #999;
    margin-bottom: 5px;
}

.time-slots {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.time-slot {
    font-size: 10px;
    padding: 4px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

.time-slot.available {
    background: #e8f5e9;
    color: #2e7d32;
}

.time-slot.limited {
    background: #fff3e0;
    color: #e65100;
}

.time-slot.full {
    background: #ffebee;
    color: #c62828;
}

.slot-status {
    font-size: 9px;
    margin-top: 2px;
    white-space: pre-line; /* 改行を有効にする */
    line-height: 1.4;
}

/* お知らせセクション */
.notes {
    padding: 20px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
}

.notes h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #667eea;
}

.notes ul {
    list-style: none;
    padding-left: 0;
}

.notes li {
    font-size: 13px;
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.notes li::before {
    content: "●";
    position: absolute;
    left: 0;
    color: #667eea;
}

/* 連絡先情報 */
.contact-info {
    padding: 15px 20px;
    background: #667eea;
    color: white;
    text-align: center;
    font-size: 13px;
}

/* スマホ最適化（横向き含む） */
@media screen and (max-width: 768px) {
    body {
        padding: 5px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    header h1 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 12px;
    }

    .login-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .course-info {
        padding: 10px 15px;
    }

    .info-box {
        font-size: 12px;
        padding: 10px;
    }

    .info-note {
        font-size: 11px;
        padding: 6px 10px;
    }

    .month-selector {
        padding: 10px;
    }

    .month-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    #currentMonth {
        font-size: 16px;
    }

    .calendar {
        padding: 10px;
    }

    .calendar-week {
        gap: 3px;
    }

    .calendar-day-header {
        padding: 5px;
        font-size: 10px;
    }

    .calendar-day {
        padding: 5px;
        min-height: 80px;
    }

    .day-number {
        font-size: 12px;
    }

    .day-label {
        font-size: 9px;
    }

    .time-slot {
        font-size: 9px;
        padding: 3px;
    }

    .slot-status {
        font-size: 8px;
    }

    .notes {
        padding: 15px;
    }

    .notes h3 {
        font-size: 14px;
    }

    .notes li {
        font-size: 12px;
    }

    .contact-info {
        padding: 12px 15px;
        font-size: 12px;
    }
}

/* 極小画面（iPhone SE等） */
@media screen and (max-width: 375px) {
    .calendar-day {
        min-height: 70px;
        padding: 4px;
    }

    .time-slot {
        font-size: 8px;
        padding: 2px;
    }

    .day-number {
        font-size: 11px;
    }
}

/* タブレット・PC */
@media screen and (min-width: 769px) {
    body {
        padding: 20px;
    }

    .container {
        border-radius: 20px;
    }

    header {
        padding: 30px;
    }

    header h1 {
        font-size: 28px;
    }

    .calendar {
        padding: 20px;
    }

    .calendar-day {
        min-height: 120px;
        padding: 10px;
    }

    .day-number {
        font-size: 16px;
    }

    .time-slot {
        font-size: 11px;
        padding: 5px;
    }
}