/**
 * Popup Modal Styles
 */

/* Overlay */
.wer-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wer-popup-overlay.active {
    opacity: 1;
}

/* Container */
.wer-popup-container {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px 30px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.wer-popup-overlay.active .wer-popup-container {
    transform: scale(1);
}

/* Close Button */
.wer-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 5px 10px;
    transition: color 0.2s;
}

.wer-popup-close:hover {
    color: #333;
}

/* Initial Prompt */
.wer-popup-prompt {
    text-align: center;
}

.wer-popup-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.wer-popup-prompt h2 {
    margin: 0 0 15px;
    font-size: 24px;
    color: #333;
}

.wer-popup-message {
    font-size: 16px;
    color: #666;
    margin: 0 0 10px;
}

.wer-popup-subtext {
    font-size: 14px;
    color: #999;
    margin: 0 0 30px;
}

.wer-popup-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Buttons */
.wer-btn-primary {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.wer-btn-primary:hover {
    background: #005a87;
}

.wer-btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.wer-btn-secondary:hover {
    background: #e5e5e5;
    border-color: #ccc;
}

/* Loading */
.wer-form-loading {
    text-align: center;
    padding: 40px 20px;
}

.wer-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: wer-spin 1s linear infinite;
}

@keyframes wer-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Review Form */
.wer-review-form {
    animation: slideInUp 0.3s ease;
}

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

.wer-progress-indicator {
    margin-bottom: 20px;
    text-align: center;
}

.wer-progress-text {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.wer-progress-bar {
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
}

.wer-progress-fill {
    height: 100%;
    background: #0073aa;
    transition: width 0.3s ease;
}

/* Product Info */
.wer-product-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.wer-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

.wer-product-name {
    font-size: 18px;
    margin: 0;
    color: #333;
}

/* Form Groups */
.wer-form-group {
    margin-bottom: 20px;
}

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

.wer-required {
    color: #d00;
}

.wer-optional {
    font-weight: normal;
    color: #999;
}

/* Star Rating */
.wer-star-rating {
    display: flex;
    gap: 8px;
    font-size: 32px;
    cursor: pointer;
    user-select: none;
}

.wer-star {
    color: #ddd;
    transition: color 0.2s;
}

.wer-star.active,
.wer-star:hover,
.wer-star.hovered {
    color: #ffa500;
}

/* Input Fields */
.wer-input,
.wer-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.wer-input:focus,
.wer-textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.wer-textarea {
    resize: vertical;
    min-height: 100px;
}

.wer-char-count {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* Error Messages */
.wer-error {
    display: block;
    color: #d00;
    font-size: 13px;
    margin-top: 5px;
}

/* Form Actions */
.wer-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.wer-btn-skip {
    background: none;
    color: #666;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.wer-btn-skip:hover {
    color: #333;
}

.wer-btn-submit {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.wer-btn-submit:hover {
    background: #005a87;
}

.wer-btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.wer-form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.wer-form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wer-form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Success Message */
.wer-popup-success {
    text-align: center;
    padding: 20px;
}

.wer-success-icon {
    width: 60px;
    height: 60px;
    background: #28a745;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
}

.wer-popup-success h3 {
    margin: 0 0 10px;
    font-size: 22px;
    color: #333;
}

.wer-success-subtext {
    font-size: 14px;
    color: #666;
    margin: 0 0 25px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wer-popup-container {
        padding: 30px 20px 20px;
        max-height: 95vh;
    }

    .wer-popup-prompt h2 {
        font-size: 20px;
    }

    .wer-popup-actions {
        flex-direction: column;
    }

    .wer-btn-primary,
    .wer-btn-secondary {
        width: 100%;
    }

    .wer-star-rating {
        font-size: 28px;
        justify-content: center;
    }

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

    .wer-btn-submit,
    .wer-btn-skip {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .wer-popup-container {
        width: 95%;
        padding: 25px 15px 15px;
    }

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

/* Orders Page Review Button */
a[href^="#review-order-"],
.wer-review-order-btn {
    display: inline-block;
    padding: 8px 16px !important;
    background: #ff6c00 !important;
    color: #fff !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
    line-height: 1.5 !important;
}

a[href^="#review-order-"]:hover,
.wer-review-order-btn:hover {
    background: #e55f00 !important;
    color: #fff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(255, 108, 0, 0.3) !important;
}
