/* iPhone frame */
#iphone-frame {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 9/19;
    background: #000;
    border-radius: 50px;
    padding: 20px 0 20px 0;
    box-sizing: border-box;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Notch */
#iphone-notch {
    width: 150px;
    height: 30px;
    background: #111;
    border-radius: 15px 15px 10px 10px;
    position: absolute;
    top: 0;
}

/* Status bar at top of white screen */
#imessage-status-bar {
    width: 100%;
    height: 20px;
    position: relative;
    display: flex;
    justify-content: space-between; /* space between left and right elements */
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Battery outline */
#battery {
    width: 40px;       /* slightly bigger to fit text */
    height: 16px;
    border: 2px solid black;
    border-radius: 3px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center; /* center text inside */
}

/* Battery fill (60%) */
#battery-level {
    background: black;
    height: 100%;
    width: 60%;           /* 60% full */
    border-radius: 1px;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}

/* Battery tip */
#battery-tip {
    position: absolute;
    right: -4px;
    top: 4px;
    width: 2px;
    height: 8px;
    background: black;
    border-radius: 1px;
    z-index: 2;
}

/* Battery text */
#battery-text {
    position: relative;
    z-index: 3;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

/* 5G Signal left of battery */
#signal {
    display: flex;
    align-items: flex-end;
    margin-right: 10px; /* pushes battery slightly right */
}

#signal .bar {
    width: 3px;
    margin: 0 1px;
    background: black;
    border-radius: 1px;
    display: inline-block;
}

#signal .bar:nth-child(1) { height: 4px; }
#signal .bar:nth-child(2) { height: 6px; }
#signal .bar:nth-child(3) { height: 8px; }
#signal .bar:nth-child(4) { height: 10px; }

#signal-text {
    font-size: 10px;
    color: black;
    font-weight: bold;
    margin-left: 1px;
}


/* iOS-style digital clock with green background */
#clock {
    font-family: 'SF Pro Text', 'Helvetica Neue', sans-serif;
    font-size: 48px;           /* 200% bigger than previous 24px */
    font-weight: 600;
    color: white;               /* white text */
    background-color: #34c759; /* green background */
    padding: 8px 16px;          /* adjust padding for bigger text */
    border-radius: 6px;
    flex: 0 0 auto;
    text-align: center;
    order: 0;                   /* keeps clock on far left */
}



/* Chat container */
#imessage-chat-container {
    flex: 1;
    width: 90%;
    background: #f2f2f5;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px;
}

/* Messages */
#imessage-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Input container */
#imessage-input-container {
    display: flex;
    flex: 0 0 auto;
    padding-top: 5px;
}

/* Input field */
#imessage-input {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ccc;
    outline: none;
    font-size: 16px;
}

/* Send button */
#imessage-send {
    margin-left: 10px;
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    background: #34c759;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

/* Message bubbles */
.imessage-msg {
    max-width: 80%;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 15px;
}

/* User bubble (green, right) */
.imessage-msg.user {
    background: #34c759;
    color: white;
    align-self: flex-end;       /* pushes bubble to the right */
    text-align: left;           /* keeps text readable inside */
    border-radius: 20px 20px 4px 20px; /* iMessage style corners */
    margin-left: auto;          /* ensures bubble stays right */
}

/* Bot bubble (gray, left) */
.imessage-msg.bot {
    background: #e5e5ea;
    color: black;
    align-self: flex-start;     /* stays left */
    text-align: left;
    border-radius: 20px 20px 20px 4px;
    margin-right: auto;         /* ensures bubble stays left */
}


/* System messages */
.imessage-msg.system {
    background: #ffdede;
    color: red;
    text-align: center;
    align-self: center;
}

/* Scrollbar */
#imessage-messages::-webkit-scrollbar { width: 6px; }
#imessage-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }

/* Responsive */
@media (max-width: 480px) {
    #iphone-frame { max-width: 90%; padding: 15px 0 8px 0; }
    #iphone-notch { width: 120px; height: 25px; }
    #imessage-input { font-size: 14px; padding: 8px; }
    #imessage-send { padding: 8px 12px; font-size: 14px; }
    .imessage-msg { font-size: 14px; padding: 8px 12px; }
}
