@import url('https://fonts.googleapis.com/css2?family=SF+Pro:wght@400;600&family=SF+Pro+Text:wght@400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overscroll-behavior-y: none;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    position: fixed;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: #FFF;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    font-synthesis: none;
    overflow: hidden;
    position: relative;
}

.phone-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
}

.phone-screen {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #FFF;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}


.status-bar-spacer {
    height: 44px;
    background: #F1F1F2;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
}

.header {
    background: #F1F1F2;
    height: 90px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0;
    position: fixed;
    top: 44px;
    left: 0;
    right: 0;
    z-index: 999;
}

.header-left {
    position: absolute;
    left: 0px;
    top: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.back-arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.back-arrow img {
    width: 100%;
    height: 100%;
}

.message-count {
    background: #007aff;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-family: "SF Pro Text", system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    margin-left: -12px;
}

.contact-info {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.profile-picture {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0px 5px 20px 0px rgba(166, 166, 166, 0.30);
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-name {
    font-family: "SF Pro Text", system-ui, -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 400;
    color: #000;
    text-align: center;
    line-height: 15px;
}

.video-call-button {
    position: absolute;
    right: 18px;
    top: 27px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.video-call-button img {
    width: 100%;
    height: 100%;
}

.messages-container {
    position: fixed;
    top: 134px;
    left: 0;
    right: 0;
    bottom: 79px;
    overflow-y: auto;
    padding: 0 0 0 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.message {
    margin-bottom: 4px;
    display: flex;
    position: relative;
    padding: 0 9px;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-bubble {
    padding: 7px 14px;
    border-radius: 19px;
    font-family: "SF Pro", system-ui, -apple-system, sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 22px;
    word-wrap: break-word;
    position: relative;
    max-width: 280px;
}

.message.sent .message-bubble {
    background: #007AFF;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
    background: #E9E9EB;
    color: #000;
    border-bottom-left-radius: 4px;
}

.message.received .message-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5px;
    width: 20px;
    height: 14px;
    background: #E9E9EB;
    clip-path: polygon(20px 0, 0 14px, 20px 14px, 20px 13.668px, 15.195px 5.252px, 20px 0);
}

.message.sent .message-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -5px;
    width: 20px;
    height: 14px;
    background: #007AFF;
    transform: scaleX(-1);
    clip-path: polygon(20px 0, 0 14px, 20px 14px, 20px 13.668px, 15.195px 5.252px, 20px 0);
}

.input-container {
    background: #FFF;
    height: 79px;
    padding: 4px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.plus-button {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.plus-button img {
    width: 100%;
    height: 100%;
}

.text-input-wrapper {
    flex: 1;
    background: #FFF;
    border-radius: 100px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    height: 35px;
    display: flex;
    align-items: center;
    padding: 0 57px 0 16px;
    position: relative;
}

#message-input {
    width: 100%;
    border: none;
    outline: none;
    font-family: "SF Pro", system-ui, -apple-system, sans-serif;
    font-size: 17px;
    font-weight: 400;
    background: transparent;
    color: #000;
    padding: 0;
    -webkit-appearance: none;
}

#message-input::placeholder {
    color: #C4C4C6;
    font-variation-settings: "wdth" 100, "opsz" 28;
}

.voice-button {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.voice-button img {
    width: 100%;
    height: 100%;
}

.send-button {
    position: absolute;
    right: 1.5px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
}

.send-button:hover {
    opacity: 0.8;
}

