/* Formulário de Reviews - Estilos Avançados */

/* Modal do formulário */
.review-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.review-modal.show {
    display: flex;
}

.review-modal-content {
    background: var(--bg-primary, white);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

.review-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color, #e9ecef);
}

.review-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
    margin: 0;
}

.review-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary, #6c757d);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.review-modal-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* Formulário */
.review-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary, #212529);
    font-size: 1rem;
}

.form-label.required::after {
    content: ' *';
    color: #dc2626;
}

/* Rating Interativo */
.rating-input {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.star-input {
    width: 32px;
    height: 32px;
    cursor: pointer;
    background-image: url('../../assets/icons/star.svg');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3;
    transition: all 0.3s ease;
    position: relative;
}

.star-input:hover,
.star-input.active {
    opacity: 1;
    background-image: url('../../assets/icons/star-filled.svg');
    filter: brightness(0) saturate(100%) invert(64%) sepia(98%) saturate(3207%) hue-rotate(130deg);
    transform: scale(1.1);
}

.star-input:hover ~ .star-input {
    opacity: 0.3;
    background-image: url('../../assets/icons/star.svg');
    filter: none;
    transform: scale(1);
}

.rating-text {
    font-weight: 600;
    color: var(--accent-green, #00ff7f);
    font-size: 1.1rem;
    min-width: 120px;
}

/* Campos de texto */
.form-input {
    padding: 1rem;
    border: 2px solid var(--border-color, #e9ecef);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #212529);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-green, #00ff7f);
    box-shadow: 0 0 0 3px rgba(0, 255, 127, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Upload de imagens */
.image-upload-section {
    border: 2px dashed var(--border-color, #e9ecef);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary, #f8f9fa);
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-upload-section:hover {
    border-color: var(--accent-green, #00ff7f);
    background: rgba(0, 255, 127, 0.05);
}

.image-upload-section.dragover {
    border-color: var(--accent-green, #00ff7f);
    background: rgba(0, 255, 127, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.6;
}

.upload-text {
    color: var(--text-secondary, #6c757d);
    margin-bottom: 1rem;
}

.upload-text strong {
    color: var(--accent-green, #00ff7f);
}

.file-input {
    display: none;
}

.upload-button {
    background: linear-gradient(135deg, var(--accent-green, #00ff7f), var(--accent-blue, #007bff));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 127, 0.3);
}

/* Preview das imagens */
.image-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary, #f8f9fa);
    border: 2px solid var(--border-color, #e9ecef);
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-image:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Informações do produto */
.product-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.product-details h4 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    color: var(--text-primary, #212529);
}

.product-details p {
    margin: 0;
    color: var(--text-secondary, #6c757d);
    font-size: 0.9rem;
}

/* Termos e condições */
.terms-section {
    background: rgba(0, 255, 127, 0.05);
    border: 1px solid rgba(0, 255, 127, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-green, #00ff7f);
    margin-top: 2px;
}

.terms-text {
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
    line-height: 1.5;
}

.terms-text a {
    color: var(--accent-green, #00ff7f);
    text-decoration: none;
    font-weight: 600;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Botões do formulário */
.form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e9ecef);
}

.btn-cancel {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color, #e9ecef);
    background: transparent;
    color: var(--text-secondary, #6c757d);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    border-color: #dc2626;
    color: #dc2626;
}

.btn-submit {
    flex: 2;
    padding: 1rem;
    border: none;
    background: linear-gradient(135deg, var(--accent-green, #00ff7f), var(--accent-blue, #007bff));
    color: white;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 127, 0.3);
}

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

/* Loading state */
.btn-submit.loading {
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Contador de caracteres */
.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-secondary, #6c757d);
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.error {
    color: #dc2626;
}

/* Rating descriptions */
.rating-descriptions {
    margin-top: 0.5rem;
}

.rating-description {
    font-size: 0.9rem;
    color: var(--text-secondary, #6c757d);
    font-style: italic;
}

/* Validação de formulário */
.form-input.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.error-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.success-message {
    color: #10b981;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}


/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsividade */
@media (max-width: 768px) {
    .review-modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-height: 95vh;
    }

    .rating-input {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .star-input {
        width: 28px;
        height: 28px;
    }

    .form-actions {
        flex-direction: column;
    }

    .image-previews {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .product-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .review-modal-content {
        width: 95%;
        padding: 1rem;
    }

    .review-modal-title {
        font-size: 1.25rem;
    }

    .star-input {
        width: 24px;
        height: 24px;
    }

    .upload-icon {
        width: 32px;
        height: 32px;
    }
}

/* Dark mode support */
[data-theme="dark"] .review-modal {
    background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .review-modal-content {
    background: var(--bg-primary);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .image-upload-section:hover {
    background: rgba(0, 255, 127, 0.1);
}

[data-theme="dark"] .terms-section {
    background: rgba(0, 255, 127, 0.1);
    border-color: rgba(0, 255, 127, 0.3);
}