html, body {
    height: 100%; /* htmlとbodyの高さがビューポートに合わせる */
    margin: 0;    /* デフォルトのマージンをリセット */
    padding: 0;   /* デフォルトのパディングをリセット */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

.container {
    /* flex-grow: 1; を追加 */
    flex-grow: 1; /* フッター以外の残りのスペースを全て占めるようにする */
    max-width: 900px; /* 適切な最大幅を設定 */
    width: 100%; /* 親要素の幅いっぱいに広がる */
    margin: 20px auto; /* 上下に余白、左右中央寄せ */
    padding: 30px 40px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box; /* パディングを幅に含める */
}

h1, h2, h3 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
}

p {
    margin-bottom: 10px;
}

.input-section, .strength-section, .simulation-section, .history-section { /* history-section追加 */
    background-color: #ecf0f1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #dde1e5;
}

.input-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #34495e;
}

.input-section input[type="text"] {
    width: calc(100% - 24px); /* 左右paddingを考慮 */
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

/* パスワード候補ボタンのスタイル */
.password-suggestions {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px dashed #b1c7d6;
    border-radius: 5px;
    background-color: #e0f2f7;
}

.password-suggestions label {
    font-weight: bold;
    color: #34495e;
    margin-bottom: 10px;
    display: block;
}

.suggest-buttons-wrapper {
    display: flex; /* Flexboxで横並び */
    flex-wrap: wrap; /* 複数行に折り返し */
    gap: 8px; /* ボタン間のスペース */
}

.suggest-btn {
    padding: 8px 12px;
    background-color: #5bc0de;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap; /* ボタン内のテキストが改行されないように */
}

.suggest-btn:hover {
    background-color: #31b0d5;
}


/* 解析方法の選択肢 */
.analysis-options {
    margin-bottom: 15px;
}

.analysis-options label {
    font-weight: bold; /* 大元のラベルは太字 */
}

.analysis-options .radio-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* ラジオボタンとラベルの組の間のスペース */
    margin-top: 8px; /* 上のラベルからの余白 */
}

.analysis-options .radio-buttons-wrapper input[type="radio"] {
    margin-right: 5px;
}

.analysis-options .radio-buttons-wrapper label {
    display: flex; /* ラジオボタンとテキストを中央揃え */
    align-items: center;
    font-weight: normal; /* 個々のラジオボタンのラベルは通常の太さ */
}


/* 総当たり攻撃オプション */
.analysis-length-option {
    margin-bottom: 15px;
    display: flex; /* Flexboxで横並び */
    align-items: center;
    gap: 10px; /* 要素間のスペース */
    flex-wrap: wrap; /* 小さい画面で折り返す */
}

.analysis-length-option label {
    margin-bottom: 0; /* ラベルの余白調整 */
    font-weight: normal; /* 個々のラベルは通常の太さ */
}

.analysis-length-option input[type="checkbox"] {
    margin-right: 5px; /* チェックボックスとラベルの間のスペース */
}

.analysis-length-option input[type="number"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    width: 60px;
    text-align: center;
}


#analyzeButton {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    /* margin-top: 10px; 他の要素との間隔 */
}

#analyzeButton:hover {
    background-color: #2980b9;
}

.strength-section #passwordStrength {
    font-weight: bold;
    font-size: 20px;
}

.strength-section .feedback {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

.strength-section .advice {
    font-weight: bold;
    margin-top: 20px;
    color: #34495e;
}

.strength-section ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 10px;
    color: #555;
}

.strength-section ul li {
    margin-bottom: 5px;
}

/* Strength indicators */
.strength-weak { color: #e74c3c; }
.strength-medium { color: #f39c12; }
.strength-strong { color: #27ae60; }

.simulation-section {
    position: relative;
}

.simulation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.simulation-controls button {
    padding: 8px 15px;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.simulation-controls button:hover {
    background-color: #7f8c8d;
}

.simulation-progress #simulationStatus {
    font-weight: bold;
    color: #2980b9;
}

.simulation-progress #elapsedTime {
    margin-left: 10px;
    font-size: 0.9em;
    color: #666;
}

.simulation-results h3 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

.simulation-results #estimatedTime {
    font-weight: bold;
    font-size: 1.2em;
    color: #e67e22;
}

.simulation-display {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    min-height: 150px;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
}

.simulation-display .attempt {
    margin-bottom: 5px;
}

.simulation-display .found {
    color: #27ae60;
    font-weight: bold;
}

.simulation-display .stopped {
    color: #e74c3c;
    font-weight: bold;
}

.feedback.warning {
    color: #e74c3c;
    font-weight: bold;
    margin-top: 15px;
}

#showReviewButton {
    display: block;
    margin-top: 20px;
    padding: 12px 20px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

#showReviewButton:hover {
    background-color: #218838;
}

/* 履歴テーブルのスタイル */
.history-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-section th, .history-section td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
    word-break: break-word; /* 長いパスワードがはみ出さないように */
}

.history-section th {
    background-color: #dbe4e6;
    font-weight: bold;
    color: #34495e;
}

.history-section tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.history-section #clearHistoryButton {
    display: block;
    margin-top: 15px;
    padding: 8px 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: auto; /* ボタンの幅をコンテンツに合わせる */
}

.history-section #clearHistoryButton:hover {
    background-color: #c0392b;
}


.hidden {
    display: none;
}

footer {
    width: 100%; /* 親要素 (body) の幅いっぱいに広がる */
    text-align: center;
    padding: 20px 0;
    margin-top: auto; /* Flexboxでフッターを最下部に押し出す */
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.85em;
    border-top: 1px solid #dee2e6;
    /* フッターにposition: fixed; や float: left/right; などがあれば削除してください */
}

footer a{
    color: #6c757d;
}