/* ==========================================
   CSS変数（カスタマイズ用）
   ========================================== */
:root {
    --bg-color: #2c3e50;
    --clock-font: 'Arial', sans-serif;
    --ui-font: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
    --number-radius: 200px;
}

/* 全体のレイアウト設定 */
body {
    margin: 0;
    height: 100vh;
    display: flex;
    background-color: var(--bg-color);
    font-family: var(--ui-font);
    color: #ecf0f1;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

/* ==========================================
   左側：設定パネル・情報パネルエリア
   ========================================== */
.sidebar-left {
    width: 380px;
    background-color: rgba(0, 0, 0, 0.2);
    border-right: 2px solid rgba(255,255,255,0.1);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

/* 各種パネル共通 */
.panel {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.panel-title {
    font-size: 1rem;
    color: #bdc3c7;
    margin: 0 0 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
}

/* ==========================================
   設定パネル (開閉式)
   ========================================== */
.settings-panel {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
}

/* アコーディオン（開閉機能）のスタイル */
.settings-panel details summary {
    cursor: pointer;
    outline: none;
    user-select: none;
    margin: 0;
    border-bottom: none;
    font-weight: bold;
}

.settings-panel details summary:hover {
    color: #fff;
}

.settings-panel details[open] summary {
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-panel label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.settings-panel select, .settings-panel input[type="color"] {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    border: 1px solid #7f8c8d;
    background-color: #fff;
    color: #333;
    max-width: 180px;
}

/* ==========================================
   季節・ことば・月のパネル
   ========================================== */
.solarterm-display, .proverb-display { margin-bottom: 15px; }
.solarterm-name { font-size: 1.8rem; font-weight: bold; color: #f1c40f; margin-bottom: 5px; }
.solarterm-period { font-size: 0.9rem; color: #bdc3c7; }
.proverb-word { font-size: 1.8rem; font-weight: bold; color: #2ecc71; margin-bottom: 5px; font-family: 'Yu Mincho', 'MS Mincho', serif; }
.proverb-meaning { font-size: 0.9rem; color: #bdc3c7; line-height: 1.4; }

.moon-display {
    display: flex;
    align-items: center;
    gap: 20px;
}
.moon-icon { font-size: 3.5rem; line-height: 1; }
.moon-info { display: flex; flex-direction: column; gap: 5px; }
.moon-name { font-size: 1.4rem; font-weight: bold; color: #f39c12; }
.moon-age { font-size: 0.95rem; color: #bdc3c7; }

/* ==========================================
   真ん中：時計エリア
   ========================================== */
.clock-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.clock {
    width: 500px;
    height: 500px;
    border: 12px solid #ecf0f1;
    border-radius: 50%;
    position: relative;
    background-color: #ffffff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    font-family: var(--clock-font);
}

.clock::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 24px; height: 24px;
    background-color: #e74c3c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.hand {
    position: absolute;
    bottom: 50%; left: 50%;
    transform-origin: bottom;
    border-radius: 10px;
}

.hour { width: 12px; height: 140px; margin-left: -6px; background-color: #2c3e50; z-index: 3; }
.minute { width: 8px; height: 200px; margin-left: -4px; background-color: #7f8c8d; z-index: 2; }
.second { width: 4px; height: 230px; margin-left: -2px; background-color: #e74c3c; z-index: 4; }

.numbers-container { position: absolute; width: 100%; height: 100%; }
.number {
    position: absolute; width: 60px; height: 60px;
    line-height: 60px; text-align: center; font-weight: bold; color: #333;
    transform: translate(-50%, -50%);
}

.arabic-numbers .number { font-size: 2.5rem; }
.roman-numbers .number { font-size: 2.2rem; }
.kanji-numbers .number { font-size: 2.2rem; font-family: 'Yu Mincho', 'MS Mincho', serif; }

/* ==========================================
   右側：情報パネルエリア（天気・カレンダー）
   ========================================== */
.sidebar-right {
    width: 380px;
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(255,255,255,0.1);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

/* 左側に移動した日付のスタイル */
.date-display { font-size: 1.8rem; font-weight: bold; margin-bottom: 5px; }
.era-display { font-size: 1.2rem; color: #f1c40f; }

.weather-list { display: flex; justify-content: space-between; text-align: center; }
.weather-item { flex: 1; }
.weather-day { font-size: 0.9rem; margin-bottom: 5px; }
.weather-icon { font-size: 2.5rem; margin-bottom: 5px; }
.weather-temp { font-size: 0.9rem; }
.temp-max { color: #e74c3c; }
.temp-min { color: #3498db; }

.calendar-container { display: flex; flex-direction: column; gap: 10px; }
table.calendar {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
    text-align: center; background-color: rgba(0,0,0,0.1);
    border-radius: 5px; overflow: hidden;
}
.calendar th { background-color: rgba(255,255,255,0.15); padding: 5px 0; }
.calendar td { padding: 4px 0; color: #bdc3c7; border-radius: 4px; cursor: default; }

.calendar th.sunday, .calendar td.sunday { color: #ff7675; }
.calendar th.saturday, .calendar td.saturday { color: #74b9ff; }
.calendar td.holiday { color: #ff7675; font-weight: bold; text-decoration: underline; text-decoration-color: rgba(255,118,117,0.5); }
.calendar td.today { background-color: #e74c3c !important; color: white !important; font-weight: bold; border-radius: 50%; }
.calendar caption { font-weight: bold; padding: 5px; background-color: rgba(0,0,0,0.2); }