/* src/public/css/analog-clock.css */

/* =========================================
   設定パネル
   ========================================= */
.clock-settings-panel {
    display: flex; flex-direction: column; gap: 15px;
    background: #fff; padding: 18px 22px; border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); margin-bottom: 20px;
}
.settings-row {
    display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; width: 100%;
}
.settings-group { display: flex; flex-direction: column; gap: 8px; }
.settings-group.settings-actions { flex-direction: row; align-items: flex-end; margin-top: 5px; }
.custom-color-group { width: 100%; }

.settings-label { font-size: 0.8rem; font-weight: bold; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.preset-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.preset-btn {
    padding: 6px 14px; border: 2px solid #cbd5e1; border-radius: 20px;
    background: #f8fafc; color: #64748b; font-weight: bold; font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
}
.preset-btn.active { border-color: #2a5298; background: #2a5298; color: #fff; }
.settings-select { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc; font-size: 16px; cursor: pointer; min-width: 200px; }

/* アナログ文字盤設定の行 */
.analog-options-row {
    display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
    background: #f8fafc; padding: 10px 16px; border-radius: 8px; border: 1px solid #e2e8f0;
}
.option-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: bold; font-size: 0.88rem; color: #334155; }
.option-check input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.option-select-wrap { display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: 0.88rem; color: #334155; }
.option-select-wrap select { background: #fff; color: #334155; border: 1px solid #cbd5e1; border-radius: 4px; padding: 4px 8px; cursor: pointer; font-size: 16px; }

/* オリジナルカラーピッカー */
.color-pickers {
    display: flex; gap: 20px; align-items: center; justify-content: flex-start;
}
.picker-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: bold; color: #475569; }
.picker-item input[type="color"] { width: 32px; height: 32px; padding: 0; border: none; border-radius: 6px; cursor: pointer; background: transparent; }

/* 共通ボタン */
.settings-btn {
    padding: 8px 14px; border: 2px solid #cbd5e1; border-radius: 8px;
    background: #f8fafc; color: #64748b; font-size: 0.85rem; font-weight: bold; cursor: pointer; transition: all 0.2s;
}
.settings-btn:hover { border-color: #2a5298; color: #2a5298; }

/* =========================================
   時計コンテナ
   ========================================= */
.clock-container {
    padding: 50px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    text-align: center; min-height: 450px; display: flex; flex-direction: column;
    justify-content: center; align-items: center; transition: background-color 0.4s ease;
}

.clock-zone {
    width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; z-index: 5;
}

/* アナログ時計本体 */
.analog-display {
    position: relative; width: 320px; height: 320px;
    border: none; border-radius: 50%;
}

.analog-date-window {
    position: absolute; top: 50%; right: 18%; transform: translateY(-50%);
    font-size: 1rem; font-weight: bold; color: inherit; padding: 2px 8px;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; z-index: 2;
}

/* 針 */
.hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom; background: currentColor; border-radius: 4px; z-index: 10; }
.hour-hand { width: 2.5%; height: 26%; margin-left: -1.25%; background: currentColor; }
.min-hand  { width: 1.5%; height: 38%; margin-left: -0.75%; background: currentColor; opacity: 0.8; }
.sec-hand  { width: 0.6%; height: 42%; margin-left: -0.3%; background: #f87171 !important; z-index: 11; }
.center-dot { position: absolute; top: 50%; left: 50%; width: 5%; height: 5%; background: #f87171; border-radius: 50%; transform: translate(-50%, -50%); z-index: 12; }

/* 動的目盛り */
.analog-markings-layer { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 1; }
.analog-wrapper { position: absolute; width: 100%; height: 100%; top: 0; left: 0; }
.tick { position: absolute; left: 50%; transform: translateX(-50%); background: currentColor; }
.tick.thick { width: 1.5%; height: 5%; top: 3%; opacity: 0.9; }
.tick.thin { width: 0.6%; height: 3%; top: 4%; opacity: 0.5; }
.clock-number { position: absolute; left: 50%; font-weight: bold; display: flex; justify-content: center; align-items: center; color: inherit; }
.clock-number.hour-num { top: 12%; font-size: 1.6rem; }
.clock-number.min-num { top: 3%; font-size: 0.95rem; color: inherit; opacity: 0.7; }

/* 全画面表示 */
#clock-fullscreen-target:fullscreen .clock-number.hour-num { font-size: 7vmin; top: 12%; }
#clock-fullscreen-target:-webkit-full-screen .clock-number.hour-num { font-size: 7vmin; top: 12%; }
#clock-fullscreen-target:fullscreen .clock-number.min-num { font-size: 3.5vmin; top: 2%; }
#clock-fullscreen-target:-webkit-full-screen .clock-number.min-num { font-size: 3.5vmin; top: 2%; }

#clock-fullscreen-target:fullscreen { padding: 80px; }
#clock-fullscreen-target:fullscreen .analog-display { width: 80vmin; height: 80vmin; }

/* 擬似全画面（iOS等） */
#clock-fullscreen-target.pseudo-fullscreen { padding: 40px 20px; }
#clock-fullscreen-target.pseudo-fullscreen .analog-display { width: 80vmin; height: 80vmin; }
#clock-fullscreen-target.pseudo-fullscreen .clock-number.hour-num { font-size: 7vmin; top: 12%; }
#clock-fullscreen-target.pseudo-fullscreen .clock-number.min-num { font-size: 3.5vmin; top: 2%; }

/* [hidden] 属性の制御 */
.clock-zone[hidden],
.settings-group[hidden] {
    display: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .clock-container { padding: 35px 20px; min-height: 380px; }
    .settings-row { gap: 14px; }
    .settings-select { min-width: 0; width: 100%; }
    .settings-group { width: 100%; }
    .settings-group.settings-actions { width: auto; }
    .color-pickers { flex-wrap: wrap; gap: 14px; }
    .analog-options-row { flex-wrap: wrap; gap: 12px; }
    .analog-display { width: 300px; height: 300px; }
    .clock-zone[hidden],
    .settings-group[hidden] { display: none; }
}

@media (max-width: 600px) {
    .clock-container { padding: 30px 15px; }
    .analog-display { width: 280px; height: 280px; }
}