/* ===== 인사이트 패널 ===== */

.insights-panel {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.insights-header {
    text-align: center;
    margin-bottom: 40px;
}

.insights-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.insights-subtitle {
    color: #7f8c8d;
    font-size: 16px;
    margin: 10px 0;
}

.insights-update-time {
    color: #95a5a6;
    font-size: 14px;
    margin-top: 5px;
}

/* 요약 카드 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 24px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}

.summary-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.summary-icon {
    font-size: 48px;
    line-height: 1;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.summary-value {
    font-size: 20px;  /* 28px에서 20px로 축소 */
    font-weight: bold;
    text-align: left;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* 최대 2줄까지 표시 */
    -webkit-box-orient: vertical;
    white-space: normal;  /* 줄바꿈 허용 */
    line-height: 1.3;
    max-height: 52px;  /* 2줄 높이 (20px * 1.3 * 2) */
}

/* 섹션 */
.insights-section {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.insights-section h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #2c3e50;
}

.section-description {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 20px;
}

/* 차트 */
.chart-container {
    margin-top: 20px;
}

.bar-chart, .bar-chart-small {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-bar {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    gap: 12px;
    align-items: center;
}

.chart-bar-small {
    display: grid;
    grid-template-columns: 100px 1fr 60px;
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.bar-label {
    font-weight: 500;
    color: #2c3e50;
}

.bar-label-small {
    font-weight: 500;
    color: #2c3e50;
    font-size: 13px;
}

.bar-fill-container {
    background: #ecf0f1;
    border-radius: 8px;
    height: 32px;
    overflow: hidden;
    position: relative;
}

.bar-fill-container-small {
    background: #ecf0f1;
    border-radius: 6px;
    height: 24px;
    overflow: hidden;
}

.bar-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
    min-width: 2%;
}

.bar-fill-small {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
    min-width: 2%;
}

.bar-value {
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
}

.bar-value-small {
    text-align: right;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

/* 파이 차트 (간단 버전) */
.pie-chart-simple {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pie-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pie-label {
    min-width: 80px;
    font-weight: 500;
    color: #2c3e50;
}

.pie-bar {
    flex: 1;
    background: #ecf0f1;
    border-radius: 6px;
    height: 24px;
    overflow: hidden;
}

.pie-fill {
    background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.pie-value {
    min-width: 120px;
    text-align: right;
    font-size: 14px;
    color: #7f8c8d;
}

/* 2컬럼 그리드 */
.two-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.chart-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.chart-box h4 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #2c3e50;
}

.chart-box-stacked {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.chart-box-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.chart-box-item h4 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #2c3e50;
}

/* 키워드 태그 */
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.keyword-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keyword-tag:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.keyword-text {
    font-size: 15px;
}

.keyword-count {
    background: rgba(255,255,255,0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
}

.loading-keywords {
    color: #95a5a6;
    font-style: italic;
}

.no-data-message {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    padding: 20px;
}

/* 도움말 */
.insights-help {
    background: #fff9e6;
    border-left: 4px solid #f39c12;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.insights-help h4 {
    color: #f39c12;
    margin-bottom: 12px;
    font-size: 18px;
}

.insights-help ul {
    list-style: none;
    padding: 0;
}

.insights-help li {
    padding: 8px 0;
    color: #7f8c8d;
    line-height: 1.6;
}

.insights-help strong {
    color: #2c3e50;
}

/* ===== 품질 배지 ===== */

.quality-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.quality-badge.warning-high {
    background: #e74c3c;
    color: white;
}

.quality-badge.warning-medium {
    background: #f39c12;
    color: white;
}

.quality-badge.warning-low {
    background: #f1c40f;
    color: #2c3e50;
}

/* 신고 버튼 */
.report-btn {
    position: absolute;
    top: 12px;
    right: 80px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    z-index: 10;
}

.report-btn:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    transform: scale(1.1);
}

/* ===== 신고 모달 ===== */

.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.report-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.report-modal-header {
    padding: 24px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-modal-header h3 {
    margin: 0;
    font-size: 22px;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #95a5a6;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #2c3e50;
}

.report-modal-body {
    padding: 24px;
}

.report-post-title {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
    color: #2c3e50;
}

.report-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.6;
}

.report-types {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.report-type-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-type-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.report-type-option input[type="radio"] {
    margin-top: 4px;
    cursor: pointer;
}

.report-type-option input[type="radio"]:checked + .report-type-label {
    color: #667eea;
}

.report-type-option:has(input:checked) {
    border-color: #667eea;
    background: #f8f9ff;
}

.report-type-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-type-label strong {
    display: block;
    color: #2c3e50;
    font-size: 15px;
}

.report-type-label small {
    display: block;
    color: #7f8c8d;
    font-size: 13px;
}

.report-comment-section {
    margin-top: 20px;
}

.report-comment-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.report-comment-section textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.report-comment-section textarea:focus {
    outline: none;
    border-color: #667eea;
}

.report-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.report-modal-footer .btn {
    padding: 10px 24px;
    font-size: 15px;
}

/* 반응형 */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .summary-card {
        padding: 16px;
        gap: 12px;
    }

    .summary-icon {
        font-size: 32px;
    }

    .summary-label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .summary-value {
        font-size: 16px;
        max-height: 42px;
        line-height: 1.3;
    }

    .chart-bar {
        grid-template-columns: 100px 1fr 60px;
        gap: 8px;
    }

    .two-column-grid {
        grid-template-columns: 1fr;
    }

    .insights-section {
        padding: 20px;
    }

    .keyword-tag {
        font-size: 13px;
        padding: 8px 14px;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .summary-card {
        padding: 14px;
        gap: 10px;
    }

    .summary-icon {
        font-size: 28px;
    }

    .summary-label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .summary-value {
        font-size: 14px;
        max-height: 37px;
        line-height: 1.3;
    }

    .chart-bar {
        grid-template-columns: 80px 1fr 50px;
        font-size: 13px;
    }

    .bar-label {
        font-size: 13px;
    }

    .report-modal-content {
        width: 95%;
    }

    .report-modal-header {
        padding: 16px;
    }

    .report-modal-body {
        padding: 16px;
    }
}
