/*
 * Universal Canvas SSAI Video Player Styles
 * Designed for maximum inheritance from the host website's look and feel.
 * It ONLY targets elements created or managed by the SSAI player.
 */

/* Video Player Styling - Minimalist to allow host control */
#canvasMySSAIVideo {
    display: block;
    margin: 0 auto 20px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    /* Ensure video is responsive */
    max-width: 100%; /* Important */
    height: auto; /* Important */
}

.video-js-canvas {
    z-index:9999 !important;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* Canvas SSAI Form Container - Designed for maximum inheritance */
#canvasSsaiForm {
    display: none; /* Controlled by JS */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95); /* Light, slightly transparent default background */
    padding: 30px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 400px;
    width: 90%; /* Responsive width */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    font-size: 1rem; /* Base font size, scales with host's root font size */
    line-height: 1.5;
    font-family: inherit; /* Inherit font from host */
    color: inherit;      /* Inherit text color from host */
    /* Backdrop filter will be applied by JS for display: block state */
    transition: all 0.3s ease-in-out; /* Smooth transition for display changes if applicable */
    z-index: 12; /* CRITICAL: Must be higher than #canvasLockIcon and #canvas-ssai-ui-container */

}
#canvasSsaiForm h3 {
    margin-top: 0;
    font-size: 1.8em;
    text-align: center;
    margin-bottom: 20px;
    color: inherit; /* Explicitly inherit heading color */
}

/* Input styles: Designed to inherit widely */
#canvasName,
#canvasEmail,
#canvasCompany {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd; /* Neutral border */
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em;
    background-color: inherit; /* Inherit background from form container */
    color: inherit; /* Inherit text color from form container */
    font-family: inherit; /* Inherit font from form container */
}
/* Buttons: Minimal CSS - most visual styles handled by JS for inheritance */
#canvasSsaiformElement button {
    /* Structural/layout only, visual properties copied by JS */
    box-sizing: border-box;
    margin-right: 10px;
    cursor: pointer; /* Ensure cursor is pointer */
    /* No background-color, color, border, font-family, font-size, padding, border-radius here! */
    /* They will be set directly via element.style by JavaScript */
}

/* Disabled state - important to explicitly style */
#canvasSsaiformSubmitButton:disabled,
#canvasCloseFormButton:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    /* Use !important to ensure these override any JS-copied styles */
    background-color: #e0e0e0 !important; /* Light grey for disabled */
    color: #a0a0a0 !important; /* Faded text for disabled */
    border-color: #e0e0e0 !important; /* Faded border for disabled */
}

/* Error message */
#canvasSubmitError {
    color: red; /* Error messages usually stand out */
    margin-top: 10px;
    font-size: 0.9em;
    display: none;
    text-align: left;
}

/* Canvas Unlocked Message (often needs specific visual prominence) */
#canvasUnlockedMessage {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #d4edda; /* Light green for success */
    color: #155724; /* Dark green text */
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10001;
    font-weight: bold;
    font-size: 1em;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.3s ease-in-out;
    z-index: 12; /* CRITICAL: Must be higher than #canvasLockIcon and #canvas-ssai-ui-container */
}

/* Canvas Feedback Container (also often needs specific visual prominence) */
#canvasFeedbackContainer {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95); /* Semi-transparent white */
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-align: center;
    z-index: 10002;
    backdrop-filter: blur(5px);
    font-size: 1em;
    font-family: inherit;
    color: inherit;
    transition: all 0.3s ease-in-out;
    z-index: 12; /* CRITICAL: Must be higher than #canvasLockIcon and #canvas-ssai-ui-container */
}
#canvasFeedbackContainer p {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: inherit;
}
/* Emoji buttons */
#canvasEmoji1,
#canvasEmoji2,
#canvasEmoji3 {
    font-size: 2.5em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin: 0 8px;
    transition: transform 0.2s ease-in-out;
    outline: none; /* Remove outline on focus */
}
#canvasEmoji1:hover,
#canvasEmoji2:hover,
#canvasEmoji3:hover {
    transform: scale(1.2);
}

/* #video-player-wrapper: No change, keep as is for positioning context */
#video-player-wrapper {
    position: relative;
    width: 800px;
    height: 450px;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Important for blur effect on video to be contained */
}

/* Blur effect on the video when popup is active */
#canvasMySSAIVideo.blurred {
    filter: blur(8px); /* Adjust blur amount as needed */
    transition: filter 0.3s ease-out; /* Smooth transition for blur */
}

/* Ensure default state has no blur */
#canvasMySSAIVideo:not(.blurred) {
    filter: none;
}

/* Add this to your existing CSS */
#canvasMySSAIVideo.disabled-interaction {
    pointer-events: none; /* Prevents all mouse/touch events on the video */
}

/* The main overlay container (no change from previous update) */
#canvas-ssai-ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* This is the dimmer behind the form/lock */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Lock Icon Styling */
#canvasLockIcon {
    position: absolute; /* Position it relative to canvas-ssai-ui-container */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center it precisely */
    font-size: 80px; /* Adjust size as needed */
    color: white; /* Color of the lock icon */
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Optional: add some shadow */
    z-index: 11; /* Make sure it's above the overlay but behind the form */
    display: flex; /* For centering the unicode char or SVG */
    align-items: center;
    justify-content: center;
}
/* If using SVG, you might want to adjust its size/color via CSS */
#canvasLockIcon svg {
    width: 80px;
    height: 80px;
    color: white; /* Or fill/stroke */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    #canvasSsaiForm {
        padding: 20px;
        width: 95%;
    }
    #canvasSsaiForm h3 {
        font-size: 1.5em;
    }
    #canvasSsaiformElement button {
        display: block;
        width: calc(100% - 20px); /* Adjust for margin-right */
        margin-right: 0;
        margin-bottom: 10px;
    }
    #canvasEmoji1, #canvasEmoji2, #canvasEmoji3 {
        font-size: 2em;
        margin: 0 5px;
    }
}
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay-content {
    width: 90%;
    /*  margin-top:50%; */
    max-width: 500px;
    background-color: #1a1a2e; /* Dark navy background */
    border-radius: 12px;
    padding: 30px;
    z-index: 99999;
}

.overlay-title {
    text-align: center;
    background-clip: text;
    font-size: 1.5rem;
    margin-bottom: 40px;
    line-height: 1.4;
    color: #add8e6;
}
.overlay-title-optin {
    font-size: 18px;
    margin-bottom: 40px;
    background-color: rgb(0, 0, 51);
    color: rgb(0, 191, 255);
}

.canvas-opt-out-button {
    background: linear-gradient(to right, #e52d27, #b31217) !important;
    color: white !important;
    border: none !important;
    padding: 15px 30px !important;
    font-size: 20px !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    margin-bottom: 20px !important;
}


.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #46ffdf;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(245, 132, 31, 0.4);
    border-color: transparent;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.canvas-submit-button,
.canvas-cancel-button {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.canvas-close-button{
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #333 !important;
    border-radius: 20px !important;
    padding: 10px 20px !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.canvas-opt-in-button {
    background: linear-gradient(to right, #00bfff, #1e90ff) !important;
    color: white !important;
    border: none !important;
    padding: 15px 30px !important;
    font-size: 20px !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    margin-bottom: 20px !important;
}
.canvas-submit-button {
    background-color: #00bfff !important; /* Cyan blue */
    color: #000 !important;
    border: none !important;
    border-radius: 20px !important;
    padding: 10px 20px !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.cancel-button {
    background-color: #0a0a0a;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
    -webkit-appearance: none;
    appearance: none;
}

/* Add gradient border to cancel button */
.cancel-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    padding: 2px;
    background: linear-gradient(90deg, #F5841F, #F1C961, #00B3A6, #5B5FD1);
    -webkit-mask:
            linear-gradient(#fff 0 0) content-box,
            linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(245, 132, 31, 0.6);
}

.cancel-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.header-image {
    display: block;
    margin: 0 auto 20px auto;
    max-width: 100%;
    height: auto;
}

.title {
    font-size: 1.5rem;
    margin-bottom: 40px;
    line-height: 1.4;
}

.email-label {
    display: block;
    text-align: left;
    margin-bottom: 10px;
    font-size: 1rem;
    color:#add8e6;
}

.email-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.email-input {
    flex-grow: 1;
    background-color: #000;
    color: #fff;
    border: 1px solid #333;
    border-radius: 4px 0 0 4px;
    padding: 10px;
    font-size: 1rem;
}

.email-domain {
    background-color: #000;
    color: #fff;
    border: 1px solid #333;
    border-left: none;
    border-radius: 0 4px 4px 0;
    padding: 10px;
    font-size: 1rem;
    appearance: none; /* Remove default arrow */
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); /* Custom arrow */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    width: 20%;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.submit-btn {
    background-color: #00bfff; /* Cyan blue */
    color: #000;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
}

.more {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgb(0, 0, 51);
    color: rgb(0, 191, 255);
}
.qr-code {
    width: 100px;
    height: 100px;
    background-color: white;
    padding: 5px;
    border-radius: 5px;
}

.no-thanks-btn {
    background-color: #000;
    color: #fff;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
}

/* Responsive design */
@media (max-width: 600px) {
    .title {
        font-size: 1.2rem;
    }

    .email-wrapper {
        flex-direction: column;
    }

    .email-input {
        border-radius: 4px 4px 0 0;
        border-bottom: none;
    }

    .email-domain {
        border-radius: 0 0 4px 4px;
        border-top: none;
        border-left: 1px solid #333;
    }

    .buttons {
        flex-direction: column;
        gap: 10px;
    }

    .submit-btn, .no-thanks-btn {
        width: 100%;
    }
}

/* Add shine effect to submit button */
.submit-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: transform 0.6s;
}

.submit-button:hover::after {
    transform: rotate(30deg) translateX(300%);
}

/* Fix for WebKit/Blink browsers */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .submit-button:hover {
        background: linear-gradient(90deg, #F5841F, #F1C961, #00B3A6, #5B5FD1) !important;
    }

    .cancel-button:hover {
        background-color: #0a0a0a !important;
    }
}

.submit-button:disabled,
.cancel-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Prevent hover effects when disabled */
.submit-button:disabled:hover,
.cancel-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.submit-button:disabled:hover {
    background: linear-gradient(90deg, #F5841F, #F1C961, #00B3A6, #5B5FD1);
    opacity: 0.7;
}

.cancel-button:disabled:hover {
    background-color: #0a0a0a !important;
    opacity: 0.7;
}

.submit-button:disabled:hover::after {
    transform: rotate(30deg);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}