/**
 * Reviews Form Modal Base CSS
 * Modal container, overlay, animations, close button, title
 * 
 * Premium redesign with brand tokens
 */

/* [CTX:REVIEW_FORM_MODAL:OVERLAY] */
/* Modal Overlay */
.add-review-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    box-sizing: border-box;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: none;
}

.add-review-section.show {
    display: flex;
    animation: fadeInModal var(--transition-base);
}

/* [CTX:REVIEW_FORM_MODAL:CONTENT] */
/* Modal Card */
.add-review-modal-content {
    background: var(--brand-color-surface);
    border-radius: var(--brand-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    padding: var(--space-8);
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    position: relative;
    animation: modalSlideIn var(--transition-base);
    font-family: var(--brand-font-family);
}

/* Smooth scrollbar pentru modal */
.add-review-modal-content::-webkit-scrollbar {
    width: 8px;
}

.add-review-modal-content::-webkit-scrollbar-track {
    background: var(--brand-color-surface-alt);
    border-radius: var(--brand-radius-sm);
}

.add-review-modal-content::-webkit-scrollbar-thumb {
    background: var(--brand-color-border-accent);
    border-radius: var(--brand-radius-sm);
}

.add-review-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--brand-color-border);
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.add-review-modal-close {
    background: var(--brand-color-surface-alt);
    border: none;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--brand-color-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
}

.add-review-modal-close:hover {
    background: var(--brand-color-secondary-sand);
    color: var(--brand-color-primary-600);
    transform: scale(1.08);
}

.add-review-modal-close:active {
    transform: scale(0.98);
}

.add-review-modal-close:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Modal header: title left, close right */
.review-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.review-modal-header h3,
.review-modal-header .order-review-modal-title {
    margin: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
    font-size: var(--font-size-3xl);
    font-weight: 600;
    color: var(--brand-text-color-headers);
    font-family: var(--brand-font-family);
    line-height: 1.3;
}

/* Legacy title fallback outside header */
.add-review-section h3:not(.order-review-modal-title) {
    font-size: var(--font-size-3xl);
    font-weight: 600;
    color: var(--brand-text-color-headers);
    margin: 0 0 var(--space-4) 0;
    padding-right: 48px;
    font-family: var(--brand-font-family);
    line-height: 1.3;
}

/* [CTX:REVIEW_FORM_MODAL:PRODUCT_REWARDS] */
/* Product card displayed inside the review modal */
.review-modal-product-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    background: var(--brand-color-surface);
    border: 1px solid var(--brand-color-border-subtle);
    border-radius: var(--brand-radius-sm);
    box-shadow: var(--shadow-card);
}

.review-modal-product-card__image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--brand-radius-sm);
    flex-shrink: 0;
}

.review-modal-product-card__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.review-modal-product-card__label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--brand-text-color-muted);
}

.review-modal-product-card__title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    line-height: 1.35;
    color: var(--brand-text-color-headers);
}

/* Review points breakdown shown below the product card */
.review-points-breakdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    padding: var(--space-3);
    background: var(--brand-color-surface-sand);
    border: 1px solid var(--brand-color-border-sand);
    border-radius: var(--brand-radius-sm);
}

.review-points-breakdown__item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: 0;
    text-align: center;
    color: var(--brand-text-color-body);
    font-size: var(--font-size-base);
    line-height: 1.35;
}

.review-points-breakdown__item + .review-points-breakdown__item {
    padding-left: var(--space-3);
    border-left: 1px solid var(--brand-color-border-subtle);
}

.review-points-breakdown__item strong,
.review-points-breakdown__points {
    color: var(--brand-text-color-headers);
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: 1.2;
}

.review-points-breakdown__copy {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-1);
    min-width: 0;
    text-align: center;
}

.review-points-breakdown__label {
    font-weight: 500;
    color: var(--brand-text-color-body);
    line-height: 1.35;
}

.review-points-breakdown__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--space-8);
    height: var(--space-8);
    color: var(--brand-color-primary);
    background: var(--brand-color-surface);
    border: 1px solid var(--brand-color-border-accent);
    border-radius: var(--brand-radius-lg);
    flex-shrink: 0;
}

.review-points-breakdown__icon svg {
    width: var(--space-8);
    height: var(--space-8);
}

/* Legacy review points eligibility prompt (kept for fallback markup) */
.add-review-points-prompt {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--brand-text-color-headers);
    margin: calc(-1 * var(--space-2)) 0 var(--space-4) 0;
    padding: var(--space-3) var(--space-4);
    line-height: 1.4;
    background: var(--brand-color-surface-sand);
    border-radius: var(--brand-radius-lg);
    border: 1px solid var(--brand-color-border-sand);
}

/* [CTX:REVIEW_FORM_MODAL:RESPONSIVE] */
/* =====================================================================
   RESPONSIVE
   ===================================================================== */

@media (max-width: 768px) {
    .add-review-section {
        padding: var(--space-3);
    }
    
    .add-review-modal-content {
        padding: var(--space-6);
        max-height: 92vh;
        border-radius: var(--brand-radius-lg);
    }
    
    .add-review-section h3,
    .review-modal-header h3,
    .review-modal-header .order-review-modal-title {
        font-size: var(--font-size-2xl);
        margin-bottom: 0;
    }

    .review-modal-product-card {
        gap: var(--space-3);
        padding: var(--space-3);
    }

    .review-modal-product-card__image {
        width: 60px;
        height: 60px;
    }

    .review-modal-product-card__title {
        font-size: var(--font-size-base);
    }

    .review-points-breakdown {
        gap: var(--space-1);
        padding: var(--space-2);
    }

    .review-points-breakdown__item {
        flex-direction: row;
        align-items: center;
        gap: var(--space-2);
    }

    .review-points-breakdown__item + .review-points-breakdown__item {
        padding-left: var(--space-2);
    }

    .review-points-breakdown__copy {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .review-points-breakdown__points {
        font-size: var(--font-size-lg);
    }

    .review-points-breakdown__label {
        font-size: var(--font-size-sm);
    }

    .review-points-breakdown__icon {
        width: 45px;
        height: 45px;
    }
    
    .add-review-modal-close {
        width: 38px;
        height: 38px;
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .add-review-section {
        padding: var(--space-2);
    }
    
    .add-review-modal-content {
        padding: var(--space-5);
        max-height: 94vh;
    }
    
    .add-review-section h3,
    .review-modal-header h3,
    .review-modal-header .order-review-modal-title {
        font-size: var(--font-size-xl);
        margin-bottom: 0;
    }

    .add-review-modal-close {
        width: 36px;
        height: 36px;
    }
}
