/**
 * 適用金利集約ページスタイル
 */

/* ヘッダー部分 */
.interest-aggregate-header {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.interest-aggregate-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.lender-logo {
    max-width: 200px;
    margin: 0 auto 20px;
    text-align: center;
}

.lender-logo img {
    max-width: 100%;
    height: auto;
}

.lender-basic-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.info-list {
    display: flex;
    gap: 30px;
    margin: 0;
}

.info-list dt {
    font-weight: bold;
    color: #666;
}

.info-list dd {
    margin: 0;
    color: #333;
}

.official-link {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.3s;
}

.official-link:hover {
    background: #005a87;
}

/* カスタムHTMLエリア */
.custom-html-area {
    margin-bottom: 40px;
    padding: 20px;
    background: #f0f8ff;
    border-left: 4px solid #007cba;
}

/* 統計情報セクション */
.statistics-section {
    margin-bottom: 50px;
}

.statistics-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #007cba;
    margin: 0;
}

/* 金利分布グラフ */
.rate-distribution {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.rate-distribution h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.distribution-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.distribution-bar .range {
    min-width: 80px;
    font-size: 14px;
    color: #666;
}

.distribution-bar .bar {
    background: #007cba;
    height: 30px;
    border-radius: 4px;
    position: relative;
    min-width: 50px;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.distribution-bar .count {
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* 体験談投稿フォーム */
.submission-form-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 50px;
}

.submission-form-section h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.form-description {
    color: #666;
    margin-bottom: 20px;
}

.experience-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group .required {
    color: #dc3545;
}

.form-group input[type="month"],
.form-group input[type="number"],
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-group input {
    flex: 1;
}

.input-suffix {
    font-size: 16px;
    color: #666;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.form-submit {
    margin-top: 30px;
}

.submit-button {
    background: #007cba;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-button:hover {
    background: #005a87;
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

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

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

/* select要素のスタイル */
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
}

/* 追加の統計情報セクション */
.additional-statistics {
    margin-top: 40px;
}

.stat-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.stat-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-item .label {
    font-size: 14px;
    color: #666;
}

.stat-item .value {
    font-size: 16px;
    font-weight: bold;
    color: #007cba;
}

/* 体験談一覧 */
.experiences-section {
    margin-bottom: 50px;
}

.experiences-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
}

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

.experience-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.experience-rate {
    font-size: 28px;
    color: #007cba;
    margin: 0;
}

.experience-date {
    color: #666;
    font-size: 14px;
}

/* 体験談詳細情報 */
.experience-details {
    margin-bottom: 15px;
}

.detail-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    margin: 0;
}

.detail-list dt {
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.detail-list dd {
    font-size: 14px;
    color: #333;
    margin: 0;
}

.experience-comment {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.experience-comment p {
    margin: 0;
    line-height: 1.6;
}

/* 適用金利ハイライト */
.applied-rate-highlight {
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4fd 100%);
    border: 2px solid #007cba;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.rate-description {
    font-size: 16px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: normal;
}

.rate-value {
    font-size: 36px;
    font-weight: bold;
    color: #007cba;
    margin: 0;
}

.experience-meta {
    display: flex;
    justify-content: flex-end;
}

.posted-date {
    font-size: 12px;
    color: #999;
}

.no-experiences {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.pagination .current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* 記事コンテンツセクション */
.article-content-section {
    margin-top: 50px;
    padding-top: 50px;
    border-top: 2px solid #e0e0e0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .interest-aggregate-header {
        padding: 20px;
    }
    
    .interest-aggregate-title {
        font-size: 24px;
    }
    
    .lender-basic-info {
        flex-direction: column;
    }
    
    .info-list {
        flex-direction: column;
        gap: 10px;
    }
    
    .statistics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .experience-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .submission-form-section {
        padding: 20px;
    }
    
    .applied-rate-highlight {
        padding: 15px;
        margin: 15px 0;
    }
    
    .rate-description {
        font-size: 14px;
    }
    
    .rate-value {
        font-size: 28px;
    }
}

/* 円グラフセクション */
.rate-pie-chart {
    margin: 40px 0;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.rate-pie-chart h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.pie-chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

#ratePieChart {
    max-width: 300px;
    height: 300px;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.legend-color {
    width: 20px;
    height: 20px;
    display: inline-block;
    border-radius: 3px;
}

/* 円グラフの色設定 */
.legend-color[data-range="0-3"] { background-color: #3498db; }
.legend-color[data-range="3-6"] { background-color: #2ecc71; }
.legend-color[data-range="6-9"] { background-color: #f1c40f; }
.legend-color[data-range="9-12"] { background-color: #e67e22; }
.legend-color[data-range="12-15"] { background-color: #e74c3c; }
.legend-color[data-range="15-18"] { background-color: #9b59b6; }
.legend-color[data-range="18-20"] { background-color: #34495e; }

/* グリッドとチャートの並列表示 */
.stat-grid-with-chart {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: start;
}

/* 棒グラフスタイル */
.stat-chart {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.bar-item {
    margin-bottom: 15px;
}

.bar-label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #666;
}

.bar-container {
    background: #e0e0e0;
    height: 30px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.bar {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    height: 100%;
    border-radius: 15px;
    position: relative;
    transition: width 0.5s ease;
    min-width: 40px;
}

.bar-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .stat-grid-with-chart {
        grid-template-columns: 1fr;
    }
    
    .pie-chart-container {
        flex-direction: column;
    }
}

/* 満足度評価スタイル */
.satisfaction-rating {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.satisfaction-rating h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.rating-stars {
    font-size: 24px;
    margin-bottom: 5px;
}

.rating-stars .star {
    display: inline-block;
    margin: 0 2px;
}

.rating-stars .star.filled {
    color: #ffc107;
}

.rating-stars .star.empty {
    color: #ddd;
}

.rating-value {
    font-size: 14px;
    color: #666;
    margin-left: 10px;
}

/* 統計セクションの小さい星 */
.rating-stars-small {
    font-size: 16px;
}

.rating-stars-small .star {
    margin: 0 1px;
}

/* 体験談写真ギャラリー */
.experience-photos {
    margin: 20px 0;
}

.experience-photos h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.photo-gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.photo-item {
    position: relative;
    cursor: pointer;
}

.gallery-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    border-color: #007cba;
}

/* モーダル表示用（将来的な拡張のため） */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

.photo-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.photo-modal.active {
    display: flex;
}

/* 評価選択スタイル */
.rating-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.rating-selector input[type="radio"] {
    display: none;
}

.rating-label {
    cursor: pointer;
    color: #ddd;
    font-size: 24px;
    transition: color 0.3s ease;
}

.rating-selector input[type="radio"]:checked ~ .rating-label {
    color: #ffc107;
}

.rating-selector input[type="radio"]:checked + .rating-label {
    color: #ffc107;
}

.rating-label:hover {
    color: #ffc107;
}

/* ファイルアップロード */
.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: #007cba;
}

/* 満足度分布の横棒グラフ */
.satisfaction-distribution {
    margin: 40px 0;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.satisfaction-distribution h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.satisfaction-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.satisfaction-bar-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.satisfaction-label {
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.satisfaction-label .star-rating {
    color: #ffc107;
    font-size: 16px;
}

.satisfaction-label .label-text {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.satisfaction-bar-container {
    flex: 1;
    background: #f0f0f0;
    height: 35px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.satisfaction-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 15px;
    transition: width 0.8s ease-out;
    min-width: fit-content;
}

.satisfaction-bar .bar-text {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

/* 空の場合のテキスト表示 */
.satisfaction-bar[style*="width: 0%"] .bar-text {
    color: #666;
    position: absolute;
    left: 10px;
}

@media (max-width: 768px) {
    .satisfaction-label {
        min-width: 100px;
    }
    
    .satisfaction-label .star-rating {
        font-size: 14px;
    }
    
    .satisfaction-bar-row {
        gap: 10px;
    }
}