* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    padding: 20px;
}

.container { 
    max-width: 960px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

header {
    background-color: #0056b3; /* 濃いめの青 */
    color: #fff;
    padding: 20px 0;
    text-align: center;
    border-radius: 8px 8px 0 0;
    margin-bottom: 20px;
}

header h1 {
    margin-bottom: 10px;
}

header p {
    text-align: center; 
    margin-bottom: 0; 
}

nav {
    background-color: #007bff; /* 明るめの青 */
    color: #fff;
    padding: 10px 0;
    margin-bottom: 20px;
    border-radius: 5px;
}

nav ul {
    list-style: none;
    text-align: center;
}

nav ul li {
    display: inline-block;
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #e2e6ea;
}

main {
    padding: 20px 0;
}

section {
    background-color: #fff;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

section h2 {
    color: #0056b3;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

section h3 {
    color: #007bff;
    margin-top: 25px;
    margin-bottom: 15px;
}

section h4 {
    color: #0056b3;
    margin-top: 20px;
    margin-bottom: 10px;
}

p {
    margin-bottom: 15px;
    text-align: justify;
}

ul {
    list-style: disc;
    margin-left: 25px;
    margin-bottom: 15px;
}

ol {
    list-style: decimal;
    margin-left: 25px;
    margin-bottom: 15px;
}

pre {
    background-color: #e9ecef; /* コードブロックの背景色 */
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    border: 1px solid #ced4da;
}

code {
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    color: #c7254e; /* インラインコードの色 */
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    color: #333; /* コードブロック内のテキスト色 */
}

figure {
    text-align: center;
    margin: 20px 0;
}

figure img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

figcaption {
    font-style: italic;
    color: #555;
    margin-top: 10px;
}

.example-box {
    background-color: #f8f9fa; /* 薄いグレーの背景 */
    border: 1px dashed #ced4da; /* 破線のボーダー */
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.example-box button {
    background-color: #28a745; /* 緑色のボタン */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.example-box button:hover {
    background-color: #218838;
}

.example-box input[type="text"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 80%;
    max-width: 300px;
    margin-top: 10px;
}

.hidden {
    display: none;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: #0056b3;
    color: #fff;
    border-radius: 0 0 8px 8px;
}

/* TODOリストのスタイル */
.todo-example {
    text-align: left;
}

#todoInput {
    width: calc(100% - 70px); 
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 8px; 
    margin-bottom: 15px; 
}

#addTodoButton {
    padding: 10px 15px;
    background-color: #007bff; /* 青色のボタン */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    vertical-align: middle; 
}

#addTodoButton:hover {
    background-color: #0056b3;
}

#todoList {
    list-style: none; 
    padding: 0;
    margin-top: 20px;
}

.todo-item {
    background-color: #e9f5ff; 
    border: 1px solid #cce5ff;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex; 
    justify-content: space-between;
    align-items: center; 
    font-size: 1.1em;
}

.todo-item span {
    flex-grow: 1; 
    margin-right: 10px; 
    word-break: break-all; 
}

.delete-button {
    background-color: #dc3545; /* 赤色のボタン */
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.delete-button:hover {
    background-color: #c82333;
}

/* モーダルウィンドウのスタイル */
.modal-trigger-button {
    background-color: #6c757d; /* グレーのボタン */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.modal-trigger-button:hover {
    background-color: #5a6268;
}

/* モーダルの背景 */
.modal {
    display: none; /* 初期状態では非表示 */
    position: fixed; /* 画面に固定 */
    z-index: 1000; /* 他のコンテンツより手前に表示 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.7); /* 黒い半透明の背景 */
    display: flex; 
    justify-content: center; /* 水平方向中央揃え */
    align-items: center; /* 垂直方向中央揃え */

    /* フェードイン/アウト用 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* モーダルが表示された時のスタイル */
.modal.fade-in {
    opacity: 1;
    visibility: visible;
}


/* モーダルコンテンツ本体 */
.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 35px 40px; /* 上下左右のパディングを増やし、特に左右を広げる */
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%; /* 幅を少し広げる */
    max-width: 650px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: zoomIn 0.3s ease-out; /* ズームインアニメーション */

    /* テキストの自動折り返し */
    word-wrap: break-word; 
    overflow-wrap: break-word; 
}

.modal-content h3,
.modal-content p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 閉じるボタン */
.close-button {
    color: #aaa;
    font-size: 30px;
    font-weight: bold;
    position: absolute; 
    top: 15px;
    right: 25px; 
    cursor: pointer;
    line-height: 1; 
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

/* モーダルのズームインアニメーション */
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* レスポンシブ対応  */
@media screen and (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 20px;
    }
}