/**
 * FX Reviews Plugin Styles
 */

/* General container styles */
.fx-reviews {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}

.fx-reviews h2 {
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
    color: #333;
}

/* Reviews summary */
.fx-reviews-summary {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* チャートとグラフの表示エリア */
.fx-reviews-charts {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    margin: 20px 0;
}

.chart-container {
    margin: 10px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    flex: 1 1 300px;
    max-width: 45%;
}

.chart-container h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #555;
    text-align: center;
}

/* カテゴリ評価表示グリッド */
.fx-category-ratings {
    margin: 25px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.fx-category-ratings h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #444;
    text-align: center;
}

.category-rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #0073aa;
}

.category-name {
    font-weight: bold;
    color: #444;
}

.rating-stars.small {
    font-size: 14px;
    color: #FFD700;
}

.fx-reviews-overall {
    text-align: center;
    margin-bottom: 20px;
}

.overall-rating {
    display: inline-block;
    margin-bottom: 15px;
}

.rating-label {
    font-size: 18px;
    font-weight: bold;
    color: #444;
    display: block;
    margin-bottom: 5px;
}

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

.rating-average {
    font-size: 24px;
    color: #FFD700;
    margin-bottom: 5px;
}

.rating-number {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-left: 5px;
}

.rating-count {
    color: #666;
    font-size: 14px;
    font-weight: bold;
}

.reviews-showing {
    color: #888;
    font-size: 13px;
    margin-top: 5px;
    font-style: italic;
}

/* Sort options */
.customer-reviews-sort {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.sort-label {
    font-size: 14px;
    color: #666;
    margin-right: 10px;
}

.sort-options {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 10px;
}

.sort-options li {
    margin: 0;
}

.sort-options a {
    display: inline-block;
    padding: 5px 12px;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    border-radius: 15px;
    background: #eee;
    transition: all 0.2s ease;
}

.sort-options a:hover {
    background: #e0e0e0;
    color: #333;
}

.sort-options li.active a {
    background: #0073aa;
    color: white;
}

.customer-reviews-more {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

/* Company name in review */
.customer-review-company {
    font-weight: bold;
    color: #555;
}

/* Static value in form */
.form-static-value {
    padding: 8px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: bold;
}

/* Review item styles */
.fx-review-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.fx-review-item:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.fx-review-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* FXレビュー特有のカテゴリ評価表示 */
.fx-review-categories {
    background: #f5f7fa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    border: 1px solid #eee;
}

.category-ratings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.category-rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
}

.category-label {
    font-weight: 500;
    color: #555;
}

.category-stars {
    color: #FFD700;
    font-size: 14px;
}

/* Avatar styles */
.fx-review-avatar {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.fx-review-avatar.male {
    background-image: url('https://www.kenkohub.jp/wp-content/uploads/2024/10/people4.png');
}

.fx-review-avatar.female {
    background-image: url('https://www.kenkohub.jp/wp-content/uploads/2024/10/people2.png');
}

/* Author info styles */
.fx-review-author {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 2px;
}

.fx-review-metadata {
    color: #666;
    font-size: 0.9em;
}

.fx-review-author-info {
    flex: 1;
}

/* Rating styles */
.fx-review-rating {
    color: #FFD700;
    margin-left: auto;
    font-size: 18px;
    letter-spacing: 2px;
}

/* Company info in review */
.fx-review-company {
    margin-top: 5px;
    padding: 3px 8px;
    background: #0073aa;
    color: white;
    border-radius: 3px;
    display: inline-block;
    font-size: 12px;
}

/* Content styles */
.fx-review-content {
    line-height: 1.7;
    margin: 18px 0;
    font-size: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* Footer styles */
.fx-review-footer {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.85em;
    margin-top: 18px;
    flex-wrap: wrap;
}

.fx-review-date {
    margin-top: 5px;
}

/* FXレビュー用ソート機能 */
.fx-reviews-sort {
    margin: 20px 0;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 5px;
    text-align: center;
}

.sort-options {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
}

/* Success and error messages */
.customer-reviews-success {
    background-color: #ecf7ed;
    border-left: 4px solid #46b450;
    padding: 12px 15px;
    margin: 15px 0 25px;
    border-radius: 4px;
}

.customer-reviews-error {
    background-color: #fbeaea;
    border-left: 4px solid #dc3232;
    padding: 12px 15px;
    margin: 15px 0 25px;
    border-radius: 4px;
}

/* Form styles */
.customer-reviews-form,
.fx-reviews-form {
    max-width: 800px;
    margin: 25px auto;
    padding: 25px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.customer-reviews-form h2,
.fx-reviews-form h2 {
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
    color: #333;
}

.customer-reviews-form .form-row,
.fx-reviews-form .form-row {
    margin-bottom: 20px;
}

.customer-reviews-form label,
.fx-reviews-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #444;
}

.customer-reviews-form label .required,
.fx-reviews-form label .required {
    color: #dc3232;
    margin-left: 3px;
}

.customer-reviews-form .description,
.fx-reviews-form .description {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
    font-style: italic;
}

/* FX特有のフォーム要素 */
.fx-reviews-form .form-section {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f0f7fa;
    border-radius: 6px;
    border: 1px solid #d5e9f2;
}

.fx-reviews-form .form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #0073aa;
    padding-bottom: 10px;
    border-bottom: 1px solid #d5e9f2;
}

/* Form inputs */
.customer-reviews-form input[type="text"],
.customer-reviews-form input[type="email"],
.customer-reviews-form select,
.customer-reviews-form textarea,
.fx-reviews-form input[type="text"],
.fx-reviews-form input[type="email"],
.fx-reviews-form select,
.fx-reviews-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.customer-reviews-form input[type="text"]:focus,
.customer-reviews-form input[type="email"]:focus,
.customer-reviews-form select:focus,
.customer-reviews-form textarea:focus,
.fx-reviews-form input[type="text"]:focus,
.fx-reviews-form input[type="email"]:focus,
.fx-reviews-form select:focus,
.fx-reviews-form textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0,115,170,0.3);
    outline: none;
}

.customer-reviews-form textarea,
.fx-reviews-form textarea {
    height: 150px;
    resize: vertical;
}

.fx-reviews-form .error,
.fx-reviews-form input.error,
.fx-reviews-form select.error,
.fx-reviews-form textarea.error {
    border-color: #dc3232;
    background-color: #fff8f8;
}

.fx-reviews-form .star-rating.error {
    border: 1px dashed #dc3232;
    padding: 5px;
    border-radius: 4px;
}

.form-error-message {
    background-color: #fbeaea;
    border-left: 4px solid #dc3232;
    padding: 12px 15px;
    margin: 0 0 20px;
    border-radius: 4px;
    color: #444;
    font-weight: bold;
}

/* Star rating */
.customer-reviews-form .star-rating,
.fx-reviews-form .star-rating {
    display: flex;
    margin: 12px 0;
}

.customer-reviews-form .star,
.fx-reviews-form .star {
    font-size: 28px;
    color: #ccc;
    cursor: pointer;
    margin-right: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.customer-reviews-form .star:hover,
.fx-reviews-form .star:hover {
    transform: scale(1.1);
}

.customer-reviews-form .star.selected,
.fx-reviews-form .star.selected,
.customer-reviews-form .star.hover,
.fx-reviews-form .star.hover {
    color: #FFD700;
}

/* FX専用のカテゴリ評価スター */
.fx-reviews-form .category-rating .star {
    font-size: 22px;
}

/* Review Controls */
.customer-reviews-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    font-weight: bold;
    color: #333;
}

.reviews-sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.reviews-sort-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.review-actions {
    display: flex;
    gap: 10px;
}

.write-review-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.write-review-btn:hover {
    background-color: #005d8c;
}

/* Responsive design */
@media (max-width: 768px) {
    .customer-reviews-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .sort-controls {
        justify-content: center;
    }
    
    .review-actions {
        justify-content: center;
    }
    
    .write-review-btn {
        width: 100%;
        padding: 12px 20px;
    }
}

/* Submit button */
.customer-reviews-form .submit-row,
.fx-reviews-form .submit-row {
    margin-top: 30px;
    text-align: center;
}

.customer-reviews-form .submit-button,
.fx-reviews-form .submit-button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.customer-reviews-form .submit-button:hover,
.fx-reviews-form .submit-button:hover {
    background-color: #005d8c;
    transform: translateY(-2px);
}

.customer-reviews-form .submit-button:active,
.fx-reviews-form .submit-button:active {
    transform: translateY(0);
}

/* Responsive styles */
@media (max-width: 768px) {
    .customer-reviews,
    .customer-reviews-form,
    .fx-reviews,
    .fx-reviews-form {
        padding: 15px;
    }
    
    .customer-review-header,
    .fx-review-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .customer-review-avatar,
    .fx-review-avatar {
        margin-bottom: 10px;
    }
    
    .customer-review-rating,
    .fx-review-rating {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .customer-review-footer,
    .fx-review-footer {
        flex-direction: column;
    }
    
    .customer-review-date,
    .fx-review-date {
        margin-top: 10px;
    }
    
    .customer-reviews-form .star,
    .fx-reviews-form .star {
        font-size: 24px;
    }
    
    /* モバイル用のチャート表示調整 */
    .chart-container {
        flex: 1 1 100%;
        max-width: 100%;
        margin: 10px 0;
    }
    
    .category-ratings {
        grid-template-columns: 1fr;
    }
    
    .fx-reviews-charts {
        flex-direction: column;
    }
    
    /* カテゴリ評価の表示調整 */
    .fx-review-categories .category-ratings {
        grid-template-columns: 1fr;
    }
}