/**
 * Action Popup - Frontend Styles
 */

/* Overlay */
.action-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Popup Container */
.action-popup-container {
    position: relative;
    max-width: 600px;
    width: 100%;
    margin: 50px auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: actionPopupSlideIn 0.3s ease-out;
}

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

/* Popup Content */
.action-popup-content {
    position: relative;
    padding: 30px;
}

/* Close Button */
.action-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.action-popup-close:hover {
    color: #000;
    background-color: #f0f0f0;
}

/* Popup Title */
.action-popup-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 20px 0;
    color: #333;
    padding-right: 40px;
}

.action-popup-title:empty {
    display: none !important;
}

/* Popup Body */
.action-popup-body {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

.action-popup-body p {
    margin: 0 0 15px 0;
}

.action-popup-body p:last-child {
    margin-bottom: 0;
}

.action-popup-body img {
    max-width: 100%;
    height: auto;
}

.action-popup-body a {
    color: #0073aa;
    text-decoration: none;
}

.action-popup-body a:hover {
    text-decoration: underline;
}

/* Iframe and Embed Support */
.action-popup-body iframe,
.action-popup-body embed,
.action-popup-body object {
    max-width: 100%;
    width: 100%;
    height: auto;
    min-height: 300px;
    border: none;
    display: block;
    margin: 15px 0;
}

/* Responsive iframe wrapper */
.action-popup-body .iframe-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 15px 0;
}

.action-popup-body .iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Video embed styling */
.action-popup-body iframe[src*="youtube"],
.action-popup-body iframe[src*="vimeo"],
.action-popup-body iframe[src*="dailymotion"] {
    aspect-ratio: 16 / 9;
    min-height: 400px;
}

/* Zoho Form Styling - Matching Design */
.action-popup-body #crmWebToEntityForm {
    background-color: #FFFFFF !important;
    color: #333 !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_title {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #000 !important;
    margin-bottom: 30px !important;
    padding: 0 !important;
    text-align: left !important;
    border-bottom: none !important;
}

/* Two-column layout for form rows */
.action-popup-body #crmWebToEntityForm .zcwf_row {
    margin: 0 0 20px 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    align-items: flex-start !important;
}

/* Make rows with textarea full-width */
.action-popup-body #crmWebToEntityForm .zcwf_row:has(textarea) {
    flex-direction: column !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_lab {
    width: 100% !important;
    margin-bottom: 0px !important;
    padding: 0 !important;
    margin-right: 0 !important;
    float: none !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_lab label {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #000 !important;
    margin: 0 0 0px 0 !important;
    display: block !important;
    font-family: inherit !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_lab label span[style*="color:red"] {
    color: #dc3545 !important;
    margin-left: 3px;
}

/* Field columns - two columns for regular fields, full width for textarea */
.action-popup-body #crmWebToEntityForm .zcwf_col_fld {
    width: calc(50% - 7.5px) !important;
    padding: 0 !important;
    margin-top: 0 !important;
    float: none !important;
    flex: 1 1 calc(50% - 7.5px) !important;
}

/* Full width for textarea rows */
.action-popup-body #crmWebToEntityForm .zcwf_row:has(textarea) .zcwf_col_fld {
    width: 100% !important;
    flex: 1 1 100% !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_fld input[type="text"],
.action-popup-body #crmWebToEntityForm .zcwf_col_fld input[type="email"],
.action-popup-body #crmWebToEntityForm .zcwf_col_fld textarea,
.action-popup-body #crmWebToEntityForm .zcwf_col_fld select {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    color: #333 !important;
    background-color: #fff !important;
    transition: border-color 0.3s ease !important;
    float: none !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_fld input[type="text"]::placeholder,
.action-popup-body #crmWebToEntityForm .zcwf_col_fld input[type="email"]::placeholder,
.action-popup-body #crmWebToEntityForm .zcwf_col_fld textarea::placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_fld input[type="text"]:focus,
.action-popup-body #crmWebToEntityForm .zcwf_col_fld input[type="email"]:focus,
.action-popup-body #crmWebToEntityForm .zcwf_col_fld textarea:focus,
.action-popup-body #crmWebToEntityForm .zcwf_col_fld select:focus {
    outline: none !important;
    border-color: #0073aa !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_fld textarea {
    min-height: 120px !important;
    resize: vertical !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_fld_slt {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    background: #fff !important;
    font-size: 14px !important;
    float: none !important;
}

/* Submit button styling - dark blue with arrow */
.action-popup-body #crmWebToEntityForm .formsubmit,
.action-popup-body #crmWebToEntityForm .zcwf_button[type="submit"] {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #fff !important;
    background-color: #1a365d !important;
    border: none !important;
    padding: 14px 32px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    max-width: none !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.action-popup-body #crmWebToEntityForm .formsubmit::after,
.action-popup-body #crmWebToEntityForm .zcwf_button[type="submit"]::after {
    content: "→" !important;
    font-size: 18px !important;
    line-height: 1 !important;
}

.action-popup-body #crmWebToEntityForm .formsubmit:hover,
.action-popup-body #crmWebToEntityForm .zcwf_button[type="submit"]:hover {
    background-color: #153450 !important;
}

/* Hide reset button or style it differently */
.action-popup-body #crmWebToEntityForm .zcwf_button[type="reset"] {
    display: none !important;
}

/* Checkbox styling */
.action-popup-body #crmWebToEntityForm .zcwf_ckbox {
    margin-right: 10px !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    float: left !important;
    margin-top: 2px !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_privacy {
    margin-top: 25px !important;
    padding: 0 !important;
    font-size: 13px !important;
    color: #666 !important;
    display: flex !important;
    align-items: flex-start !important;
    line-height: 1.6 !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_privacy_txt {
    color: #666 !important;
    font-size: 13px !important;
    margin-left: 0 !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_privacy_txt a {
    color: #999 !important;
    text-decoration: underline !important;
}

.action-popup-body #crmWebToEntityForm .zcwf_col_help {
    display: none !important;
}

/* Button row styling */
.action-popup-body #crmWebToEntityForm .zcwf_row:has(.formsubmit) {
    margin-top: 30px !important;
    padding-top: 0 !important;
    border-top: none !important;
    flex-direction: column !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-popup-overlay {
        padding: 10px;
    }
    
    .action-popup-container {
        margin: 20px auto;
        max-width: 100%;
    }
    
    .action-popup-content {
        padding: 20px;
    }
    
    .action-popup-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .action-popup-body {
        font-size: 14px;
    }
    
    /* Mobile Zoho Form Adjustments */
    .action-popup-body #crmWebToEntityForm .zcwf_title {
        font-size: 20px !important;
    }
    
    .action-popup-body #crmWebToEntityForm .zcwf_row {
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .action-popup-body #crmWebToEntityForm .zcwf_col_fld {
        width: 100% !important;
        flex: 1 1 100% !important;
        margin-bottom: 20px !important;
    }
    
    .action-popup-body #crmWebToEntityForm .zcwf_col_fld:last-child {
        margin-bottom: 0 !important;
    }
    
    .action-popup-body #crmWebToEntityForm .formsubmit,
    .action-popup-body #crmWebToEntityForm .zcwf_button[type="submit"] {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Success Message */
.action-popup-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4caf50;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000000;
    max-width: 400px;
    font-size: 14px;
    line-height: 1.5;
    animation: actionPopupSuccessSlideIn 0.3s ease-out;
}

@keyframes actionPopupSuccessSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .action-popup-success-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Success Message Content in Popup */
.action-popup-success-content {
    text-align: center;
    padding: 40px 20px;
    font-size: 18px;
    line-height: 1.6;
    color: #333;
}

.action-popup-success-content p {
    margin: 0 0 15px 0;
}

.action-popup-success-content p:last-child {
    margin-bottom: 0;
}

