﻿:root {
    --primary: #4a90e2;
    --accent: #f39c12;
    --bg: #f4f7f6;
    --text: #333;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 900px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 24px auto;
}

h1 { text-align: center; color: var(--primary); }

/* Clock Style */
#current-time {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: var(--accent);
}

/* Table Style */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
}

th { background-color: var(--primary); color: white; }

tr:nth-child(even) { background-color: #f9f9f9; }

.active-row {
    background-color: #fff3cd !important;
    border: 2px solid var(--accent);
}

/* Input Form */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    background: #eee;
    padding: 15px;
    border-radius: 8px;
}

input, button {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

button:hover { opacity: 0.8; }

.delete-btn { background-color: #e74c3c; padding: 4px 8px; }

.editable-subject {
    cursor: text;
    min-width: 80px;
}
.editable-subject:focus {
    outline: 2px solid var(--primary);
    border-radius: 3px;
    background: #eef4ff;
}

/* 通知設定トグル */
.notify-settings {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}
.toggle-switch input { display: none; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 26px;
    cursor: pointer;
    transition: 0.3s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

#notify-status { font-weight: bold; }

/* ===== Header / Footer ===== */
body { padding: 0; min-height: 100vh; }

.site-header {
    width: 100%;
    background: #111;
    color: #fff;
    padding: 0 24px;
    box-sizing: border-box;
}
.header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.site-header h1 {
    font-size: 1.2rem;
    margin: 0;
    color: #fff;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-icon {
    height: 32px;
    width: auto;
    border-radius: 4px;
}
.top-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    border: 1px solid #555;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.2s;
}
.top-link:hover { background: #333; }

.site-footer {
    width: 100%;
    background: #111;
    color: #aaa;
    text-align: center;
    padding: 14px;
    font-size: 0.8rem;
    margin-top: auto;
    box-sizing: border-box;
}

/* 端の隙間修正 */
body { margin: 0; }
.site-header, .site-footer { align-self: stretch; }

.site-footer a { color: #fff; }

/* レスポンシブ: テーブルはみ出し対策 */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
    .container {
        padding: 12px;
        margin: 12px auto;
    }
    th, td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }
    .controls {
        grid-template-columns: 1fr;
    }
}

/* container の幅超過修正 */
.container { box-sizing: border-box; }

.duration-label { margin-left: 16px; }

/* アラームトースト */
.alarm-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    font-size: 1rem;
    min-width: 260px;
    max-width: 90vw;
}
.alarm-toast[hidden] { display: none; }
#alarm-toast-close {
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
}
#alarm-toast-close:hover { opacity: 0.85; }

/* ページタイトル（時計の上） */
.page-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0 0 4px;
    letter-spacing: 0.05em;
}

/* 広告 */
.ad-bottom {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}
.ad-block { display: block; }

/* 削除ボタン: 赤背景なし */
.delete-btn {
    background: transparent;
    color: #999;
    border: 1px solid #ccc;
    padding: 4px 8px;
}
.delete-btn:hover { background: #f5f5f5; color: #333; opacity: 1; }

/* ヘッダーナビ */
.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-btn {
    background: transparent;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.header-btn:hover { background: #333; }

/* モーダル */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay[hidden] { display: none; }
.modal-box {
    background: #fff;
    border-radius: 10px;
    padding: 32px 28px 24px;
    max-width: 520px;
    width: 90vw;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    max-height: 80vh;
    overflow-y: auto;
}
.modal-box h2 {
    margin: 0 0 16px;
    font-size: 1.2rem;
    color: var(--primary);
}
.modal-box ol {
    padding-left: 1.4em;
    line-height: 1.9;
    font-size: 0.95rem;
    color: var(--text);
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
}
.modal-close:hover { color: #333; }

/* 使い方セクション（広告上部の常時表示） */
.howto-section {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 20px 24px;
    box-sizing: border-box;
}
.howto-section h2 {
    font-size: 1rem;
    color: var(--primary);
    margin: 0 0 12px;
}
.howto-section ol {
    padding-left: 1.4em;
    line-height: 1.9;
    font-size: 0.9rem;
    color: var(--text);
    margin: 0;
}
