/**
 * Bio editor phone chrome + scaled iframe — shared by:
 * - storage/themes/default/bio/edit.php (live preview)
 * - CoralBold marketing landings (real public bio inside the same frame)
 */
.bio-device-wrap {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.bio-device {
    position: relative;
    width: 280px;
    height: 560px;
    background: linear-gradient(145deg, #2a2a2e 0%, #1a1a1e 50%, #0e0e10 100%);
    border-radius: 40px;
    padding: 10px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.3),
        0 8px 30px rgba(0, 0, 0, 0.35);
}

.bio-device::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 20px;
    background: #000;
    border-radius: 14px;
    z-index: 10;
}

.bio-device-btn-vol1,
.bio-device-btn-vol2,
.bio-device-btn-mute,
.bio-device-btn-power {
    position: absolute;
    background: linear-gradient(180deg, #3a3a3e, #2a2a2e);
    border-radius: 2px;
}

.bio-device-btn-mute {
    width: 3px;
    height: 18px;
    left: -3px;
    top: 90px;
}

.bio-device-btn-vol1 {
    width: 3px;
    height: 34px;
    left: -3px;
    top: 125px;
}

.bio-device-btn-vol2 {
    width: 3px;
    height: 34px;
    left: -3px;
    top: 168px;
}

.bio-device-btn-power {
    width: 3px;
    height: 50px;
    right: -3px;
    top: 140px;
}

/* Override dashboard style.css .card-preview when both classes are present (720px height / sticky top / thick border broke scaled iframe alignment). */
.bio-device .bio-device-screen.card-preview {
    border-width: 0 !important;
    border-radius: 32px !important;
    height: 100% !important;
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    position: relative !important;
    top: auto !important;
    box-shadow: none !important;
}

.bio-device-screen {
    width: 100%;
    height: 100%;
    border-radius: 32px;
    overflow: hidden;
    background: #000;
    position: relative;
}

/* Higher specificity than dashboard .card-preview iframe (which used height:100% and broke scale). */
.bio-device .bio-device-screen iframe {
    width: 375px;
    height: 812px;
    border: none;
    display: block;
    transform: scale(0.6933);
    transform-origin: top left;
    position: absolute;
    top: 0;
    left: 0;
}

.bio-device-bar {
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    z-index: 10;
}

.bio-device::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 40px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 5;
}

@media (max-width: 991px) {
    .bio-device-wrap {
        position: relative;
        top: 0;
        margin-top: 2rem;
    }
}

@media (max-width: 575px) {
    .bio-device {
        width: 250px;
        height: 500px;
        border-radius: 36px;
        padding: 8px;
    }

    .bio-device-screen {
        border-radius: 28px;
    }

    .bio-device .bio-device-screen.card-preview {
        border-radius: 28px !important;
    }

    .bio-device .bio-device-screen iframe {
        transform: scale(0.624);
    }

    .bio-device::before {
        width: 70px;
        height: 17px;
        top: 8px;
    }

    .bio-device-btn-vol1,
    .bio-device-btn-vol2,
    .bio-device-btn-mute,
    .bio-device-btn-power {
        display: none;
    }
}

/* Dashboard dark theme */
body.dark .bio-device {
    background: linear-gradient(145deg, #1a1a1e 0%, #0a0a0c 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 8px 30px rgba(0, 0, 0, 0.5);
}

body.dark .bio-device::before {
    background: #000;
}

body.dark .bio-device-screen {
    background: #000;
}

body.dark .bio-device-btn-vol1,
body.dark .bio-device-btn-vol2,
body.dark .bio-device-btn-mute,
body.dark .bio-device-btn-power {
    background: linear-gradient(180deg, #222, #111);
}

/* CoralBold frontend dark scheme */
[data-scheme="dark"] .marketing-bio-device .bio-device {
    background: linear-gradient(145deg, #1a1a1e 0%, #0a0a0c 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.5),
        0 8px 30px rgba(0, 0, 0, 0.5);
}

[data-scheme="dark"] .marketing-bio-device .bio-device::before {
    background: #000;
}

[data-scheme="dark"] .marketing-bio-device .bio-device-screen {
    background: #000;
}

[data-scheme="dark"] .marketing-bio-device .bio-device-btn-vol1,
[data-scheme="dark"] .marketing-bio-device .bio-device-btn-vol2,
[data-scheme="dark"] .marketing-bio-device .bio-device-btn-mute,
[data-scheme="dark"] .marketing-bio-device .bio-device-btn-power {
    background: linear-gradient(180deg, #222, #111);
}

/* Marketing hero: not sticky, centered */
.marketing-bio-device.bio-device-wrap {
    position: relative;
    top: auto;
    margin-left: auto;
    margin-right: auto;
}
