/* Web Storage サンプル用スタイル */

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    color: #333;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

h2 {
    color: #34495e;
    border-left: 5px solid #e74c3c;
    padding-left: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
}

h3 {
    color: #2c3e50;
    margin-top: 25px;
    margin-bottom: 15px;
}

h4 {
    color: #34495e;
    margin-bottom: 10px;
}

.container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.storage-section {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fafafa;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 100px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ボタンの色分け */
button:not(.danger) {
    background-color: #3498db;
    color: white;
}

button:not(.danger):hover {
    background-color: #2980b9;
}

button.danger {
    background-color: #e74c3c;
    color: white;
}

button.danger:hover {
    background-color: #c0392b;
}

/* ストレージ表示エリア */
.storage-display {
    margin-top: 20px;
    border: 1px solid #d0d0d0;
    border-radius: 5px;
    padding: 15px;
    background-color: white;
    min-height: 100px;
}

.storage-item {
    padding: 8px 12px;
    margin-bottom: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    word-wrap: break-word;
}

.user-data-item {
    padding: 15px;
    margin-bottom: 15px;
    background-color: #e8f5e8;
    border-radius: 5px;
    border-left: 4px solid #27ae60;
}

.user-data-item h4 {
    margin-top: 0;
    color: #27ae60;
}

.user-data-item p {
    margin: 5px 0;
}

/* 情報セクション */
.info-section {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    background-color: #fafafa;
}

.info-display {
    margin-top: 15px;
    padding: 15px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.info-display h4 {
    color: #2c3e50;
    margin-top: 15px;
    margin-bottom: 10px;
}

.info-display h4:first-child {
    margin-top: 0;
}

.info-display p {
    margin: 5px 0;
    padding-left: 10px;
}

/* ステータスメッセージ */
.status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.status.success {
    background-color: #2ecc71;
    color: white;
    opacity: 1;
}

.status.error {
    background-color: #e74c3c;
    color: white;
    opacity: 1;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 2em;
    }

    .container {
        padding: 15px;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
        margin-bottom: 5px;
    }

    .status {
        position: relative;
        top: auto;
        right: auto;
        margin: 20px 0;
    }
}

/* アニメーション効果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.storage-item {
    animation: fadeIn 0.3s ease;
}

.user-data-item {
    animation: fadeIn 0.3s ease;
}

/* スクロールバーのスタイリング（Webkit系ブラウザ） */
.storage-display::-webkit-scrollbar {
    width: 6px;
}

.storage-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.storage-display::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.storage-display::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* フォーカス可能な要素のアクセシビリティ向上 */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 空の状態のスタイル */
.storage-display p {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    margin: 20px 0;
}