/* TodPhone AutoPlay Widget Styles */

.todphone-autoplay-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

/* Alignment utilities */
.todphone-autoplay-wrapper.align-left {
    justify-content: flex-start;
}
.todphone-autoplay-wrapper.align-center {
    justify-content: center;
}
.todphone-autoplay-wrapper.align-right {
    justify-content: flex-end;
}

/* Main Phone Container */
.todphone-container {
    position: relative;
    display: inline-block;
    width: var(--todphone-frame-width, 320px);
    max-width: 100%;
    margin: 0 auto;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}

/* Optional Float Animation */
.todphone-container.has-float-anim {
    animation: todphoneFloat 4s ease-in-out infinite alternate;
}

@keyframes todphoneFloat {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(0.5deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* Phone Frame Overlay */
.todphone-frame-overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    height: auto;
    pointer-events: none;
    line-height: 0;
}

.todphone-frame-img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Screen Area (Behind or Clipped to Phone Screen Window) */
.todphone-screen-area {
    position: absolute;
    z-index: 5;
    top: var(--todphone-screen-top, 11.5%);
    left: var(--todphone-screen-left, 4.5%);
    width: var(--todphone-screen-width, 91%);
    height: var(--todphone-screen-height, 77%);
    border-radius: var(--todphone-screen-radius, 28px);
    overflow: hidden;
    background-color: #000000;
    box-sizing: border-box;
    clip-path: var(--todphone-custom-clip, none);
}

/* Video Container Inner */
.todphone-video-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Video Elements */
.todphone-video-element {
    width: 100%;
    height: 100%;
    object-fit: var(--todphone-video-fit, cover);
    object-position: var(--todphone-video-pos-x, 50%) var(--todphone-video-pos-y, 50%);
    transform: scale(var(--todphone-video-scale, 1)) translate(var(--todphone-video-off-x, 0px), var(--todphone-video-off-y, 0px));
    transform-origin: center center;
    border: none;
    outline: none;
    display: block;
    pointer-events: none;
}

.todphone-youtube-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(var(--todphone-video-scale, 1.35)) translate(var(--todphone-video-off-x, 0px), var(--todphone-video-off-y, 0px));
    pointer-events: none;
}

.todphone-youtube-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

/* Touch Shield Overlay (Blocks user clicks, pause, right-click, context menu) */
.todphone-touch-shield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    background: transparent;
    cursor: default;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Sound Toggle Button */
.todphone-sound-toggle {
    position: absolute;
    z-index: 25;
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    outline: none;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.todphone-sound-toggle:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.todphone-sound-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.todphone-sound-toggle .todphone-icon-unmuted {
    display: none;
}

.todphone-sound-toggle.is-unmuted .todphone-icon-muted {
    display: none;
}

.todphone-sound-toggle.is-unmuted .todphone-icon-unmuted {
    display: block;
}

/* Preset Shapes for Screen Area */
.todphone-screen-area.shape-iphone-notch {
    clip-path: polygon(
        0% 0%, 
        30% 0%, 
        33% 4%, 
        67% 4%, 
        70% 0%, 
        100% 0%, 
        100% 100%, 
        0% 100%
    );
}

.todphone-island-pill {
    position: absolute;
    z-index: 18;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 25px;
    background: #000000;
    border-radius: 20px;
    pointer-events: none;
}

/* Fallback styling if frame image fails or isn't uploaded */
.todphone-container.no-frame-img {
    border: 12px solid #222222;
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: #000000;
}
.todphone-container.no-frame-img .todphone-screen-area {
    position: relative;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 500px;
}
