/* ============================================
   PHONE FRAME
   ============================================ */
.phone-frame {
    width: 360px;
    height: 720px;
    background: #000;
    border-radius: 50px;
    padding: 12px;
    box-shadow:
        0 0 0 2px #333,
        0 20px 60px rgba(0,0,0,0.5),
        inset 0 0 0 1px #222;
    position: relative;
}

.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 38px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ============================================
   STATUS BAR — iPhone (Dynamic Island)
   ============================================ */
.phone-screen.iphone .status-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 24px 0;
    font-size: 12px;
    font-weight: 500;
    font-family: -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
    background: inherit;
    flex-shrink: 0;
    min-height: 52px;
    color: #000;
    position: relative;
}

/* Dynamic Island pill */
.dynamic-island {
    width: 120px;
    height: 34px;
    background: #000;
    border-radius: 20px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    z-index: 1;
    padding-top: 5px;
}

.status-center {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    justify-content: flex-end;
    z-index: 1;
    padding-top: 5px;
}

/* Time — modern (left of Dynamic Island) */
.status-time-bold {
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.2px;
}

/* Time — classic/Android */
.status-time {
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.2px;
}

/* Carrier (Android only) */
.status-carrier {
    font-size: 12px;
    font-weight: 400;
}

/* Connection type */
.status-connection {
    font-size: 13px;
    font-weight: 400;
}

/* Signal bars */
.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 1.5px;
    height: 10px;
}

.signal-bars .bar {
    width: 3px;
    border-radius: 0.5px;
}

.signal-bars .bar:nth-child(1) { height: 3px; }
.signal-bars .bar:nth-child(2) { height: 5px; }
.signal-bars .bar:nth-child(3) { height: 7px; }
.signal-bars .bar:nth-child(4) { height: 10px; }

.signal-bars .bar.active { background: currentColor; }
.signal-bars .bar.inactive { background: currentColor; opacity: 0.25; }

/* ── Battery — Classic (Android) ── */
.battery-icon {
    display: flex;
    align-items: center;
    position: relative;
}

.battery-body {
    width: 22px;
    height: 11px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding: 1.5px;
    position: relative;
}

.battery-body::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 5px;
    background: currentColor;
    border-radius: 0 1px 1px 0;
}

.battery-fill {
    height: 100%;
    border-radius: 1px;
    background: currentColor;
    transition: width 0.2s;
}

.battery-fill.low { background: #ff3b30; }
.battery-fill.medium { background: #ffcc00; }

.battery-percent {
    font-size: 11px;
    font-weight: 400;
    margin-right: 3px;
}

/* ── Battery — Modern iOS (% inside icon) ── */
.battery-modern {
    display: flex;
    align-items: center;
    position: relative;
}

/* Nub lives on outer wrapper so overflow:hidden on the body doesn't clip it */
.battery-modern::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5px;
    height: 5px;
    background: currentColor;
    border-radius: 0 1.5px 1.5px 0;
    opacity: 0.4;
}

.battery-modern-body {
    width: 27px;
    height: 13px;
    border: none;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}

.battery-modern-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    border-radius: 4px;
    background: #30d158;
    transition: width 0.2s;
}

.battery-modern-fill.low { background: #ff3b30; }
.battery-modern-fill.medium { background: #ffcc00; }

.battery-modern-text {
    position: relative;
    z-index: 2;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.3px;
    color: #ffffff;
}

/* Status bar icons */
.status-icon {
    display: flex;
    align-items: center;
}

.status-icon svg {
    width: 13px;
    height: 13px;
}

.airplane-icon svg {
    width: 14px;
    height: 14px;
}

.wifi-icon svg {
    width: 18px;
    height: 14px;
    display: block;
    margin-bottom: 6px;
}

/* ============================================
   STATUS BAR — Android
   ============================================ */
.phone-screen.android .status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px;
    font-size: 11px;
    font-weight: 500;
    font-family: "Roboto", "Segoe UI", sans-serif;
    background: inherit;
    flex-shrink: 0;
    min-height: 30px;
    color: #000;
}

/* ============================================
   NAV BAR — base
   ============================================ */
.nav-bar {
    display: flex;
    align-items: center;
    padding: 6px 12px 10px;
    flex-shrink: 0;
    position: relative;
}

/* ============================================
   NAV BAR — Modern iMessage / SMS iPhone
   (iOS 17+ style: large avatar, name > chevron)
   ============================================ */
.nav-bar.imessage-nav-modern {
    background: #f6f6f6;
    border-bottom: 0.5px solid #c8c8cc;
    flex-direction: column;
    align-items: center;
    padding: 0 12px 8px;
}

.nav-modern-back {
    position: absolute;
    left: 12px;
    top: 8px;
    color: #007aff;
    display: flex;
    align-items: center;
    z-index: 2;
}

.nav-back-chevron {
    display: flex;
    align-items: center;
}

.nav-back-chevron svg {
    width: 10px;
    height: 17px;
}

.nav-modern-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #c7c7cc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
}

.nav-modern-avatar svg {
    width: 100%;
    height: 100%;
}

.nav-modern-avatar.blackout {
    background: transparent;
    color: inherit;
}

.nav-modern-name-row {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
}

.nav-modern-name {
    font-size: 11px;
    font-weight: 600;
    color: #000;
}

.nav-modern-name.blackout {
    background: #000;
    color: #000;
    border-radius: 2px;
    padding: 0 4px;
}

.nav-modern-chevron {
    color: #8e8e93;
    font-size: 16px;
    font-weight: 300;
    line-height: 1;
}

.nav-modern-actions {
    display: flex;
    gap: 12px;
}

.nav-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9e9eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007aff;
}

.nav-action-btn svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   NAV BAR — WhatsApp iPhone
   ============================================ */
.nav-bar.whatsapp-iphone-nav {
    background: #f6f6f6;
    border-bottom: 0.5px solid #c8c8cc;
    padding: 6px 12px 8px;
}

.wa-nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-back {
    font-size: 15px;
    color: #007aff;
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 400;
}

.wa-nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dfe5e7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #aab8c2;
}

.wa-nav-avatar svg {
    width: 22px;
    height: 22px;
}

.wa-nav-info {
    display: flex;
    flex-direction: column;
}

.wa-nav-name {
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

.wa-nav-name.blackout {
    background: #000;
    color: #000;
    border-radius: 2px;
    padding: 0 4px;
}

.wa-nav-status {
    font-size: 11px;
    color: #8e8e93;
}

.wa-nav-right {
    margin-left: auto;
    display: flex;
    gap: 18px;
    align-items: center;
    color: #007aff;
}

.wa-nav-right svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   NAV BAR — Android SMS
   ============================================ */
.nav-bar.sms-android-nav {
    background: #fff;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}

.android-nav-back {
    margin-right: 12px;
    display: flex;
    align-items: center;
    color: #444;
}

.android-nav-back svg {
    width: 22px;
    height: 22px;
}

.android-nav-title {
    font-size: 17px;
    font-weight: 500;
    color: #202124;
    flex: 1;
    font-family: "Roboto", "Segoe UI", sans-serif;
}

.android-nav-title.blackout {
    background: #000;
    color: #000;
    border-radius: 2px;
    padding: 0 4px;
}

.android-nav-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    color: #444;
}

.android-nav-actions svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   NAV BAR — WhatsApp Android
   ============================================ */
.nav-bar.whatsapp-android-nav {
    background: #075e54;
    padding: 8px 10px;
}

.wa-android-back {
    color: #fff;
    display: flex;
    align-items: center;
}

.wa-android-back svg {
    width: 22px;
    height: 22px;
    margin-right: 4px;
}

.wa-android-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: #fff;
}

.wa-android-avatar svg {
    width: 22px;
    height: 22px;
}

.wa-android-info {
    flex: 1;
}

.wa-android-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
}

.wa-android-name.blackout {
    background: #fff;
    color: #fff;
    border-radius: 2px;
    padding: 0 4px;
}

.wa-android-status {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.wa-android-actions {
    display: flex;
    gap: 18px;
    align-items: center;
    margin-left: auto;
    color: #fff;
}

.wa-android-actions svg {
    width: 22px;
    height: 22px;
}

/* ============================================
   MESSAGES AREA
   ============================================ */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.phone-screen.imessage .messages-area,
.phone-screen.sms-iphone .messages-area {
    background: #fff;
}

.phone-screen.whatsapp-iphone .messages-area,
.phone-screen.whatsapp-android .messages-area {
    background: #ece5dd;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23d4cdc4' fill-opacity='0.15'%3E%3Cpath d='M20 10c2 0 3 1 3 3s-1 3-3 3-3-1-3-3 1-3 3-3zm40 20c2 0 3 1 3 3s-1 3-3 3-3-1-3-3 1-3 3-3zm-30 30c1 0 2 1 2 2s-1 2-2 2-2-1-2-2 1-2 2-2zm50-10c1 0 2 1 2 2s-1 2-2 2-2-1-2-2 1-2 2-2zM10 60c1 0 2 1 2 2s-1 2-2 2-2-1-2-2 1-2 2-2z'/%3E%3C/g%3E%3C/svg%3E");
}

.phone-screen.sms-android .messages-area {
    background: #fff;
}

/* Timestamp separator */
.msg-timestamp {
    text-align: center;
    font-size: 10px;
    color: #8e8e93;
    padding: 6px 0;
    font-weight: 500;
}

.phone-screen.whatsapp-iphone .msg-timestamp,
.phone-screen.whatsapp-android .msg-timestamp {
    background: rgba(225, 218, 208, 0.85);
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    align-self: center;
    font-size: 10px;
    color: #667781;
}

/* ============================================
   MESSAGE BUBBLES — iMessage / SMS iPhone
   ============================================ */
.msg-bubble-wrap {
    display: flex;
    max-width: 78%;
    margin-bottom: 1px;
}

.msg-bubble-wrap.sent { align-self: flex-end; }
.msg-bubble-wrap.received { align-self: flex-start; }

.msg-bubble {
    padding: 7px 12px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.35;
    word-wrap: break-word;
    position: relative;
    font-family: -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
}

.msg-bubble.blue {
    background: #007aff;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-bubble.green {
    background: #34c759;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-bubble.grey {
    background: #e9e9eb;
    color: #000;
    border-bottom-left-radius: 4px;
}

/* ============================================
   MESSAGE BUBBLES — WhatsApp
   ============================================ */
.phone-screen.whatsapp-iphone .msg-bubble.blue,
.phone-screen.whatsapp-iphone .msg-bubble.green,
.phone-screen.whatsapp-android .msg-bubble.blue,
.phone-screen.whatsapp-android .msg-bubble.green {
    background: #dcf8c6;
    color: #000;
    border-radius: 8px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 8px;
}

.phone-screen.whatsapp-iphone .msg-bubble.grey,
.phone-screen.whatsapp-android .msg-bubble.grey {
    background: #fff;
    color: #000;
    border-radius: 8px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 8px;
}

.wa-msg-time {
    float: right;
    font-size: 10px;
    color: #667781;
    margin-left: 8px;
    margin-top: 7px;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ============================================
   MESSAGE BUBBLES — Android SMS
   ============================================ */
.phone-screen.sms-android .msg-bubble.blue,
.phone-screen.sms-android .msg-bubble.green {
    background: #1a73e8;
    color: #fff;
    border-radius: 20px;
    border-bottom-right-radius: 4px;
}

.phone-screen.sms-android .msg-bubble.grey {
    background: #f1f3f4;
    color: #202124;
    border-radius: 20px;
    border-bottom-left-radius: 4px;
}

.phone-screen.sms-android .msg-bubble {
    font-family: "Roboto", "Segoe UI", sans-serif;
    font-size: 14px;
}

/* ============================================
   INPUT BAR
   ============================================ */
.input-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 6px 10px 20px;
    gap: 8px;
}

.input-bar.imessage-input,
.input-bar.sms-iphone-input {
    background: #f6f6f6;
    border-top: 0.5px solid #c8c8cc;
}

.input-camera {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e93;
}

.input-camera svg {
    width: 24px;
    height: 24px;
}

.input-field-wrap {
    flex: 1;
    min-height: 32px;
    border: 1px solid #c8c8cc;
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #fff;
}

.input-placeholder {
    font-size: 14px;
    color: #c7c7cc;
    font-family: -apple-system, "SF Pro Text", sans-serif;
}

.input-send-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-send-btn svg {
    width: 26px;
    height: 26px;
}

.input-bar.whatsapp-iphone-input {
    background: #f0f0f0;
    border-top: 0.5px solid #c8c8cc;
}

.input-bar.whatsapp-iphone-input .input-field-wrap {
    background: #fff;
    border-color: #ddd;
}

.input-bar.whatsapp-android-input {
    background: #ece5dd;
    padding-bottom: 12px;
}

.input-bar.whatsapp-android-input .input-field-wrap {
    background: #fff;
    border: none;
    border-radius: 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.wa-android-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #00a884;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.wa-android-send-btn svg {
    width: 22px;
    height: 22px;
}

.input-bar.sms-android-input {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding-bottom: 14px;
}

.input-bar.sms-android-input .input-field-wrap {
    background: #f1f3f4;
    border: none;
    border-radius: 22px;
    font-family: "Roboto", "Segoe UI", sans-serif;
}

.android-sms-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e8eaed;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #5f6368;
}

.android-sms-send svg {
    width: 20px;
    height: 20px;
}

.android-sms-send.active {
    background: #1a73e8;
    color: #fff;
}

/* ============================================
   PHONE SCREEN BACKGROUNDS
   ============================================ */
.phone-screen.imessage,
.phone-screen.sms-iphone {
    background: #f6f6f6;
}

.phone-screen.whatsapp-iphone {
    background: #f6f6f6;
}

.phone-screen.sms-android {
    background: #fff;
}

.phone-screen.whatsapp-android {
    background: #ece5dd;
}

.phone-screen.whatsapp-android .status-bar {
    background: #054d44;
    color: #fff;
}

/* ============================================
   SCROLLBAR INSIDE PHONE
   ============================================ */
.messages-area::-webkit-scrollbar {
    width: 3px;
}

.messages-area::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
}

@media (max-width: 480px) {
    .phone-frame {
        width: min(100%, 360px);
        height: auto;
        aspect-ratio: 1 / 2;
        border-radius: 38px;
    }
}

/* Custom Avatar Image */
.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
