/* Unicorn Factory OnPage-Feedback - Frontend Styles */

.brp-rating-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    background-color: var(--brp-background-color, transparent);
    border-radius: 8px;
    max-width: 600px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.brp-rating-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--brp-title-color, #a65426);
}

.brp-rating-subtitle {
    color: #666;
    margin-bottom: 2rem;
}

.brp-rating-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.brp-rating-option {
    background: none;
    border: none;
    cursor: pointer;
    transform: scale(1);
    transition: all 0.2s ease;
    padding: 0.75rem;
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.brp-rating-option:hover {
    transform: scale(1.05);
    background-color: rgba(0, 0, 0, 0.05);
}

.brp-rating-option.selected {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.1);
}

.brp-rating-option.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Already rated state - show options but not clickable */
.brp-already-rated .brp-rating-option {
    cursor: default;
    pointer-events: none;
    opacity: 0.6;
}

.brp-already-rated .brp-rating-option:hover {
    transform: scale(1);
    background-color: transparent;
}

.brp-rating-option svg {
    width: 60px;
    height: 60px;
    color: var(--brp-primary-color, #ff6000);
}

/* Star Layout */
.brp-layout-stars .brp-star {
    font-size: 2.5rem;
    color: #999;
    transition: color 0.2s ease;
}

.brp-layout-stars .brp-rating-option:hover .brp-star,
.brp-layout-stars .brp-rating-option.selected .brp-star {
    color: var(--brp-primary-color, #ff6000);
}

/* Filled stars for showing average score */
.brp-layout-stars .brp-star.brp-star-filled {
    color: var(--brp-primary-color, #ff6000);
}

/* Partially filled star using gradient */
.brp-layout-stars .brp-star.brp-star-partial {
    background: linear-gradient(
        90deg,
        var(--brp-primary-color, #ff6000) var(--fill-percent, 50%),
        #999 var(--fill-percent, 50%)
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Already rated: filled stars stay colored, unfilled stay gray */
.brp-already-rated .brp-star {
    opacity: 1;
}

.brp-already-rated .brp-star.brp-star-filled {
    color: var(--brp-primary-color, #ff6000);
}

/* Thumbs Layout */
.brp-layout-thumbs .brp-rating-options {
    gap: 2rem;
}

.brp-layout-thumbs svg {
    width: 50px;
    height: 50px;
}

/* Hearts Layout */
.brp-layout-hearts .brp-heart {
    font-size: 2.5rem;
    color: #ddd;
    transition: color 0.2s ease;
}

.brp-layout-hearts .brp-rating-option:hover .brp-heart,
.brp-layout-hearts .brp-rating-option.selected .brp-heart {
    color: #e74c3c;
}

/* Rating Summary */
.brp-rating-summary {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #666;
}

.brp-rating-summary p {
    margin: 0;
}

/* Feedback Message */
.brp-feedback-message {
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.brp-feedback-message.success {
    color: var(--brp-primary-color, #ff6000);
}

.brp-feedback-message.error {
    color: #e74c3c;
}

.brp-selected-label {
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Feedback Modal */
.brp-feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.brp-feedback-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.brp-feedback-modal h3 {
    margin-top: 0;
    color: var(--brp-primary-color, #ff6000);
}

.brp-feedback-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    margin: 1rem 0;
}

.brp-feedback-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.brp-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.brp-btn-primary {
    background-color: var(--brp-primary-color, #ff6000);
    color: white;
}

.brp-btn-primary:hover {
    background-color: #8a4520;
}

.brp-btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.brp-btn-secondary:hover {
    background-color: #d0d0d0;
}

/* Loading State */
.brp-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--brp-primary-color, #a65426);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .brp-rating-container {
        padding: 1.5rem;
    }
    
    .brp-rating-options {
        gap: 0.5rem;
    }
    
    .brp-rating-option svg {
        width: 45px;
        height: 45px;
    }
    
    .brp-layout-stars .brp-star,
    .brp-layout-hearts .brp-heart {
        font-size: 2rem;
    }
}