/* ベーススタイル */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    padding: 0;
    /*background-color: #f9f9f9;*/
    background-color: #f3fff3;
    color: #333;
    line-height: 1.6;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

form {
    margin-bottom: 20px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* テーブルスタイル */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    table-layout: fixed;
}

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

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* カラム幅の調整 */
.narrow-column {
    width: 8%;
}

.wide-column {
    width: 12%;
}

/* フォーム要素 */
input, select {
    width: 90%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

input:focus, select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

button {
    display: block;
    margin: 20px auto;
    padding: 12px 24px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

button:active {
    transform: scale(0.98);
}

/* 質問グループ */
.question-group {
    margin: 20px 0;
    padding: 15px;
    background-color: #f2f2f2;
    border-radius: 8px;
    clear: both;
}

.question-group p {
    margin: 0 0 10px 0;
    font-weight: bold;
    color: #333;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 8px;
}

/* 結果表示 */
#result {
    margin-top: 30px;
    padding: 0;
    transition: all 0.3s ease;
}

/* ローディング表示 */
#loading {
    text-align: center;
    margin: 20px 0;
    display: none;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #007bff;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* エラー表示 */
#error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    margin: 20px 0;
    border-radius: 4px;
    display: none;
}

/* 結果カード */
.result-card {
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    background-color: white;
    transition: all 0.3s ease;
}

/* 一律カラー用 */
.single-color {
    border-left: 5px solid #6183C2 !important;
}

.gauge {
    background-color: #6183C2 !important;
}

/* 確率値の表示 */
.probability-value {
    text-align: center;
    margin: 25px 0;
}

.big-number {
    font-size: 42px;
    font-weight: bold;
    color: #333;
    display: block;
}

.probability-label {
    font-size: 16px;
    color: #666;
    margin-top: 5px;
    display: block;
}

/* 信頼区間の表示 */
.confidence-interval {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.interval-range {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.interval-bar {
    flex-grow: 1;
    height: 4px;
    background-color: #007bff;
    margin: 0 15px;
    position: relative;
}

.interval-bar:after {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    width: 12px;
    height: 12px;
    background-color: #007bff;
    border-radius: 50%;
    transform: translateX(-50%);
}

.interval-bound {
    font-weight: bold;
    color: #007bff;
}

.result-note {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 15px;
}

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

.result-card {
    animation: fadeIn 0.5s ease-out forwards;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    table {
        font-size: 14px;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .big-number {
        font-size: 32px;
    }
}
