/**
 * にしつーQ フロントエンドスタイル
 * ワンタップ投票UI - モダンデザイン
 */


/* テーマのデフォルトリストスタイルを打ち消し */
.n2q-container ul,
.n2q-container ul li,
.n2q-container div,
.entry-content .n2q-container ul,
.entry-content .n2q-container ul li,
.entry-content .n2q-container div {
    list-style: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    position: relative;
}

.n2q-container ul li:before,
.n2q-container div:before,
.entry-content .n2q-container ul li:before,
.entry-content .n2q-container div:before {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
    position: static !important;
}

/* コンテナ */
.n2q-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans CJK JP", sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.n2q-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb);
}

/* ヘッダー */
.n2q-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.n2q-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.n2q-badge-quiz {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
}

.n2q-badge-poll {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
}

.n2q-label {
    font-size: 12px;
    color: #888;
    font-weight: 600;
}

/* 質問文 */
.n2q-question {
    font-size: 18px;
    font-weight: 700;
    color: #2d3436;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

/* 選択肢ボタン（ワンタップUI） */
.n2q-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.n2q-choice-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    font-size: 15px;
    color: #2d3436;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.n2q-choice-btn:hover:not(:disabled) {
    border-color: #ff6b6b;
    background: #fff5f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
}

.n2q-choice-btn:active:not(:disabled) {
    transform: translateY(0);
}

.n2q-choice-btn.n2q-selected {
    border-color: #ff6b6b;
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
}

.n2q-choice-btn.n2q-submitting {
    pointer-events: none;
    opacity: 0.7;
}

.n2q-choice-btn.n2q-voted {
    border-color: #48dbfb;
    background: linear-gradient(135deg, #e8f8fd, #d4f1f9);
}

.n2q-choice-btn.n2q-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.n2q-choice-btn:disabled {
    cursor: not-allowed;
}

.n2q-choice-text {
    flex: 1;
}

.n2q-choice-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #48dbfb;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

/* 自分の回答を追加 */
.n2q-add-answer {
    margin-top: 6px;
}

.n2q-add-answer-link {
    display: block;
    padding: 12px 18px;
    color: #888;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: 2px dashed #ddd;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.n2q-add-answer-link:hover {
    color: #ff6b6b;
    border-color: #ff6b6b;
    background: #fff5f5;
}

.n2q-add-answer-form {
    display: flex;
    gap: 8px;
    padding: 4px;
}

.n2q-user-answer-input {
    flex: 1;
    padding: 12px 14px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.n2q-user-answer-input:focus {
    outline: none;
    border-color: #ff6b6b;
}

.n2q-submit-user-answer {
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.n2q-submit-user-answer:hover {
    background: linear-gradient(135deg, #ee5a5a, #e04848);
    transform: translateY(-1px);
}

/* フッター */
.n2q-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.n2q-vote-count {
    font-size: 13px;
    color: #888;
    margin-left: auto;
}

.n2q-results-link,
.n2q-back-link {
    font-size: 13px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.n2q-results-link:hover,
.n2q-back-link:hover {
    color: #ff6b6b;
}

.n2q-revote-link {
    font-size: 13px;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
    transition: color 0.2s ease;
}

.n2q-revote-link:hover {
    color: #ff6b6b;
}

/* 結果表示 */
.n2q-result-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.n2q-result-item {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
}

.n2q-result-item.n2q-winner {
    border-color: #feca57;
    background: linear-gradient(135deg, #fffbeb, #fff9e6);
}

.n2q-result-item.n2q-voted {
    border-color: #48dbfb;
    background: linear-gradient(135deg, #e8f8fd, #f0fbfe);
}

.n2q-result-item.n2q-correct {
    border-color: #26de81;
    background: linear-gradient(135deg, #e8faf0, #f0fdf5);
}

.n2q-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.n2q-result-text {
    font-size: 14px;
    font-weight: 600;
    color: #2d3436;
}

.n2q-result-percent {
    font-size: 18px;
    font-weight: 700;
    color: #2d3436;
}

.n2q-result-bar-wrap {
    background: #e9ecef;
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}

.n2q-result-bar {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #ff6b6b, #ee5a5a);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.n2q-result-item.n2q-winner .n2q-result-bar {
    background: linear-gradient(90deg, #feca57, #f9ca24);
}

.n2q-result-item.n2q-voted .n2q-result-bar {
    background: linear-gradient(90deg, #48dbfb, #0abde3);
}

.n2q-result-item.n2q-correct .n2q-result-bar {
    background: linear-gradient(90deg, #26de81, #20bf6b);
}

.n2q-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
}

.n2q-your-vote {
    background: #48dbfb;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
}

.n2q-correct-badge {
    background: #26de81;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
}

.n2q-result-votes {
    color: #888;
}

/* 投票済みメッセージ */
.n2q-voted-message {
    text-align: center;
    padding: 30px 20px;
}

.n2q-voted-message p {
    font-size: 18px;
    font-weight: 700;
    color: #2d3436;
    margin: 0 0 16px 0;
}

.n2q-voted-message .n2q-revote-link {
    display: inline-block;
    padding: 8px 16px;
    background: #f1f3f4;
    border-radius: 8px;
    font-size: 13px;
}

.n2q-voted-message .n2q-revote-link:hover {
    background: #e9ecef;
}

/* ローディング */
.n2q-screen.n2q-loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.n2q-screen.n2q-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #ff6b6b;
    border-top-color: transparent;
    border-radius: 50%;
    animation: n2q-spin 0.8s linear infinite;
}

@keyframes n2q-spin {
    to {
        transform: rotate(360deg);
    }
}

.n2q-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.n2q-loader span {
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    border-radius: 50%;
    margin: 0 5px;
    animation: n2q-bounce 0.6s infinite alternate;
}

.n2q-loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.n2q-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes n2q-bounce {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-10px);
        opacity: 0.5;
    }
}

/* シェイクアニメーション */
.n2q-shake {
    animation: n2q-shake 0.5s ease;
}

@keyframes n2q-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* レスポンシブ */
@media (max-width: 600px) {
    .n2q-container {
        padding: 20px 16px;
        margin: 24px 0;
        border-radius: 12px;
    }

    .n2q-question {
        font-size: 16px;
    }

    .n2q-choice-btn {
        padding: 12px 14px;
        font-size: 14px;
    }

    .n2q-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .n2q-vote-count {
        margin-left: 0;
    }

    .n2q-add-answer-form {
        flex-direction: column;
    }

    .n2q-submit-user-answer {
        width: 100%;
    }
}
