/* にしつーQ Ask - フロントエンドCSS */

/* ========================================
   フローティング質問ボタン
   ======================================== */
.n2qa-ask-button {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    z-index: 999999;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 14px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.n2qa-ask-button:hover,
.n2qa-ask-button:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.n2qa-ask-icon {
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

/* ========================================
   モーダル
   ======================================== */
.n2qa-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.n2qa-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.n2qa-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.n2qa-modal-wide {
    max-width: 600px;
}

.n2qa-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.n2qa-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.n2qa-modal-header {
    padding: 24px 24px 0;
    text-align: center;
}

.n2qa-modal-header h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #333;
}

.n2qa-modal-desc {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.n2qa-modal-body {
    padding: 20px 24px;
}

.n2qa-modal-footer {
    padding: 0 24px 24px;
}

/* ========================================
   フォーム要素
   ======================================== */
.n2qa-form-group {
    margin-bottom: 16px;
}

.n2qa-textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    resize: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.n2qa-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.n2qa-char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.n2qa-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.n2qa-input:focus {
    outline: none;
    border-color: #667eea;
}

/* ========================================
   ボタン
   ======================================== */
.n2qa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.n2qa-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.n2qa-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.n2qa-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.n2qa-btn-small {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
}

/* ========================================
   投稿結果
   ======================================== */
.n2qa-submit-result {
    padding: 16px 24px;
    text-align: center;
    font-size: 15px;
}

.n2qa-submit-result.success {
    color: #059669;
    background: #ecfdf5;
    border-radius: 0 0 16px 16px;
}

.n2qa-submit-result.error {
    color: #dc2626;
    background: #fef2f2;
}

.n2qa-modal-link {
    padding: 12px 24px 20px;
    text-align: center;
}

.n2qa-modal-link a {
    color: #667eea;
    font-size: 13px;
    text-decoration: none;
}

.n2qa-modal-link a:hover {
    text-decoration: underline;
}

/* ========================================
   質問ブロック（記事内）
   ======================================== */
.n2qa-question-block {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff5f5 100%);
    border: 2px solid #e8e8ff;
    border-radius: 16px;
    padding: 20px;
    margin: 24px 0;
}

.n2qa-question-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    position: relative;
}

/* 管理者用フロントエンドコントロール */
.n2qa-admin-controls {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 4px;
}

.n2qa-admin-btn {
    background: rgba(255,255,255,0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    color: #666;
    transition: all 0.2s;
}

.n2qa-admin-btn:hover {
    background: #fee2e2;
    border-color: #dc2626;
    color: #dc2626;
}

.n2qa-question-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.n2qa-question-author {
    font-size: 13px;
    color: #666;
}

.n2qa-friend-badge {
    background: #fbbf24;
    color: #78350f;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}

.n2qa-question-text {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ========================================
   選択肢ボタン
   ======================================== */
.n2qa-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.n2qa-choice-btn {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

.n2qa-choice-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.n2qa-choice-btn.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

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

/* ========================================
   コメント入力
   ======================================== */
.n2qa-comment-section {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8e8ff;
}

.n2qa-comment-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
}

.n2qa-comment-input:focus {
    outline: none;
    border-color: #667eea;
}

/* ========================================
   回答数・結果
   ======================================== */
.n2qa-response-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.n2qa-response-count {
    font-size: 13px;
    color: #888;
}

.n2qa-view-results-btn {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.n2qa-view-results-btn:hover {
    background: #667eea;
    color: #fff;
}

.n2qa-results {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e8e8ff;
}

.n2qa-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.n2qa-result-label {
    flex: 0 0 100px;
    font-size: 14px;
    color: #333;
}

.n2qa-result-bar-wrap {
    flex: 1;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
}

.n2qa-result-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.n2qa-result-percent {
    flex: 0 0 50px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

/* ========================================
   コメント一覧
   ======================================== */
.n2qa-comments {
    margin-top: 16px;
}

.n2qa-comment-item {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.n2qa-comment-author {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.n2qa-comment-text {
    font-size: 14px;
    color: #333;
}

/* ========================================
   ローディング
   ======================================== */
.n2qa-loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

/* ========================================
   自分の活動表示
   ======================================== */
.n2qa-activity-section {
    margin-bottom: 20px;
}

.n2qa-activity-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #667eea;
}

.n2qa-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.n2qa-activity-item {
    background: #f8f9ff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.n2qa-activity-text {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.n2qa-activity-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #888;
}

.n2qa-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.n2qa-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.n2qa-status-approved {
    background: #d1fae5;
    color: #065f46;
}

.n2qa-status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.n2qa-status-closed {
    background: #e5e7eb;
    color: #4b5563;
}

.n2qa-activity-empty {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 14px;
}

.n2qa-response-badge {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
}

.n2qa-activity-comment {
    font-size: 13px;
    color: #555;
    padding: 6px 0 0 12px;
    border-left: 2px solid #e0e0e0;
    margin-top: 6px;
}

/* ========================================
   スライダー（複数質問）
   ======================================== */
.n2qa-questions-container {
    margin: 24px 0;
}

.n2qa-slider-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 12px;
}

.n2qa-slider-prev,
.n2qa-slider-next {
    padding: 6px 12px;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
}

.n2qa-slider-prev:hover:not(:disabled),
.n2qa-slider-next:hover:not(:disabled) {
    border-color: #667eea;
    color: #667eea;
}

.n2qa-slider-prev:disabled,
.n2qa-slider-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.n2qa-slider-indicator {
    font-size: 14px;
    color: #666;
}

.n2qa-slider-current {
    font-weight: 600;
    color: #667eea;
}

.n2qa-questions-slider {
    position: relative;
}

.n2qa-question-block {
    display: none;
}

.n2qa-question-block.active {
    display: block;
    animation: n2qa-fadeIn 0.3s ease;
}

@keyframes n2qa-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   質問ヘッダー（時間表示追加）
   ======================================== */
.n2qa-question-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.n2qa-question-author {
    font-size: 13px;
    color: #666;
}

.n2qa-question-time {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 480px) {
    .n2qa-ask-button {
        bottom: 120px;
        right: 15px;
        padding: 14px 18px;
        min-width: 48px;
        min-height: 48px;
    }

    .n2qa-ask-text {
        display: none;
    }

    .n2qa-modal-content {
        margin: 10px;
    }

    .n2qa-choice-btn {
        width: 100%;
        text-align: center;
        min-height: 44px;
    }
}
