/* ═══════════════════════════════════════════════════════════════════════════ */
/* Review Rating Modal Styles */
/* ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --review-primary-color: #009981;
    --review-text-main: #191919;
    --review-text-secondary: #64748B;
    --review-text-placeholder: #C8C8C8;
    --review-border-color: #EAEBF0;
    --review-bg-body: #F2F2F6;
    --review-white: #FFFFFF;
    --review-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.1);
    --review-shadow-footer: 4px 1px 8px 0px rgba(71, 82, 99, 0.25);
}

/* Modal Container */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Modal Overlay (backdrop) */
.review-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Modal Main Container */
.review-modal-container {
    width: 100%;
    max-width: 595px;
    background: var(--review-white);
    border-radius: 12px;
    box-shadow: var(--review-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    animation: reviewModalSlideIn 0.3s ease-out;
}

@keyframes reviewModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.review-modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.6px solid var(--review-border-color);
    flex-shrink: 0;
}

.review-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--review-text-main);
    line-height: 1.4;
    margin: 0;
}

/* Close Button */
.review-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A8A8A8;
    transition: color 0.2s;
    padding: 0;
}

.review-modal-close:hover {
    color: var(--review-text-main);
}

.review-modal-close svg {
    width: 24px;
    height: 24px;
}

/* Body */
.review-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Product Info */
.review-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-product-img-wrapper {
    width: 90px;
    height: 92px;
    border: 1px solid var(--review-border-color);
    border-radius: 4px;
    padding: 9px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--review-bg-body);
}

.review-product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.review-product-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--review-text-secondary);
    line-height: 1.55;
    flex: 1;
}

/* Rating Section */
.review-rating-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.review-stars {
    display: flex;
    gap: 16px;
}

.review-star {
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: #EAEBF0;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.review-star:hover {
    transform: scale(1.1);
}

.review-star.active {
    color: #EFA22F;
}

.review-rating-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--review-text-secondary);
    min-height: 24px;
}

/* Form Grid */
.review-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.review-full-width {
    grid-column: 1 / -1;
}

/* Input Fields */
.review-input-field {
    /*width: 100%;*/
    padding: 12px;
    border: 1px solid var(--review-border-color);
    border-radius: 6px;
    font-size: 15px;
    color: var(--review-text-main);
    outline: none;
    box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.04);
    transition: border-color 0.2s;
    font-family: inherit;
}

.review-input-field:focus {
    border-color: var(--review-primary-color);
    box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.04), 0 0 0 3px rgba(0, 153, 129, 0.1);
}

.review-input-field::placeholder {
    color: var(--review-text-placeholder);
}

/* Textarea */
.review-textarea-field {
    min-height: 106px;
    padding: 12px;
    border: 1px solid var(--review-border-color);
    border-radius: 8px;
    font-size: 15px;
    color: var(--review-text-main);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    font-size: 15px;
}

.review-textarea-field:focus {
    border-color: var(--review-primary-color);
    box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.04), 0 0 0 3px rgba(0, 153, 129, 0.1);
}

.review-textarea-field::placeholder {
    color: var(--review-text-placeholder);
}

/* Image Section */
.review-image-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-add-photo-btn {
    width: 100%;
    height: 80px;
    border: 1px dashed var(--review-border-color);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: #C7C8CC;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s, border-color 0.2s;
    background-color: var(--review-white);
    padding: 0;
}

.review-add-photo-btn:hover {
    background-color: var(--review-bg-body);
    border-color: var(--review-primary-color);
}

.review-add-photo-btn svg {
    width: 40px;
    height: 40px;
}

/* Image Preview Container */
.review-image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.review-image-preview-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--review-bg-body);
}

.review-image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: var(--review-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
}

.review-image-remove-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.review-image-remove-btn svg {
    width: 16px;
    height: 16px;
}

/* Footer */
.review-modal-footer {
    padding: 20px;
    box-shadow: var(--review-shadow-footer);
    background: var(--review-white);
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

/* Submit Button */
.review-modal-submit-btn {
    width: 100%;
    background-color: var(--review-primary-color);
    color: var(--review-white);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.review-modal-submit-btn:hover {
    opacity: 0.9;
}

.review-modal-submit-btn:active {
    transform: scale(0.98);
}

.review-modal-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.review-icon-small {
    width: 20px;
    height: 20px;
}

/* Hidden file input */
.review-file-input {
    display: none;
}

/* Error States */
.review-input-error {
    border-color: #dc2626 !important;
}

.review-error-message {
    font-size: 13px;
    color: #dc2626;
    margin-top: -8px;
}

/* Loading State */
.review-modal-submit-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .review-modal-container {
        max-width: calc(100% - 40px);
        max-height: calc(100vh - 40px);
        margin: 20px;
    }

    .review-modal-header {
        padding: 16px;
    }

    .review-modal-header h2 {
        font-size: 18px;
    }

    .review-modal-body {
        padding: 16px;
        gap: 16px;
    }

    .review-modal-footer {
        padding: 16px;
    }

    .review-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .review-product-info {
        gap: 10px;
    }

    .review-product-img-wrapper {
        width: 70px;
        height: 70px;
    }

    .review-product-name {
        font-size: 14px;
    }

    .review-stars {
        gap: 12px;
    }

    .review-star {
        width: 32px;
        height: 32px;
    }

    .review-image-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
}

@media (max-width: 480px) {
    .review-modal-container {
        max-width: calc(100% - 20px);
        margin: 10px;
    }

    .review-modal-header,
    .review-modal-body,
    .review-modal-footer {
        padding: 12px;
    }

    .review-modal-header h2 {
        font-size: 16px;
    }

    .review-modal-body {
        gap: 12px;
    }

    .review-input-field,
    .review-textarea-field {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .review-add-photo-btn {
        height: 70px;
    }

    .review-stars {
        gap: 8px;
    }

    .review-star {
        width: 28px;
        height: 28px;
    }

    .review-modal-submit-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
}
