/* Feedback System Styles for EduChat Portal */

/* Inline Feedback Widget (appears in chat as bot message) */
.inline-feedback {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin: 8px 0;
    font-family: 'Inter', sans-serif;
}

.inline-feedback .feedback-header {
    margin-bottom: 16px;
    text-align: left;
}

.inline-feedback .feedback-header strong {
    color: #2c3e50;
    font-size: 16px;
    display: block;
    margin-bottom: 4px;
}

.inline-feedback .star-rating {
    display: flex;
    gap: 4px;
    margin: 12px 0;
}

.inline-feedback .star {
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.inline-feedback .star:hover,
.inline-feedback .star.active {
    color: #ffc107;
}

.inline-feedback .star.hover {
    color: #ffc107;
}

.inline-feedback .rating-text {
    font-size: 14px;
    color: #6c757d;
    margin: 8px 0;
    font-weight: 500;
}

.inline-feedback textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin: 8px 0;
}

.inline-feedback .feedback-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.inline-feedback .btn-skip,
.inline-feedback .btn-submit {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.inline-feedback .btn-skip {
    background: #6c757d;
    color: white;
}

.inline-feedback .btn-skip:hover {
    background: #5a6268;
}

.inline-feedback .btn-submit {
    background: #007bff;
    color: white;
}

.inline-feedback .btn-submit:hover:not(:disabled) {
    background: #0056b3;
}

.inline-feedback .btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Feedback Modal */
.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: 10000;
    backdrop-filter: blur(2px);
}

.feedback-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: feedbackSlideIn 0.3s ease-out;
}

@keyframes feedbackSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Feedback Header */
.feedback-header {
    text-align: center;
    margin-bottom: 24px;
}

.feedback-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.feedback-header h3 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.feedback-header p {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
    line-height: 1.4;
}

/* Feedback Form */
.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Rating Section */
.rating-section {
    text-align: center;
}

.rating-section label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    font-size: 16px;
}

/* Star Rating */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.star {
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: inline-block;
    padding: 4px;
    border-radius: 4px;
}

.star:hover {
    color: #ffc107;
    transform: scale(1.1);
}

.star.active {
    color: #ffc107;
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
}

.star.hover {
    color: #ffc107;
    transform: scale(1.05);
}

/* Rating Text */
.rating-text {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-top: 8px;
    min-height: 24px;
    display: none;
}

/* Comment Section */
.comment-section {
    text-align: left;
}

.comment-section label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
}

.comment-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.comment-section textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.comment-section textarea::placeholder {
    color: #95a5a6;
}

.character-count-feedback {
    text-align: right;
    font-size: 12px;
    color: #95a5a6;
    margin-top: 4px;
    font-weight: 500;
}

/* Feedback Actions */
.feedback-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn-skip,
.btn-submit {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.btn-skip {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.btn-skip:hover {
    background-color: #e9ecef;
    color: #495057;
}

.btn-submit {
    background-color: #3498db;
    color: white;
    border: 2px solid #3498db;
}

.btn-submit:hover:not(:disabled) {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast-info {
    background-color: #17a2b8;
}

/* Responsive Design */
@media (max-width: 600px) {
    .feedback-content {
        padding: 24px;
        margin: 16px;
        width: calc(100% - 32px);
    }
    
    .feedback-header h3 {
        font-size: 20px;
    }
    
    .star {
        font-size: 28px;
    }
    
    .feedback-actions {
        flex-direction: column;
    }
    
    .btn-skip,
    .btn-submit {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .feedback-content {
        padding: 20px;
        margin: 12px;
        width: calc(100% - 24px);
    }
    
    .star {
        font-size: 24px;
    }
}

/* Accessibility */
.star:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.btn-skip:focus,
.btn-submit:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .star {
        border: 1px solid currentColor;
    }
    
    .star.active {
        background-color: #ffc107;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .star,
    .btn-skip,
    .btn-submit,
    .toast {
        transition: none;
    }
    
    .feedback-content {
        animation: none;
    }
}
