/**
 * GrandScreen Ratings System - Styles
 *
 * Стили для системы рейтингов приложений
 *
 * @package GrandScreen
 * @since 1.0.0
 */



.grandscreen-rating-widget {
    margin: 30px 0;
    padding: 30px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}



.rating-summary {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.rating-block {
    flex: 1;
    min-width: 200px;
    padding: 20px 32px;
    background: transparent;
    border-radius: 0;
    text-align: center;
    border: none;
    transition: none;
}

.rating-block:hover {
    border-color: transparent;
    box-shadow: none;
}


.rating-block + .rating-block {
    border-left: 1px solid #E5E7EB;
}

.grandscreen-rating {
    border-color: transparent;
}

.rating-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B7280;
    margin-bottom: 10px;
    font-weight: 600;
}

.rating-value {
    margin-bottom: 8px;
}

.rating-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    color: #111827;
}

.grandscreen-rating .rating-number {
    color: #3B82F6;
}

.rating-max {
    font-size: 24px;
    color: #6B7280;
    margin-left: 2px;
}

.no-rating {
    font-size: 18px;
    color: #9CA3AF;
    font-style: italic;
}

.rating-count {
    font-size: 14px;
    color: #6B7280;
}



.rating-form {
    padding: 25px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    margin-bottom: 25px;
}


.rating-form-header {
    position: relative;
    margin-bottom: 20px;
    min-height: 80px; 
}

.rating-form-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    text-align: center;
    transition: all 0.3s ease;
}


.rating-tooltip {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -60px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    white-space: nowrap;
}

.rating-tooltip.visible {
    opacity: 1;
    top: -70px;
}

.rating-tooltip__text {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.rating-tooltip__score {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.rating-tooltip__score-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: -2px;
    opacity: 0.9;
}


.rating-tooltip__score.score-0-1 {
    background: #FF6B6B;
}

.rating-tooltip__score.score-2-3 {
    background: #FF8E53;
}

.rating-tooltip__score.score-4-6 {
    background: #FFC107;
}

.rating-tooltip__score.score-7-8 {
    background: #8BC34A;
}

.rating-tooltip__score.score-9-10 {
    background: #00C853;
}


.rating-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.rating-stars {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rating-star {
    width: 50px;
    height: 50px;
    border: 1px solid #D1D5DB;
    background: #FFFFFF;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #000000; 
}


.rating-star.hover {
    background: #F0F7FF; 
    border: 2px solid #3B82F6;
    color: #3B82F6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.rating-star.selected {
    background: #3B82F6;
    border: 2px solid #3B82F6;
    color: #FFFFFF;
}


.rating-star.selected.hover,
.rating-star.selected:hover {
    background: #2563EB;
    border: 2px solid #2563EB;
    color: #FFFFFF;
}

.star-number {
    display: block;
}

.rating-actions {
    text-align: center;
    margin-bottom: 15px;
}

.btn-submit-rating {
    padding: 12px 32px;
    background: #3B82F6; 
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit-rating:hover:not(:disabled) {
    background: #2563EB; 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-submit-rating:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rating-message {
    display: none;
    margin-top: 15px;
}

.rating-message p {
    margin: 0;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
}

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

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



.rating-voted {
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    text-align: center;
    color: #155724;
    margin-bottom: 25px;
}

.rating-voted p {
    margin: 0;
    font-weight: 500;
}



.rating-distribution {
    padding: 0;
    margin-bottom: 30px;
    background: transparent;
    border: none;
    border-radius: 0;
}

.distribution-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}

.distribution-chart {
    position: relative;
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}


.rating-line-chart {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 300px;
}


.chart-tooltip {
    position: fixed;
    display: none;
    padding: 8px 12px;
    background: #FFFFFF;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    color: #111827;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.chart-tooltip strong {
    font-weight: 600;
    color: #3B82F6;
}


.distribution-row {
    display: none;
}

.distribution-label {
    width: 30px;
    font-weight: 600;
    color: #6B7280;
    text-align: right;
}

.distribution-bar {
    flex: 1;
    height: 24px;
    background: #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.distribution-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.distribution-count {
    width: 50px;
    text-align: right;
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}



@media (max-width: 768px) {
    .grandscreen-rating-widget {
        padding: 20px;
    }

    .rating-summary {
        gap: 0;
        flex-direction: column;
    }

    .rating-block {
        min-width: 100%;
        border-left: none !important;
        border-bottom: 1px solid #E5E7EB;
        padding: 20px 0;
    }

    .rating-block:last-child {
        border-bottom: none;
    }

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

    .rating-max {
        font-size: 18px;
    }

    .rating-stars {
        gap: 8px;
        margin-bottom: 16px;
    }

    .rating-star {
        width: 44px;
        height: 44px;
        font-size: 15px;
        font-weight: 600;
        color: #000000;
    }

    
    .rating-tooltip {
        flex-direction: column;
        gap: 8px;
        padding: 10px 16px;
        top: -90px;
    }

    .rating-tooltip.visible {
        top: -100px;
    }

    .rating-tooltip__text {
        font-size: 13px;
    }

    .rating-tooltip__score {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    .rating-line-chart {
        height: 250px;
    }

    .chart-tooltip {
        font-size: 12px;
        padding: 6px 10px;
    }

    .distribution-label {
        width: 25px;
        font-size: 14px;
    }

    .distribution-bar {
        height: 20px;
    }

    .distribution-count {
        width: 40px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .rating-star {
        width: 35px;
        height: 35px;
        font-size: 14px;
        font-weight: 600;
        color: #000000;
    }

    .btn-submit-rating {
        width: 100%;
        padding: 12px 20px;
        border-radius: 8px;
    }

    .rating-line-chart {
        height: 200px;
    }

    .rating-distribution {
        padding: 15px;
    }

    .distribution-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
}


