* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", Meiryo, メイリオ, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c5aa0;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    border-bottom: 3px solid #2c5aa0;
    padding-bottom: 15px;
}

.header-nav {
    text-align: center;
    margin-bottom: 20px;
}

.btn-admin {
    display: inline-block;
    background: #ff6b6b;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-admin:hover {
    background: #ff5252;
}

.question-block {
    margin-bottom: 40px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 5px solid #2c5aa0;
}

.question-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.option-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.option-btn:active {
    transform: translateY(0);
}

.option-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.voted-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
    text-align: center;
    font-weight: bold;
}

.results-container {
    margin-top: 20px;
}

.result-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c5aa0;
}

.result-item {
    margin-bottom: 15px;
}

.result-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: bold;
}

.result-bar-container {
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    height: 30px;
    position: relative;
}

.result-bar {
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    min-width: 40px;
}

.no-votes {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* 管理画面用スタイル */
.admin-container {
    max-width: 1200px;
}

.admin-section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
}

.admin-section h2 {
    color: #2c5aa0;
    margin-bottom: 20px;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: #2c5aa0;
    color: white;
}

.btn-primary:hover {
    background: #234785;
}

.btn-success {
    background: #4CAF50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #e68900;
}

.question-list,
.option-list {
    margin-top: 20px;
}

.question-item,
.option-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info {
    flex: 1;
}

.item-actions {
    display: flex;
    gap: 10px;
}

.item-actions .btn {
    padding: 8px 15px;
    font-size: 12px;
}

.message {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: bold;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 22px;
    }

    .question-title {
        font-size: 18px;
    }

    .option-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* --- 質問タイプ別スタイル --- */

/* 自由記述テキストエリア */
.freetext-textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    resize: vertical;
    font-size: 16px;
}

/* 回答送信ボタン */
.btn-submit-answer {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

.btn-submit-answer:hover {
    background-color: #0b7dda;
}

.btn-submit-answer:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 自由記述回答リスト */
.freetext-results {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.freetext-results ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.freetext-results li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.freetext-results li:last-child {
    border-bottom: none;
}

.no-answers {
    color: #999;
    text-align: center;
    font-style: italic;
}

/* はい/いいえ、好き/嫌いボタン */
.btn-yesno,
.btn-likedislike {
    width: 48%;
    /* 横並びにする */
    margin: 1%;
    display: inline-block;
}

.btn-yesno:nth-child(1) {
    /* はい */
    background-color: #4CAF50;
    /* 緑 */
    color: white;
}

.btn-yesno:nth-child(2) {
    /* いいえ */
    background-color: #f44336;
    /* 赤 */
    color: white;
}

.btn-likedislike:nth-child(1) {
    /* 好き */
    background-color: #E91E63;
    /* ピンク */
    color: white;
}

.btn-likedislike:nth-child(2) {
    /* 嫌い */
    background-color: #607D8B;
    /* グレー */
    color: white;
}

/* もっと見るボタン */
.btn-more-results {
    display: block;
    text-align: center;
    background: #e3f2fd;
    color: #1976d2;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-more-results:hover {
    background: #bbdefb;
}