/* Rate Order Page Styles */

.rate-order-page {
    background-color: #F5F0ED;
    padding: 3rem 0 5rem 0;
}

/* Header Styles */
.rate-order__header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.rate-order__header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.rate-order__header p {
    color: #736C64;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.rate-order__subtitle {
    color: #525252 !important;
    font-size: 0.9375rem !important;
    margin-top: 0.5rem !important;
}

/* Error/Success States */
.rate-order__error,
.rate-order__success {
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 700px;
    margin: 0 auto;
}

.rate-order__error .error-icon,
.rate-order__success .success-icon {
    margin-bottom: 1.5rem;
}

.rate-order__error .error-icon svg {
    color: #BE1F17;
}

.rate-order__success .success-icon svg {
    color: #5BAF89;
}

.rate-order__error h2,
.rate-order__success h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 0.75rem;
}

.rate-order__error p,
.rate-order__success p {
    color: #525252;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto 1.5rem auto;
}

/* Form Wrapper */
.rate-order__form-wrapper {
    background: #fff;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 700px;
    margin: 0 auto;
}

@media screen and (max-width: 768px) {
    .rate-order__form-wrapper {
        padding: 1.25rem;
    }
}

/* Products List */
.rate-order__products {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Single Product Card */
.rate-order__product {
    background: #F5F0ED;
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid #E5D9D2;
}

@media screen and (max-width: 768px) {
    .rate-order__product {
        padding: 1rem;
    }
}

.product-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5D9D2;
}

.product-image {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 0.375rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-image .no-image {
    font-size: 0.75rem;
    color: #A49B93;
    text-align: center;
}

.product-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    margin: 0;
}

/* Form Groups */
.product-review-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Rating and Images in one row - two columns */
.product-review-form .rating-images-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media screen and (max-width: 480px) {
    .product-review-form .rating-images-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #222;
}

.form-group label .required {
    color: #BE1F17;
}

.form-group label .optional {
    color: #A49B93;
    font-weight: 400;
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #D3CEC9;
    border-radius: 0.375rem;
    font-size: 1rem;
    color: #222;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ea631b;
    box-shadow: 0 0 0 3px rgba(234, 99, 27, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #A49B93;
}

.help-text {
    font-size: 0.8125rem;
    color: #736C64;
    margin-top: 0.25rem;
}

/* Star Rating Input */
.rating-group {
    gap: 0.75rem !important;
}

.star-rating-input {
    display: flex;
    gap: 0.25rem;
}

.star-rating-input .star {
    cursor: pointer;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-rating-input .star:hover {
    transform: scale(1.1);
}

.star-rating-input .star:focus {
    outline: 2px solid #ea631b;
    outline-offset: 2px;
    border-radius: 2px;
}

.star-rating-input .star svg path {
    transition: fill 0.15s ease, stroke 0.15s ease;
}

.star-rating-input .star.active svg path,
.star-rating-input .star.hover svg path {
    fill: #F1B30E;
    stroke: #F1B30E;
}

.rating-text {
    font-size: 0.875rem;
    color: #525252;
    min-height: 1.25rem;
}

/* Image Upload */
.image-upload-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

.image-upload-input {
    display: none;
}

.image-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #fff;
    border: 1px dashed #D3CEC9;
    border-radius: 0.375rem;
    color: #525252;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.image-upload-btn:hover {
    border-color: #ea631b;
    background-color: rgba(234, 99, 27, 0.05);
}

.image-upload-btn svg {
    width: 20px;
    height: 20px;
    color: #736C64;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.image-preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid #E5D9D2;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item .remove-image {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.image-preview-item .remove-image:hover {
    background: rgba(190, 31, 23, 0.9);
}

/* Signature Section */
.rate-order__signature {
    margin-top: 1.5rem;
}

/* Form Actions */
.form-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
    font-family: inherit;
}

.btn--primary {
    background-color: #ea631b;
    color: #fff;
}

.btn--primary:hover {
    background-color: #D95701;
}

.btn--primary:active {
    transform: scale(0.98);
}

.btn--large {
    padding: 1rem 2.5rem;
    font-size: 1.0625rem;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading Spinner */
.btn .spinner {
    animation: rotate 2s linear infinite;
    width: 20px;
    height: 20px;
}

.btn .spinner .path {
    stroke: #fff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Validation Styles */
.form-group.has-error input,
.form-group.has-error textarea {
    border-color: #BE1F17;
}

.form-group.has-error .star-rating-input {
    padding: 0.25rem;
    border: 2px solid #BE1F17;
    border-radius: 0.25rem;
    margin: -0.25rem;
}

.error-message {
    color: #BE1F17;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Animation for success */
.rate-order__success {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media screen and (max-width: 576px) {
    .rate-order-page {
        padding: 1rem 0 2rem 0;
    }
    
    .rate-order__header h1 {
        font-size: 1.5rem;
    }
    
    .product-image {
        width: 50px;
        height: 50px;
    }
    
    .star-rating-input .star svg {
        width: 24px;
        height: 24px;
    }
    
    .btn--large {
        width: 100%;
        padding: 0.875rem 1.5rem;
    }
    
    .form-actions {
        margin-top: 1.5rem;
    }
}
