/* ===== AMPLITUDE SURVEY MODAL STYLES ===== */

/* Modal Container */
.survey-modal {
    position: fixed !important;
    z-index: 999999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.survey-modal[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Modal Content */
.survey-modal-content {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    width: 90% !important;
    max-width: 360px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    overflow: hidden !important;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.survey-modal.show .survey-modal-content {
    transform: scale(1.02);
}

/* Header */
.survey-header {
    background-color: #ffffff !important;
    padding: 20px !important;
    position: relative !important;
    border-bottom: 1px solid #f0f0f0;
}

.survey-header h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    line-height: 1.4;
}

.survey-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    color: #999999 !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 4px !important;
    border-radius: 4px;
    transition: all 0.2s ease;
    user-select: none;
}

.survey-close:hover {
    color: #666666 !important;
    background-color: #f5f5f5;
    transform: scale(1.1);
}

/* Body */
.survey-body {
    padding: 0 20px 20px 20px !important;
}

.survey-body p {
    margin: 0 0 20px 0 !important;
    color: #666666 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* Questions */
.survey-question {
    margin-bottom: 20px !important;
}

.survey-question label {
    display: block !important;
    margin-bottom: 12px !important;
    font-weight: 500 !important;
    color: #333333 !important;
    font-size: 14px !important;
}

/* Rating Emojis */
.rating-emojis {
    display: flex !important;
    justify-content: space-between !important;
    margin: 0 0 20px 0 !important;
    padding: 0 10px !important;
    gap: 8px;
}

.emoji-option {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    border: 2px solid #e5e5e5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    background-color: transparent !important;
    transition: all 0.3s ease !important;
    padding: 2px !important;
    position: relative;
}

.emoji-option:hover {
    border-color: #cccccc !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.emoji-option.selected {
    border-color: #efa943 !important;
    background-color: rgba(239, 169, 67, 0.1) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(239, 169, 67, 0.3);
}

.emoji-option.selected svg path {
    stroke: #efa943 !important;
}

.emoji-option.selected svg path[fill="#354259"] {
    fill: #efa943 !important;
}

.emoji-option svg {
    width: 36px !important;
    height: 36px !important;
    display: block !important;
    transition: all 0.2s ease;
}

/* Text Areas */
.survey-message, 
.improvement-message {
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    background-color: #fafafa !important;
    box-sizing: border-box !important;
    min-height: 70px !important;
    resize: vertical !important;
    outline: none !important;
    font-family: inherit !important;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.survey-message:focus, 
.improvement-message:focus {
    border-color: #1cb0f6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.1);
}

.survey-message::placeholder,
.improvement-message::placeholder {
    color: #999999;
    opacity: 1;
}

/* Actions */
.survey-actions {
    display: flex !important;
    gap: 10px !important;
    margin-top: 20px !important;
}

.survey-skip, 
.survey-submit {
    flex: 1 !important;
    padding: 12px 20px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}

.survey-skip {
    background-color: #f0f0f0 !important;
    color: #666666 !important;
    border: 1px solid #e0e0e0 !important;
}

.survey-skip:hover {
    background-color: #e5e5e5 !important;
    transform: translateY(-1px);
}

.survey-submit {
    background-color: #1cb0f6 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border: 1px solid #1cb0f6 !important;
}

.survey-submit:hover {
    background-color: #0ea5e9 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(28, 176, 246, 0.3);
}

.survey-submit:disabled,
.survey-submit.loading {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #cccccc !important;
    border-color: #cccccc !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Success Message */
.survey-success {
    text-align: center !important;
    padding: 30px 20px !important;
}

.survey-success h4 {
    color: #1cb0f6 !important;
    margin-bottom: 12px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-top: 0;
}

.survey-success p {
    color: #666666 !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.4;
}

/* Error Message */
.survey-error {
    color: #d32f2f !important;
    background: #ffebee !important;
    padding: 10px !important;
    border-radius: 4px !important;
    margin-bottom: 15px !important;
    font-size: 14px !important;
    border-left: 4px solid #d32f2f;
    animation: slideInDown 0.3s ease;
}

/* Body Class When Modal Open */
body.survey-modal-open {
    overflow: hidden !important;
}

/* Loading Animation */
.survey-submit.loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .survey-modal-content {
        width: 95% !important;
        max-width: none !important;
        margin: 10px;
    }
    
    .survey-header {
        padding: 16px !important;
    }
    
    .survey-body {
        padding: 0 16px 16px 16px !important;
    }
    
    .rating-emojis {
        padding: 0 5px !important;
        gap: 4px;
    }
    
    .emoji-option {
        width: 40px !important;
        height: 40px !important;
    }
    
    .emoji-option svg {
        width: 32px !important;
        height: 32px !important;
    }
    
    .survey-actions {
        flex-direction: column;
        gap: 8px !important;
    }
    
    .survey-skip,
    .survey-submit {
        width: 100%;
        margin: 0;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .emoji-option {
        border-width: 3px !important;
    }
    
    .emoji-option.selected {
        border-width: 3px !important;
    }
    
    .survey-message:focus,
    .improvement-message:focus {
        box-shadow: 0 0 0 4px rgba(28, 176, 246, 0.3);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .survey-modal,
    .survey-modal-content,
    .emoji-option,
    .survey-close,
    .survey-skip,
    .survey-submit,
    .survey-message,
    .improvement-message {
        transition: none !important;
        animation: none !important;
    }
    
    .emoji-option:hover,
    .emoji-option.selected {
        transform: none !important;
    }
    
    .survey-submit:hover,
    .survey-skip:hover {
        transform: none !important;
    }
}

/* Print Styles */
@media print {
    .survey-modal {
        display: none !important;
    }
}