/* =====================================================================
 * アンケート
 * ===================================================================== */

/* アンケート一覧コンテナ（通知デザインと同パターン） */
.survey_content_wrap {
    display: flex;
    flex-direction: column;
    background: rgba(16, 24, 34, 0.96);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.survey_header_actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.survey_content_header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 8px;
    background: rgba(27, 40, 54, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 36px;
}

/* 投稿リンク（ヘッダー内ボタン） */
.survey_account_create_link {
    font-size: 12px;
    color: whitesmoke;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
}
.survey_account_create_link:hover {
    background: rgba(255, 255, 255, 0.12);
}
.survey_list_reload_btn {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px 6px;
}
.survey_list_reload_btn:hover {
    color: rgba(255, 255, 255, 0.85);
}
.register_contents_title .survey_account_create_link {
    margin-left: auto;
}

/* 読み込み中・該当なし */
.survey_list_loading,
.survey_list_empty {
    padding: 20px;
    color: #7a9ab5;
    font-size: 13px;
    text-align: center;
}

/* アンケートカード一覧グリッド */
.survey_list_container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    padding: 8px;
}

/* アンケートカード（アカウント設定カードと同パターン） */
.survey_card {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(27, 40, 54, 0.5);
    cursor: pointer;
    transition: background 0.15s;
    min-width: 0;
}
.survey_card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.22);
}

.survey_card_question {
    font-size: 12px;
    font-weight: bold;
    color: whitesmoke;
    margin-bottom: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.survey_card_period {
    font-size: 11px;
    color: rgba(122, 154, 181, 0.6);
}

/* アカウント設定画面のマイアンケートカード */
div[name="my_surveys"] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
div[name="my_surveys"] > .no_result {
    grid-column: 1 / -1;
    white-space: nowrap;
}

.survey_my_account_card {
    padding: 8px 10px;
    margin: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(27, 40, 54, 0.5);
    cursor: pointer;
    transition: background 0.15s;
}
.survey_my_account_card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.22);
}

.survey_my_account_card_question {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.survey_my_account_card_footer {
    display: flex;
    align-items: center;
    gap: 6px;
}

.survey_my_account_card_delete_btn {
    margin-left: auto;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #c0392b;
    background: transparent;
    color: #c0392b;
    cursor: pointer;
    white-space: nowrap;
}
.survey_my_account_card_delete_btn:hover {
    background: rgba(192, 57, 43, 0.15);
}

.survey_my_account_card_vote_count {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}

.survey_my_account_card_toggle_btn {
    font-size: 11px;
    border-radius: 10px;
    padding: 1px 6px;
    border: 1px solid grey;
    background: transparent;
    color: #888;
    cursor: pointer;
    white-space: nowrap;
}
.survey_my_account_card_toggle_btn:hover {
    border-color: yellowgreen;
    color: yellowgreen;
}

/* 自分のアンケート管理カード */
.survey_my_card {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(27, 40, 54, 0.5);
    margin-bottom: 10px;
}

.survey_my_card_question {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
}

.survey_my_card_meta {
    color: #888;
    margin-bottom: 6px;
}

.survey_my_card_controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.survey_public_toggle_btn {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid grey;
    background: transparent;
    color: #888;
    cursor: pointer;
}

.survey_public_toggle_btn.is-public {
    border-color: yellowgreen;
    color: yellowgreen;
}

.survey_detail_link_btn {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid grey;
    background: transparent;
    color: #ccc;
    cursor: pointer;
}
.survey_detail_link_btn:hover {
    background: rgba(128, 128, 128, 0.2);
}

/* 投票済みカード（既読通知と同トーン・結果バー分2列分を占有） */
.survey_voted_card {
    grid-column: span 2;
}
.survey_voted_card .survey_card_question {
    color: #7a9ab5;
}

.survey_voted_bars {
    margin: 8px 0 4px;
}

/* 未投票/投票済みの仕切り＋ページャー */
.survey_list_divider {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #7a9ab5;
    padding: 4px 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 2px;
}

.survey_voted_pager {
    display: flex;
    align-items: center;
    gap: 4px;
}
.survey_voted_pager.is-hidden {
    display: none;
}

.survey_voted_pager_prev,
.survey_voted_pager_next {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 1px 7px;
    color: #7a9ab5;
    font-size: 10px;
    cursor: pointer;
    line-height: 1.6;
}
.survey_voted_pager_prev:hover:not(:disabled),
.survey_voted_pager_next:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: whitesmoke;
}
.survey_voted_pager_prev:disabled,
.survey_voted_pager_next:disabled {
    opacity: 0.35;
    cursor: default;
}

.survey_voted_pager_label {
    font-size: 11px;
    color: #7a9ab5;
    min-width: 36px;
    text-align: center;
}

/* 詳細 */
.survey_detail_wrap {
    padding: 8px 0;
}

.survey_detail_question {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
    border-left: 4px solid #5b9bd5;
    padding-left: 10px;
}

.survey_detail_meta {
    margin-bottom: 10px;
    color: #888;
}

.survey_result_pending_msg {
    margin-bottom: 10px;
    color: #888;
}

/* 選択肢ボタン（投票前） */
.survey_choices_wrap {
    display: flex;
    flex-direction: column;
}

.survey_choice_btn {
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
}
.survey_choice_btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: #5b9bd5;
}
.survey_choice_btn.is-selected {
    border-color: #5b9bd5;
    background: rgba(91, 155, 213, 0.2);
}

/* 結果バー（投票後） */
.survey_result_bar_item {
    margin-bottom: 6px;
}

.survey_result_bar_outer {
    position: relative;
    min-height: 34px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.survey_result_bar_inner {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(91, 155, 213, 0.35);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.survey_result_bar_label {
    position: relative;
    z-index: 1;
    padding: 8px 10px;
    font-size: 13px;
    color: #ccc;
    line-height: 1.4;
    max-width: calc(100% - 90px);
}

.survey_result_bar_count {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    height: 100%;
    padding: 0 10px;
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* コメントセクション */
.survey_comment_section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.survey_comment_title {
    font-weight: bold;
    margin-bottom: 8px;
}

.survey_comment_input {
    width: 100%;
    min-height: 64px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    background: rgba(27, 40, 54, 0.8);
    color: #fff;
}

.survey_comment_input_actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    justify-content: flex-end;
}

.survey_comment_submit_btn {
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: #5b9bd5;
    border: 1px solid #5b9bd5;
}
.survey_comment_submit_btn:hover {
    background: rgba(91, 155, 213, 0.15);
}

.survey_vote_submit_wrap {
    margin-top: 8px;
    text-align: right;
}

.survey_vote_submit_btn {
    padding: 7px 20px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: #5b9bd5;
    border: 1px solid #5b9bd5;
}
.survey_vote_submit_btn:hover {
    background: rgba(91, 155, 213, 0.15);
}
.survey_vote_submit_btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.survey_cancel_vote_wrap {
    text-align: right;
    margin-right: 16px;
    line-height: 1;
}

.survey_comment_delete_btn,
.survey_cancel_vote_btn {
    margin-left: 8px;
    font-size: 11px;
    color: #c0392b;
    cursor: pointer;
    opacity: 0.7;
    vertical-align: middle;
}
.survey_comment_delete_btn:hover,
.survey_cancel_vote_btn:hover {
    opacity: 1;
    text-decoration: underline;
}

.survey_comment_list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.survey_comment_item {
    padding: 8px 10px;
    background: rgba(27, 40, 54, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    font-size: 14px;
}

.survey_comment_text {
    word-break: break-all;
    white-space: pre-wrap;
}

.survey_comment_footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.survey_comment_date {
    flex: 1;
}

.survey_comment_account {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.survey_comment_account:hover .survey_comment_user_name {
    text-decoration: underline;
}

.survey_comment_icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.survey_comment_user_name {
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #aac4dc;
}

/* 戻るボタン */
.survey_back_btn_wrap {
    padding: 8px 10px;
}

.survey_back_btn {
    display: inline-block;
    font-size: 12px;
    color: #7a9ab5;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
}
.survey_back_btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.35);
    color: whitesmoke;
}

/* アンケート作成フォーム */
.survey_create_form {
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.survey_create_section_label {
    font-size: 12px;
    color: #888;
    margin-bottom: 2px;
}
.survey_create_question {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 13px;
    resize: vertical;
    background: rgba(27, 40, 54, 0.8);
    color: #fff;
}
.survey_create_choices_list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.survey_create_choice_row {
    display: flex;
    gap: 4px;
    align-items: center;
}
.survey_create_choice_input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 13px;
    background: rgba(27, 40, 54, 0.8);
    color: #fff;
}
.survey_create_remove_choice_btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
}
.survey_create_remove_choice_btn:hover {
    color: #e05;
}
.survey_create_add_choice_btn {
    align-self: flex-start;
    background: none;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    color: #888;
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
}
.survey_create_add_choice_btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ccc;
}
.survey_create_add_choice_btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.survey_create_options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.survey_create_option_label {
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ccc;
}
.survey_create_actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}
.survey_create_submit_btn {
    padding: 6px 16px;
    background: transparent;
    color: #5b9bd5;
    border: 1px solid #5b9bd5;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}
.survey_create_submit_btn:hover {
    background: rgba(91, 155, 213, 0.15);
}
.survey_create_cancel_btn {
    padding: 6px 12px;
    background: none;
    border: 1px solid grey;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    color: #888;
}
.survey_create_cancel_btn:hover {
    background: rgba(128, 128, 128, 0.15);
}
