/* 
   Shared Review Design System
   Implementation: Compact Split Layout
   Used in: Product Details & Home Page 
*/

:root {
    --review-primary: #90090C;
    --review-bg-meta: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --review-border: #eef0f2;
    --review-text-main: #4b5563;
    --review-text-dark: #111;
}

/* Review Item with Compact 30-70 Split Layout */
.review-item.compact-split {
    display: flex;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--review-border);
    overflow: hidden;
    min-height: 300px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.review-item.compact-split:hover {
    box-shadow: 0 15px 35px rgba(144, 9, 12, 0.08);
    transform: translateY(-4px);
    border-color: rgba(144, 9, 12, 0.2);
}

/* Meta Sidebar (30%) */
.review-meta-sidebar {
    flex: 0 0 30%;
    background: var(--review-bg-meta);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-right: 1px solid var(--review-border);
    gap: 15px;
    position: relative;
}

.review-meta-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--review-primary);
    opacity: 0.7;
}

/* Content Body (70%) */
.review-content-body {
    flex: 1;
    padding: 20px 25px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reviewer-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--review-text-dark);
    margin: 0 0 2px 0;
}

.reviewer-verified {
    font-size: 11px;
    color: #ffffff;
    background: #1a7c33;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    box-shadow: 0 2px 4px rgba(26, 124, 51, 0.2);
}
    box-shadow: 0 2px 4px rgba(26, 124, 51, 0.2);
}

.review-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}
.edit-review-inline-btn {
    font-size: 11px;
    color: var(--review-primary);
    background: #fff;
    border: 1.5px solid var(--review-primary);
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-review-inline-btn:hover {
    background: var(--review-primary);
    color: #fff;
    box-shadow: 0 4px 8px rgba(144, 9, 12, 0.2);
    transform: translateY(-1px);
}

.review-stats .stars i, 
.review-stats .stars svg {
    color: #ffb800;
    fill: #ffb800;
    font-size: 14px;
}

.rating-text {
    font-size: 14px;
    font-weight: 700;
    color: #555;
    background: #f1f3f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.review-age {
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.review-subject-heading {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

.review-narrative {
    font-size: 15px;
    line-height: 1.6;
    color: var(--review-text-main);
    margin: 0;
    font-style: italic;
    transition: all 0.3s ease;
}

.review-narrative.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.review-narrative-container {
    position: relative;
    margin-bottom: 5px;
}

.read-more-btn {
    background: transparent;
    border: none;
    color: var(--review-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    margin-top: 5px;
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.read-more-btn:hover {
    color: #78070a;
    text-decoration: none;
}

/* Media Handling */
.review-media-featured {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.review-media-featured img,
.review-media-featured video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-media-featured i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.review-media-grid-2 {
    display: flex;
    gap: 8px;
    width: auto;
}

.review-thumb {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #f1f3f5;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.review-thumb:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.review-thumb img,
.review-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-video-thumb i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
    z-index: 5;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.review-media-slider-container {
    width: 100%;
    position: relative;
    padding-bottom: 10px;
}

.reviewed-product-label {
    font-size: 11px;
    color: var(--review-primary);
    background: rgba(144, 9, 12, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid rgba(144, 9, 12, 0.1);
    font-weight: 500;
}

/* Responsive Stacking */
@media (max-width: 768px) {
    .review-item.compact-split {
        flex-direction: column;
        min-height: auto;
    }

    .review-meta-sidebar {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--review-border);
        padding: 15px 20px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .review-meta-sidebar::before {
        width: 100%;
        height: 4px;
        top: 0;
        left: 0;
    }

    .review-content-body {
        padding: 20px;
    }
}

/* Review Modal & Form Styling */
#reviewModal.modal {
    z-index: 10000;
}

#reviewModal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideUpModal 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

#reviewModal .modal-header {
    background: #fff;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#reviewModal .modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--review-text-dark);
}

#reviewModal .close-modal {
    background: #f8f9fa;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

#reviewModal .close-modal:hover {
    background: var(--review-primary);
    color: #fff;
}

#reviewModal .modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-group .txt_red {
    color: var(--review-primary);
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--review-primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(144, 9, 12, 0.1);
}

/* Rating Input */
.rating-input {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.rating-stars {
    display: flex;
    gap: 6px;
}

.rating-stars i {
    font-size: 26px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-stars i.fa-solid {
    color: #ffb800;
}

.rating-stars i:hover {
    transform: scale(1.15);
}

.rating-text {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

/* Image Upload */
.image-upload-container {
    margin-top: 10px;
}

.image-upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.image-upload-area:hover {
    border-color: var(--review-primary);
    background: rgba(144, 9, 12, 0.02);
}

.image-upload-area i {
    font-size: 32px;
    color: var(--review-primary);
    margin-bottom: 12px;
    opacity: 0.8;
}

.image-upload-area p {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #334155;
}

.image-upload-area span {
    font-size: 12px;
    color: #94a3b8;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.preview-card {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.preview-card img,
.preview-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.remove-image:hover {
    background: var(--review-primary);
}

/* Modal Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.cancel-btn {
    padding: 10px 24px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    background: var(--review-primary);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 12px rgba(144, 9, 12, 0.2);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(144, 9, 12, 0.3);
    background: #78070a;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Modal Animations */
@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
    #reviewModal .modal-dialog {
        margin: 10px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .form-actions button {
        width: 100%;
    }
}
