/**
 * Tutor Review Manager - Frontend Styles
 * Version: 1.0.0
 */

/* Reviews Container */
.trm-reviews-container {
    padding: 20px 0;
    margin: 20px 0;
    position: relative;
}

/* Header with View All Button */
.trm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 10px;
}

.trm-title {
    font-size: 24px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0;
}

.trm-view-all {
    background: #FF166E;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.trm-view-all:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.trm-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Slider Wrapper */
.trm-slider-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    perspective: 1000px;
}

.trm-slider {
    position: relative;
    width: 100%;
    min-height: 200px;
}

/* Review Card - Smooth Slider Animation */
.trm-review-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%) scale(0.95);
    transition: all 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1;
}

.trm-review-card.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: translateX(0) scale(1);
    z-index: 10;
}

.trm-review-card.slide-out-left {
    transform: translateX(-100%) scale(0.95);
    opacity: 0;
    z-index: 5;
}

.trm-review-card.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    z-index: 10;
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%) scale(0.95);
        opacity: 0;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
        visibility: visible;
    }
}

/* Card Inner - Contains All Content */
.trm-card-inner {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 20px;
    align-items: flex-start;
    min-height: 180px;
}

/* Review Avatar */
.trm-review-avatar {
    flex-shrink: 0;
}

.trm-review-avatar img {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
}

/* Review Content */
.trm-review-content {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.trm-review-header {
    margin-bottom: 12px;
}

.trm-review-author {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
}

/* Course Name */
.trm-course-name {
    margin: 8px 0 12px;
}

.trm-course-name a {
    font-size: 14px;
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.trm-course-name a:hover {
    text-decoration: underline;
}

/* Review Text */
.trm-review-text {
    margin: 12px 0;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    word-break: break-word;
}

/* Review Date */
.trm-review-date {
    font-size: 13px;
    color: #999;
    margin-top: 12px;
}

/* All Reviews Modal */
/* View All button click karne par ye modal popup hota hai */
.trm-all-reviews {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FFDEF5; /* Modal overlay background color - Change karein: rgba(R, G, B, opacity) */
    z-index: 999999;
    overflow-y: auto;
    padding: 40px 20px;
}

/* Modal Title Styling */
.trm-all-reviews h3 {
    color: #000000; /* Title text color - Change karein jaise: #000, red, blue etc. */
    text-align: center;
    margin: 0 0 30px;
    font-size: 28px;
}

/* Close Button (X button upper right corner) */
.trm-close-all {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff; /* Close button background - Change karein */
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #333; /* X icon color - Change karein */
    z-index: 10;
    transition: all 0.3s ease;
}

/* Close Button Hover Effect */
.trm-close-all:hover {
    background: #f44336; /* Hover background color - Change karein */
    color: #fff; /* Hover icon color - Change karein */
    transform: rotate(90deg);
}

/* All Reviews Grid - Modal ke andar reviews ki grid layout */
.trm-all-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Individual Review Card in Modal */
.trm-review-card-mini {
    background: #fff; /* Review card background color - Change karein jaise: #f0f0f0, lightblue etc. */
    border-radius: 8px; /* Card corners ka roundness */
    padding: 20px; /* Card ke andar ka space */
    display: flex;
    gap: 15px;
}

/* Modal ke andar review card ka avatar */
.trm-review-card-mini .trm-review-avatar img {
    width: 50px;
    height: 50px;
}

/* Review content area in modal */
.trm-review-card-mini .trm-review-content {
    flex: 1;
}

/* Author name in modal review cards */
.trm-review-card-mini .trm-review-author {
    font-size: 16px;
    margin-bottom: 8px;
    color: #1e1e1e; /* Author name color - Change karein */
}

/* Review text in modal */
.trm-review-card-mini .trm-review-text {
    font-size: 14px;
    line-height: 1.6;
    margin: 10px 0;
    color: #333; /* Review text color - Change karein */
}

/* Review date in modal */
.trm-review-card-mini .trm-review-date {
    font-size: 12px;
    color: #999; /* Date color - Change karein */
}

/* Course name link in modal */
.trm-review-card-mini .trm-course-name {
    margin: 5px 0;
    font-size: 13px;
}

.trm-review-card-mini .trm-course-name a {
    color: #0073aa; /* Course link color - Change karein */
}

/* No Reviews */
.trm-no-reviews-wrapper {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.trm-no-reviews {
    text-align: center;
    color: #666;
    font-size: 18px;
    margin-bottom: 10px;
}

.trm-no-reviews-hint {
    text-align: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 15px;
}

.trm-debug-tip {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* Debug Info */
.trm-debug-info {
    background: #f0f0f0;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
}

.trm-debug-info h4 {
    margin-top: 0;
    color: #333;
}

.trm-debug-info ul {
    margin: 5px 0;
    padding-left: 20px;
}

/* Modal Styles */
.trm-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

.trm-modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.3); /* Light pink transparent */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.trm-modal-content {
    position: relative !important;
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 100px rgba(255, 22, 110, 0.2);
    animation: trmSlideUp 0.3s ease;
    z-index: 10 !important;
    margin: auto !important;
}

@keyframes trmSlideUp {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.trm-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.trm-modal-header h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #1e1e1e;
}

.trm-modal-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* Review Form */
.trm-review-form {
    padding: 30px;
}

.trm-form-group {
    margin-bottom: 25px;
}

.trm-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #1e1e1e;
    font-size: 14px;
}

/* Rating Input */
.trm-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}

.trm-rating-input input[type="radio"] {
    display: none;
}

.trm-rating-input label {
    cursor: pointer;
    font-size: 32px;
    color: #ddd;
    transition: all 0.2s ease;
    margin: 0;
}

.trm-rating-input input[type="radio"]:checked ~ label,
.trm-rating-input label:hover,
.trm-rating-input label:hover ~ label {
    color: #ffa500;
    transform: scale(1.1);
}

/* Textarea */
.trm-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.trm-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Form Actions */
.trm-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.trm-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trm-btn-primary {
    background: #0073aa;
    color: #fff;
}

.trm-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.trm-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Form Notice */
.trm-form-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.trm-form-notice p {
    margin: 0;
    font-size: 14px;
    color: #856404;
}

/* Mandatory Modal Specific Styling */
.trm-modal-mandatory {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.trm-modal-mandatory .trm-modal-overlay {
    background: rgba(0, 0, 0, 0.4); /* Slightly more visible for mandatory */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: not-allowed;
}

.trm-modal-mandatory .trm-modal-content {
    border: 3px solid #FF166E;
    box-shadow: 0 15px 60px rgba(255, 22, 110, 0.5);
    margin: auto !important;
}

.trm-notice-mandatory {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.trm-notice-mandatory p {
    margin: 5px 0;
    font-size: 14px;
    color: #856404;
}

.trm-notice-mandatory strong {
    color: #FF166E; /* Match with background */
    font-size: 15px;
}

/* Shake animation for mandatory notice */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* Responsive Design for All Screen Sizes */
@media (max-width: 768px) {
    .trm-modal {
        padding: 10px !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .trm-modal-content {
        max-width: 100%;
        width: calc(100% - 20px);
        max-height: calc(100vh - 40px);
        border-radius: 8px;
        margin: auto !important;
    }
    
    .trm-modal-header {
        padding: 20px 15px 15px;
    }
    
    .trm-modal-header h3 {
        font-size: 20px;
    }
    
    .trm-modal-header p {
        font-size: 13px;
    }
    
    .trm-review-form {
        padding: 20px 15px;
    }
    
    .trm-rating-input label {
        font-size: 28px;
    }
    
    .trm-form-group textarea {
        font-size: 14px;
    }
    
    .trm-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .trm-form-notice, .trm-notice-mandatory {
        padding: 15px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .trm-modal {
        padding: 5px !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .trm-modal-content {
        border-radius: 6px;
        width: calc(100% - 10px);
        margin: auto !important;
    }
    
    .trm-modal-header h3 {
        font-size: 18px;
    }
    
    .trm-rating-input label {
        font-size: 24px;
        gap: 3px;
    }
    
    .trm-rating-input {
        gap: 3px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .trm-modal-content {
        max-width: 550px;
    }
}

@media (min-width: 1025px) {
    .trm-modal-content {
        max-width: 600px;
    }
}

/* Form Message */
.trm-form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    display: none;
    font-size: 14px;
}

.trm-form-message.success {
    display: block;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.trm-form-message.error {
    display: block;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .trm-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .trm-title {
        font-size: 20px;
    }
    
    .trm-view-all {
        width: 100%;
        justify-content: center;
    }
    
    .trm-card-inner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .trm-review-avatar {
        margin: 0 auto;
    }
    
    .trm-all-reviews {
        padding: 20px 10px;
    }
    
    .trm-all-reviews h3 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .trm-all-reviews-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .trm-review-card-mini {
        flex-direction: column;
        text-align: center;
    }
    
    .trm-review-card-mini .trm-review-avatar {
        margin: 0 auto;
    }
    
    .trm-close-all {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .trm-all-reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Loading State */
.trm-loading {
    text-align: center;
    padding: 40px 20px;
}

.trm-loading::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: trmSpin 1s linear infinite;
}

@keyframes trmSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
