/* includes/review_modal.php — винесено з inline <style> 20260908_2104 */
/* Review Modal */
.review-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.review-modal-content {
    background: var(--white);
    margin: 20px auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
    position: relative;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
    background: var(--white);
    border-radius: 12px 12px 0 0;
}

.review-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--black);
}

.review-modal-close {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-gray);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
}

.review-modal-close:hover {
    color: var(--black);
    background: #f8f9fa;
}

.review-modal-form {
    padding: 25px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Адаптивна сітка форми */
.modal-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.modal-form-group label {
    font-weight: 600;
    color: var(--black);
    font-size: 14px;
}

.modal-form-group input,
.modal-form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-family: inherit;
    background: var(--white);
}

.modal-form-group input:focus,
.modal-form-group textarea:focus {
    outline: none;
    border-color: var(--black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Modal Rating */
.rating-group-modal {
    margin-bottom: 25px;
}

.modal-rating-input {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.modal-rating-input input[type="radio"] {
    display: none;
}

.modal-star-label {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
}

.star-svg {
    width: 36px;
    height: 36px;
    color: #ddd;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Стани зірочок */
.modal-rating-input input[type="radio"]:checked + .modal-star-label .star-svg {
    color: #ffd700;
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.3));
}

.modal-star-label:hover {
    background: rgba(255, 215, 0, 0.1);
}

.modal-star-label:hover .star-svg {
    color: #ffd700;
    transform: scale(1.15);
    filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.4));
}

/* Rating Error Message */
.rating-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: errorShake 0.5s ease-in-out;
}

.rating-error-message::before {
    content: "⚠️";
    font-size: 16px;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Modal Form Buttons */
.modal-form-buttons {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.modal-submit-btn {
    background: var(--black);
    color: var(--white);
    border: 2px solid var(--black);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
}

.modal-submit-btn:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-submit-btn:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* МОБІЛЬНА АДАПТАЦІЯ */
@media (max-width: 768px) {
    .review-modal-content {
        width: 95%;
        margin: 10px auto;
        border-radius: 16px;
        max-height: calc(100vh - 20px);
    }
    
    .review-modal-header {
        padding: 15px 20px;
    }
    
    .review-modal-header h3 {
        font-size: 20px;
    }
    
    .review-modal-form {
        padding: 20px;
        max-height: calc(100vh - 100px);
    }
    
    .modal-form-buttons {
        justify-content: center;
    }
    
    .modal-submit-btn {
        width: 100%;
        max-width: 300px;
        padding: 16px 20px;
        font-size: 16px;
        min-height: 52px;
    }
    
    .star-svg {
        width: 32px;
        height: 32px;
    }
    
    .modal-rating-input {
        gap: 6px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .review-modal-content {
        width: 98%;
        margin: 5px auto;
        border-radius: 12px;
    }
    
    .star-svg {
        width: 28px;
        height: 28px;
    }
    
    .modal-rating-input {
        gap: 4px;
    }
    
    .modal-form-group input,
    .modal-form-group textarea {
        font-size: 16px;
    }
}

/* ПОКРАЩЕННЯ ДЛЯ iOS */
@supports (-webkit-touch-callout: none) {
    .review-modal {
        -webkit-overflow-scrolling: touch;
    }
    
    .review-modal-form {
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-form-group input,
    .modal-form-group textarea {
        -webkit-appearance: none;
        border-radius: 8px;
    }
}
