/* Reaction Discussion フロントエンドスタイル */

.rd-form-container {
    max-width: 600px;
    margin: 10px auto 20px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* フッター固定表示 */
.rd-form-container.rd-form-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    transition: transform 0.3s ease;
}

.rd-form-container.rd-form-fixed .rd-form-container-inner {
    max-width: 600px;
    margin: 0 auto;
}

/* フォームヘッダーの開閉ボタン */
.rd-form-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
}

.rd-form-title-wrapper .rd-form-title {
    flex: 1;
    text-align: center;
}

.rd-form-toggle-btn {
    background: transparent;
    border: none;
    border-radius: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: absolute;
    left: 10px;
}

.rd-form-toggle-btn:hover {
    background: transparent;
}

.rd-form-toggle-icon {
    font-size: 12px;
    line-height: 1;
    color: #999;
    transition: transform 0.3s ease;
    display: inline-block;
}

.rd-form-toggle-btn:hover .rd-form-toggle-icon {
    color: #666;
}

/* 閉じた状態 */
.rd-form-container.rd-form-fixed.rd-form-collapsed {
    transform: translateY(calc(100% - 25px));
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.rd-form-container.rd-form-fixed.rd-form-collapsed .rd-form-container-inner {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.rd-form-container.rd-form-fixed.rd-form-collapsed .rd-form-content {
    display: none;
}

/* 開いている状態では▼、閉じている状態では▲（180度回転） */
.rd-form-container.rd-form-fixed.rd-form-collapsed .rd-form-toggle-icon {
    transform: rotate(180deg);
}

.rd-form-container.rd-form-fixed.rd-form-collapsed .rd-form-header {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    height: auto;
}

.rd-form-container.rd-form-fixed.rd-form-collapsed .rd-form-title-wrapper {
    height: auto;
    overflow: visible;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 0;
}

.rd-form-container.rd-form-fixed.rd-form-collapsed .rd-form-title {
    display: none;
}

.rd-form-container.rd-form-fixed.rd-form-collapsed .rd-form-toggle-btn {
    position: absolute;
    left: 10px;
}

@media (max-width: 768px) {
    .rd-form-container.rd-form-fixed {
        padding: 10px 15px;
    }
    
    .rd-form-container.rd-form-fixed .rd-form-title {
        font-size: 18px;
    }
    
    .rd-form-container.rd-form-fixed.rd-form-collapsed .rd-form-title {
        display: none;
    }
    
    .rd-form-container.rd-form-fixed .rd-position-btn {
        padding: 15px;
        font-size: 16px;
    }
    
    .rd-form-container.rd-form-fixed .rd-form-container-inner {
        max-width: 100%;
    }
    
    .rd-form-toggle-btn {
        width: auto;
        height: auto;
    }
    
    .rd-form-toggle-icon {
        font-size: 11px;
    }
}

.rd-form-header {
    margin-bottom: 30px;
}

.rd-form-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 0;
    color: #333;
}

.rd-position-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

.rd-position-btn {
    flex: 1;
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f5f5f5;
    color: #666;
}

.rd-recommend-btn {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.rd-recommend-btn.active,
.rd-recommend-btn:hover {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

.rd-not-suitable-btn {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
}

.rd-not-suitable-btn.active,
.rd-not-suitable-btn:hover {
    background: #ff9800;
    color: #fff;
    border-color: #ff9800;
}

.rd-reasons-section {
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 8px;
}

.rd-reasons-section.recommend {
    background: rgba(76, 175, 80, 0.05);
}

.rd-reasons-section.not-suitable {
    background: rgba(255, 152, 0, 0.05);
}

.rd-reasons-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 4px;
}

.rd-reasons-section.recommend .rd-reasons-title {
    background: #4caf50;
    color: #fff;
}

.rd-reasons-section.not-suitable .rd-reasons-title {
    background: #ff9800;
    color: #fff;
}

.rd-reasons-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rd-reason-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.rd-reason-checkbox-item:hover {
    background: #f9f9f9;
}

.rd-reason-checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.rd-reason-checkbox-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-size: 16px;
}

.rd-comment-section {
    margin-bottom: 20px;
}

.rd-comment-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.rd-comment-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

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

.rd-submit-section {
    text-align: center;
}

.rd-submit-btn {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.rd-submit-btn:hover {
    background: #45a049;
}

.rd-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.rd-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.rd-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.rd-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* ディスカッション表示スタイル */

.rd-discussion-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0px;
}

.rd-section-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.rd-overall-stats {
    margin-bottom: 50px;
}

.rd-position-comparison {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: nowrap;
}

.rd-position-stat {
    flex: 1;
    padding: 40px 20px;
    border-radius: 12px;
    text-align: center;
    color: #fff;
}

.rd-recommend-stat {
    background: #4caf50;
}

.rd-not-suitable-stat {
    background: #f44336;
}

.rd-position-label {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: bold;
}

.rd-position-percent {
    font-size: 48px;
    font-weight: bold;
}

.rd-vs-divider {
    font-size: 24px;
    font-weight: bold;
    color: #666;
}

/* 円グラフスタイル */
.rd-pie-chart-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.rd-pie-chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 30px;
}

.rd-pie-chart {
    width: 100%;
    padding-top: 100%; /* アスペクト比1:1を維持 */
    border-radius: 50%;
    position: relative;
}

.rd-pie-chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.rd-pie-chart-total {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.rd-pie-chart-label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.rd-pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rd-pie-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rd-pie-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.rd-pie-legend-label {
    font-weight: bold;
    color: #333;
    min-width: 120px;
}

.rd-pie-legend-value {
    color: #666;
    font-size: 14px;
}

.rd-reason-distribution {
    margin-bottom: 50px;
}

.rd-reason-bars {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.rd-reason-bar-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.rd-reason-pair-labels {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
}

.rd-reason-label {
    flex: 1;
    color: #333;
}

.rd-reason-label.recommend-label {
    text-align: right;
    color: #4caf50;
}

.rd-reason-label.not-suitable-label {
    text-align: left;
    color: #f44336;
}

.rd-reason-separator {
    font-size: 20px;
    color: #999;
    font-weight: normal;
    padding: 0 10px;
}

.rd-reason-bar {
    display: flex;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.rd-reason-bar-segment {
    height: 100%;
    transition: width 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.rd-reason-bar-segment.recommend {
    background: #4caf50;
}

.rd-reason-bar-segment.not-suitable {
    background: #f44336;
}

.rd-bar-count {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    padding: 0 8px;
}

.rd-reason-summary {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-top: 5px;
}

.rd-comments-section {
    margin-top: 50px;
}

.rd-comments-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.rd-comment-tab {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rd-comment-tab.active {
    background: #fff;
    color: #333;
    border-bottom-color: transparent;
}

.rd-comment-tab[data-tab="recommend"].active {
    border-top-color: #4caf50;
    border-left-color: #4caf50;
    border-right-color: #4caf50;
    color: #4caf50;
}

.rd-comment-tab[data-tab="not-suitable"].active {
    border-top-color: #f44336;
    border-left-color: #f44336;
    border-right-color: #f44336;
    color: #f44336;
}

.rd-comments-column.rd-tab-content {
    display: none;
}

.rd-comments-column.rd-tab-content.active {
    display: block;
}

@media (min-width: 769px) {
    .rd-comments-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    
    .rd-comments-tabs {
        display: none !important;
    }
    
    .rd-comments-column.rd-tab-content {
        display: block !important;
    }
}

.rd-comments-column {
    padding: 20px;
    border-radius: 8px;
}

.rd-recommend-comments {
    background: rgba(76, 175, 80, 0.05);
}

.rd-not-suitable-comments {
    background: rgba(244, 67, 54, 0.05);
}

.rd-comments-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
}

.rd-recommend-comments .rd-comments-title {
    color: #4caf50;
    border-color: #4caf50;
}

.rd-not-suitable-comments .rd-comments-title {
    color: #f44336;
    border-color: #f44336;
}

.rd-comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rd-comment-item {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rd-comment-text {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: #333;
}

.rd-comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.rd-no-comments {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

.rd-load-more-wrapper {
    text-align: center;
    padding-top: 20px;
}

.rd-load-more-btn {
    padding: 5px 15px;
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    background: #d4d4d4;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rd-load-more-btn:hover {
    background: #686868;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.rd-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .rd-position-selector {
        flex-wrap: nowrap;
    }
    
    .rd-position-comparison {
        gap: 10px;
    }
    
    .rd-position-stat {
        padding: 20px 10px;
    }
    
    .rd-position-label {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .rd-position-percent {
        font-size: 32px;
    }
    
    .rd-vs-divider {
        font-size: 18px;
    }
    
    .rd-comments-section {
        grid-template-columns: 1fr;
    }
    
    .rd-pie-chart-wrapper {
        max-width: 250px;
    }
    
    .rd-pie-chart-total {
        font-size: 28px;
    }
    
    .rd-pie-legend-label {
        min-width: 100px;
        font-size: 14px;
    }
}

