/**
 * Universal Form Block Styles
 * Version: 2.0.0 - REFACTORED: Universal classes for all post types
 * Description: Feedback form with star rating - works for Casino, Slot, Bonus, Bookmaker
 * 
 * Changelog:
 * - v2.0.0: BREAKING CHANGE - Renamed .casino-form-* to universal .form-* classes
 * - Added backward compatibility aliases for .casino-form-* (deprecated)
 * - Integrated with gt-button system
 * - Star rating styles preserved
 * - Added average rating display
 * - Responsive design
 * 
 * MIGRATION GUIDE:
 * Old class → New class
 * .casino-form-block → .form-block
 * .casino-form → .form
 * .casino-form__* → .form__*
 */

/* ============================================
   ELEMENTS OUTSIDE WHITE CONTAINER
   ============================================ */

/* Заголовок блока (вне белого контейнера) */
.form-block-title {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Изображение (вне белого контейнера) */
.form-image-wrapper {
    margin-bottom: 20px;
}

/*
.form-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
}
*/




.form-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
}






/* Описание (вне белого контейнера) */
.form-description {
    margin-bottom: 30px;
    color: #555555;
    font-size: 15px;
    line-height: 1.6;
}

.form-description p {
    margin: 0 0 10px 0;
}

.form-description p:last-child {
    margin-bottom: 0;
}

/* ============================================
   WHITE CONTAINER WITH FORM (UNIVERSAL)
   v2.0.0 - Now supports ALL post types
   ============================================ */

/*.form-block,
.casino-form-block {  BACKWARD COMPATIBILITY 
    margin: 0 0 40px 0;
    padding: 30px;
    background: #ffffff;
    border-radius: var(--radius-xs);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}*/

.form-wrapper,
.casino-form-block {
/*    margin: 0 0 40px 0;*/
    margin: 0;
    padding: 30px;
/*    background: #ffffff;*/
    background: var(--gt-table-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius-xs);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   AVERAGE RATING DISPLAY
   ============================================ */

.form__average-rating,
.casino-form__average-rating {  /* BACKWARD COMPATIBILITY */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    background: #fff5e6;
    border-left: 4px solid #ff9500;
    border-radius: 8px;
    margin-bottom: 24px;
}

.average-stars {
    display: flex;
    gap: 2px;
}

/* Звёзды среднего рейтинга */
.average-stars .star {
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
    display: inline-block;
}

.average-stars .star.filled::before {
    content: "\f005";
    font-weight: 900;
    color: #ff9500;
}

.average-stars .star.half::before {
    content: "\f5c0";
    font-weight: 900;
    color: #ff9500;
}

.average-stars .star.empty::before {
    content: "\f005";
    font-weight: 400;
/*    color: #e0e0e0;*/
    color: #ff9500;
}

.average-rating-value {
    font-size: 18px;
    font-weight: 700;
    color: #ff9500;
}

/* ============================================
   FORM ELEMENTS (UNIVERSAL)
   ============================================ */

.form,
.casino-form {  /* BACKWARD COMPATIBILITY */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form__field,
.casino-form__field {  /* BACKWARD COMPATIBILITY */
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form__label,
.casino-form__label {  /* BACKWARD COMPATIBILITY */
    font-size: 14px;
    font-weight: 600;
/*    color: #333333;*/
/*    color: var(--text-secondary);*/
    color: #fff;
}

.form__label .required,
.casino-form__label .required {
    color: #ff0000;
    margin-left: 2px;
}

.form__input,
.casino-form__input,
.form__textarea,
.casino-form__textarea {  /* BACKWARD COMPATIBILITY */
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
/*    color: #1a1a1a;*/
    color: var(--text-primary);
/*    background: #f9f9f9;*/
    background: var(--bg-secondary);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form__input:focus,
.casino-form__input:focus,
.form__textarea:focus,
.casino-form__textarea:focus {
    outline: none;
/*    background: #ffffff;*/
    background: var(--bg-secondary);
/*    border-color: #ff6b35;*/
    border-color: var(--primary);
/*    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);*/
/*    box-shadow: 0 0 0 3px var(--primary);*/
}

.form__input::placeholder,
.casino-form__input::placeholder,
.form__textarea::placeholder,
.casino-form__textarea::placeholder {
    color: #999999;
}

.form__textarea,
.casino-form__textarea {
    resize: vertical;
    min-height: 120px;
    max-height: 300px;
}

/* ============================================
   STAR RATING INPUT
   ============================================ */

.form__rating,
.casino-form__rating {  /* BACKWARD COMPATIBILITY */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.star-rating-input {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star-rating-input .star {
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.star-rating-input .star::before {
    content: "\f005";
    font-weight: 400;
    color: #ff9500;
}

.star-rating-input .star.active::before {
    content: "\f005";
    font-weight: 900;
    color: #ff9500;
}

.star-rating-input .star i {
    display: none;
}

.star-rating-input .star:focus {
    outline: 2px solid #ff9500;
    outline-offset: 2px;
    border-radius: 4px;
}

.star-rating-input.voted .star {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   ALREADY VOTED MESSAGE
   ============================================ */

.rating-already-voted {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.rating-already-voted p,
.rating-already-voted .already-voted-message {
    margin: 0;
    color: #c62828 !important;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */

.form__submit-wrapper,
.casino-form__submit-wrapper {  /* BACKWARD COMPATIBILITY */
    /* Wrapper для кнопки с выравниванием */
}

.form__submit,
.casino-form__submit {  /* BACKWARD COMPATIBILITY */
    align-self: flex-start;
    margin-top: 4px;
}

/* Состояние отправки */
.form.submitting .form__submit,
.casino-form.submitting .casino-form__submit {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}

.form.submitting .form__submit::after,
.casino-form.submitting .casino-form__submit::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ============================================
   FEEDBACK MESSAGES
   ============================================ */

.form__feedback,
.casino-form__feedback {  /* BACKWARD COMPATIBILITY */
    padding: 16px 20px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 6px;
    animation: slideDown 0.4s ease;
}

.form__success,
.casino-form__success {  /* BACKWARD COMPATIBILITY */
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #2e7d32 !important;
}

.form__error,
.casino-form__error {  /* BACKWARD COMPATIBILITY */
    padding: 16px 20px;
    background: #ffebee;
    border-left: 4px solid #f44336;
    border-radius: 6px;
    animation: slideDown 0.4s ease;
}

.form__error-text,
.casino-form__error-text {  /* BACKWARD COMPATIBILITY */
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #c62828 !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .form-block-title {
        font-size: 24px;
    }
    
    .form-image {
        max-width: 100%;
    }
    
    .form-block,
    .casino-form-block {
        padding: 20px;
    }
    
    .form__average-rating,
    .casino-form__average-rating {
        gap: 10px;
        padding: 14px 16px;
    }
    
    .average-stars .star {
        font-size: 16px;
    }
    
    .average-rating-value {
        font-size: 16px;
    }
    
    .star-rating-input .star {
        font-size: 16px;
    }
    
    .form__submit,
    .casino-form__submit {
        width: 100%;
        align-self: stretch;
    }
}

@media (max-width: 480px) {
    .form-block-title {
        font-size: 20px;
    }
    
    .form-block,
    .casino-form-block {
        padding: 15px;
    }
    
    .form__average-rating,
    .casino-form__average-rating {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    
    .average-stars .star {
        font-size: 14px;
    }
    
    .average-rating-value {
        font-size: 14px;
    }
    
    .rating-already-voted {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .star-rating-input {
        gap: 2px;
    }
    
    .star-rating-input .star {
        font-size: 14px;
    }
    
    .form__input,
    .casino-form__input,
    .form__textarea,
    .casino-form__textarea {
        font-size: 14px;
        padding: 10px 14px;
    }
}
