/* src/public/css/timestamp.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; }

/* カラーピッカー */
.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; }

/* 共通ボタン */
.alarm-sound-btn, .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;
}
.alarm-sound-btn.active { border-color: #2a5298; background: #2a5298; color: #fff; }
.settings-btn:hover { border-color: #2a5298; color: #2a5298; }

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

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

.date-display { font-size: 1.4rem; font-weight: bold; margin-bottom: 8px; }
.digital-display {
    font-size: 5.5rem; font-weight: bold; letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(0,0,0,0.2); font-variant-numeric: tabular-nums;
}

/* 操作コントロール */
.timestamp-controls { margin-top: 25px; display: flex; gap: 15px; justify-content: center; width: 100%; }
.ts-action-btn {
    padding: 14px 36px; border: none; border-radius: 50px; font-size: 1.1rem;
    font-weight: bold; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.2s;
}
.ts-action-btn.stamp { background: #0284c7; color: #fff; }
.ts-action-btn.stamp:hover { background: #0369a1; transform: translateY(-1px); }

.ts-action-btn.clear { background: rgba(255,255,255,0.15); color: inherit; border: 2px solid rgba(255,255,255,0.3); }
.ts-action-btn.clear:hover:not(:disabled) { background: rgba(239,68,68,0.2); border-color: rgba(239,68,68,0.5); }
.ts-action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =========================================
   タイムスタンプ履歴テーブル
   ========================================= */
.stamps-container {
    margin-top: 30px; width: 100%; max-height: 220px; overflow-y: auto;
    background: rgba(0,0,0,0.2); border-radius: 12px; border: 1px solid rgba(255,255,255,0.15);
    padding: 10px; box-sizing: border-box;
}

.stamps-container::-webkit-scrollbar { width: 6px; }
.stamps-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

.stamps-table { width: 100%; border-collapse: collapse; text-align: center; color: inherit; font-variant-numeric: tabular-nums; }
.stamps-table th { padding: 8px; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.2); opacity: 0.8; }
.stamps-table td { padding: 10px 8px; font-size: 0.95rem; border-bottom: 1px solid rgba(255,255,255,0.08); font-weight: bold; }
.stamps-table tr.latest-row td { color: #38bdf8; } /* 最新打刻の強調 */
.stamp-num { opacity: 0.8; }

/* 全画面表示 */
#clock-fullscreen-target:fullscreen { padding: 60px 30px; }
#clock-fullscreen-target:fullscreen .digital-display { font-size: 14vw; }

#clock-fullscreen-target.pseudo-fullscreen { padding: 40px 20px; }
#clock-fullscreen-target.pseudo-fullscreen .digital-display { font-size: 12vw; }

/* [hidden] 制御 */
.settings-group[hidden],
.stamps-container[hidden] { display: none; }

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .clock-container { padding: 35px 20px; min-height: 350px; }
    .digital-display { font-size: 3.8rem; letter-spacing: 1px; }
    .date-display { font-size: 1.1rem; }
    .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; }
    .ts-action-btn { padding: 12px 26px; font-size: 0.95rem; }
}

@media (max-width: 600px) {
    .clock-container { padding: 25px 15px; }
    .digital-display { font-size: 2.8rem; letter-spacing: 0px; }
    .ts-action-btn { padding: 10px 20px; font-size: 0.9rem; }
}

/* トースト通知 */
.clock-toast-area { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.clock-toast-msg { background: rgba(30, 41, 59, 0.9); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 0.9rem; font-weight: bold; opacity: 0; transform: translateX(20px); transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.clock-toast-msg.show { opacity: 1; transform: translateX(0); }