/* ============================================
   iPhone Frame Showcase
   ============================================ */

:root {
    --iphone-frame-w: 240px;
    --iphone-frame-h: 490px;
    --iphone-bezel: 10px;
    --iphone-radius: 38px;
    --iphone-screen-radius: 30px;
    --iphone-color-dark: #1a1a1f;
    --iphone-color-light: #2a2a30;
    --iphone-color-accent: #3a3a42;
    --iphone-notch-w: 90px;
    --iphone-notch-h: 24px;
}

.iphone-frame {
    width: var(--iphone-frame-w);
    height: var(--iphone-frame-h);
    position: relative;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0);
}

.iphone-frame:hover {
    transform: translateY(-8px) scale(1.02);
}

.iphone-shadow {
    filter: drop-shadow(0 25px 50px rgba(0, 23, 54, 0.25))
        drop-shadow(0 10px 20px rgba(0, 23, 54, 0.15));
}

.iphone-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1f1f25 0%, #0d0d10 50%, #1a1a20 100%);
    border-radius: var(--iphone-radius);
    position: relative;
    padding: var(--iphone-bezel);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.12),
        inset 0 -1px 2px rgba(0, 0, 0, 0.4);
}

/* Subtle metallic edge highlight */
.iphone-body::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: calc(var(--iphone-radius) - 2px);
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.06) 0%,
            transparent 30%,
            transparent 70%,
            rgba(255, 255, 255, 0.04) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Side buttons */
.iphone-btn-power {
    position: absolute;
    right: -2px;
    top: 110px;
    width: 2px;
    height: 60px;
    background: linear-gradient(to right, #1a1a20, #2a2a30);
    border-radius: 0 2px 2px 0;
    box-shadow: inset -1px 0 1px rgba(0, 0, 0, 0.5);
}

.iphone-btn-volume-up {
    position: absolute;
    left: -2px;
    top: 90px;
    width: 2px;
    height: 40px;
    background: linear-gradient(to left, #1a1a20, #2a2a30);
    border-radius: 2px 0 0 2px;
    box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5);
}

.iphone-btn-volume-down {
    position: absolute;
    left: -2px;
    top: 140px;
    width: 2px;
    height: 40px;
    background: linear-gradient(to left, #1a1a20, #2a2a30);
    border-radius: 2px 0 0 2px;
    box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5);
}

.iphone-btn-mute {
    position: absolute;
    left: -2px;
    top: 70px;
    width: 2px;
    height: 14px;
    background: linear-gradient(to left, #1a1a20, #2a2a30);
    border-radius: 2px 0 0 2px;
    box-shadow: inset 1px 0 1px rgba(0, 0, 0, 0.5);
}

/* Screen */
.iphone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: var(--iphone-screen-radius);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* Dynamic Island / Notch */
.iphone-notch {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: var(--iphone-notch-w);
    height: var(--iphone-notch-h);
    background: #000;
    border-radius: 14px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.iphone-notch-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #1a2a3a 0%, #000 70%);
    box-shadow: inset 0 0 0 1px rgba(60, 100, 140, 0.4);
}

/* Status bar */
.iphone-status {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Layout: time on the left, signal/wifi/battery on the right.
       The Dynamic Island is 90px wide, centered on a 220px screen,
       so its right edge sits at ~155px from the screen's left.
       The right icon group is ~38px wide and must sit AFTER the
       notch with a small gap, while still being flush to the
       right bezel.  We use a wider right padding to push the
       icon group just past the notch. */
    padding: 0 18px 0 24px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    z-index: 25;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

/* Video */
.iphone-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
    cursor: pointer;
}

/* Home indicator */
.iphone-home-indicator {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 2px;
    z-index: 25;
    pointer-events: none;
}

/* Glow effect on hover */
.iphone-frame::after {
    content: "";
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at 50% 70%,
            rgba(13, 44, 84, 0.15) 0%,
            transparent 60%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: -1;
}

.iphone-frame:hover::after {
    opacity: 1;
}

/* ============================================
   Responsive adjustments for iPhone section
   ============================================ */
@media (max-width: 768px) {
    :root {
        --iphone-frame-w: 200px;
        --iphone-frame-h: 410px;
        --iphone-bezel: 8px;
        --iphone-radius: 32px;
        --iphone-screen-radius: 25px;
        --iphone-notch-w: 76px;
        --iphone-notch-h: 20px;
    }

    /* The screen is narrower (200 - 2*8 = 184px) and the Dynamic
       Island is 76px wide, centered, so its right edge sits at
       ~130px from the left of the screen. The right icon group
       (signal + wifi + battery, ~38px) must clear the notch with
       a small gap, so we widen the right padding. */
    .iphone-status {
        padding: 0 8px 0 18px;
    }
}

@media (max-width: 480px) {
    :root {
        --iphone-frame-w: 180px;
        --iphone-frame-h: 368px;
    }

    /* At 480px the screen is only 180 - 2*8 = 164px wide.
       The 76px notch centered puts its right edge at ~120px.
       The icon group must clear the notch with no overlap,
       so we widen the right padding and reduce the icon size. */
    .iphone-status {
        padding: 0 6px 0 14px;
    }

    /* Shrink icons on very small screens so they fit comfortably
       between the notch and the right bezel. */
    .iphone-status .material-symbols-outlined {
        font-size: 8px !important;
    }

    /* Tighter gap between icons to save horizontal space. */
    .iphone-status .flex {
        gap: 0;
    }
}
