/* --- 共通設定 --- */
:root {
    --bg-color: #f0f2f5;
    --highlight-color: #fff9c4;
    --today-border: #f1c40f;
    --header-bg: #2c3e50;
    --save-orange: #e67e22;
    --save-green: #27ae60;
}

body {
    font-family: sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px; /* カレンダーに合わせて広めに設定 */
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* --- 保存ステータス（共通） --- */
.editor-footer {
    padding: 8px 20px;
    background: #f9f9f9;
    font-size: 12px;
    color: #777;
    text-align: right;
    border-top: 1px solid #eee;
}

#saveStatus { font-weight: bold; transition: 0.3s; }
.status-saving { color: var(--save-orange); }
.status-saved { color: var(--save-green); }

/* --- 勉強メモ用スタイル --- */
.tab-controls { background: #eee; padding: 15px; border-bottom: 1px solid #ddd; }
.input-group { display: flex; gap: 10px; margin-bottom: 10px; }
input[type="text"] { padding: 10px; border: 1px solid #ccc; border-radius: 4px; flex-grow: 1; font-size: 16px; }
.color-palette { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.color-swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: 0.2s; box-sizing: border-box; }
.color-swatch.selected { border-color: #333; transform: scale(1.2); }
.color-swatch[style*="white"] { border: 1px solid #ccc; }
.add-btn { background: #a9a9a9; color: black; border: none; padding: 0 20px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.add-btn:hover { background: #3498db; color: white; }
.tab-list { display: flex; overflow-x: auto; background: #f9f9f9; padding: 10px 10px 0 10px; gap: 5px; }
.tab { padding: 10px 15px; border-radius: 8px 8px 0 0; cursor: pointer; border: 1px solid #ddd; border-bottom: none; background: #e0e0e0; display: flex; align-items: center; gap: 8px; min-width: 60px; white-space: nowrap; }
.tab.active { background: white !important; font-weight: bold; z-index: 2; }
.delete-tab:hover { color: #c0392b; }
#memoEditor { width: 100%; height: 400px; border: none; padding: 20px; font-size: 16px; line-height: 1.6; outline: none; box-sizing: border-box; }

/* --- 週間カレンダー用スタイル --- */
h1 { text-align: center; color: #333; margin-top: 10px; }
.week-range { text-align: center; color: #666; margin-bottom: 20px; font-weight: bold; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; padding: 10px; }
.day-card { background: white; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: flex; flex-direction: column; overflow: hidden; border: 2px solid #eee; min-height: 250px; }
.day-header { padding: 10px; text-align: center; background: #eee; border-bottom: 1px solid #ddd; }
.day-name { font-weight: bold; font-size: 14px; display: block; }
.day-date { font-size: 12px; color: #777; }
.day-content { flex-grow: 1; padding: 5px; }
.day-content textarea { width: 100%; height: 100%; border: none; resize: none; outline: none; font-size: 14px; line-height: 1.5; padding: 5px; box-sizing: border-box; background: transparent; }
.day-card.today { background-color: var(--highlight-color); border-color: var(--today-border); }
.day-card.today .day-header { background-color: var(--today-border); color: #333; }
.sun .day-name { color: #e74c3c; }
.sat .day-name { color: #3498db; }

@media (max-width: 768px) {
    .calendar-grid { grid-template-columns: 1fr; }
    .day-card { min-height: 120px; }
}