/* メインコンテナ */
.cf7-star-rating-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin: 20px 0;
}

/* アイテムカード */
.cf7-item-card {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cf7-item-card.rated {
    border-color: #ffd700;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.15);
}

/* アイテム情報 */
.item-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 8px 0;
}

.item-description {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.item-price {
    font-size: 14px;
    font-weight: 600;
    color: #e67e22;
    margin: 0 0 16px 0;
}

/* 評価セクション */
.star-rating-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
}

.rating-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
    text-align: center;
}

/* Range バー */
.range-container {
    margin-bottom: 16px;
}

.rating-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 8px 0;
    cursor: pointer;
}

.rating-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.rating-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    user-select: none;
}

/* 評価表示エリア */
.rating-display {
    text-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

.rating-number {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.current-rating {
    color: #f59e0b;
}

.rating-max {
    color: #9ca3af;
}

.rating-description {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    margin-top: 4px;
}

/* 星表示エリア */
.stars-display {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
}

.star {
    font-size: 20px;
    color: #e5e7eb;
    transition: color 0.2s ease;
    user-select: none;
}

.star.filled {
    color: #fbbf24;
}

.star.half {
    background: linear-gradient(90deg, #fbbf24 50%, #e5e7eb 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Safari/Chromeで動作しない場合の対応 */
@supports not (-webkit-background-clip: text) {
    .star.half {
        color: #e5e7eb;
        position: relative;
    }

    .star.half::before {
        content: '★';
        position: absolute;
        left: 0;
        top: 0;
        width: 50%;
        overflow: hidden;
        color: #fbbf24;
    }
}

/* コメント欄 */
.comment-section {
    margin-top: 12px;
}

.comment-section label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.item-comment {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    min-height: 60px;
}

.item-comment:focus {
    border-color: #fbbf24;
    outline: none;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.3);
}

/* アニメーション */
@keyframes ratingPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.rating-display.updated {
    animation: ratingPulse 0.3s ease;
    border-color: #fbbf24;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .cf7-star-rating-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .star {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .cf7-item-card {
        padding: 16px;
    }

    .star-rating-section {
        padding: 12px;
    }

    .item-name {
        font-size: 15px;
    }

    .rating-number {
        font-size: 16px;
    }

    .star {
        font-size: 18px;
    }
}
