/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: '-apple-system', 'BlinkMacSystemFont', 'Pretendard', sans-serif;
}

body {
    background-color: #f2f2f7; /* iOS background color */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* iPhone Container */
.iphone-container {
    width: 100%;
    max-width: 430px; /* iPhone Pro Max width */
    height: 100vh;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Desktop framing for larger screens */
@media (min-width: 431px) {
    .iphone-container {
        height: 850px;
        max-height: 95vh;
        border-radius: 40px;
        border: 12px solid #1a1a1a;
        margin: 20px 0;
    }
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 14px 24px 8px;
    font-size: 14px;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.icons {
    display: flex;
    gap: 6px;
    font-size: 12px;
}

/* Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 16px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    z-index: 10;
    position: relative;
}

.back-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #FFB6C1; /* Baby pink theme tint */
    font-weight: 300;
    cursor: pointer;
    line-height: 0;
    margin-top: -5px;
    padding-right: 15px;
}

.facetime-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #FFB6C1;
    cursor: pointer;
    padding-left: 15px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 4px;
}

.name {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge {
    color: #c7c7cc;
    font-size: 14px;
}

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

/* Chat Area */
.chat-container {
    flex-grow: 1;
    padding: 20px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    scroll-behavior: smooth;
}

.timestamp {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: #8e8e93;
    margin: 24px 0 16px;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
    position: relative;
    max-width: 75%;
}

.received {
    align-self: flex-start;
}

.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.bubble {
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
    position: relative;
    letter-spacing: -0.3px;
}

/* Received (Gray) Bubble */
.gray-bubble {
    background-color: #e9e9eb;
    color: #000000;
    border-bottom-left-radius: 4px;
}

/* Album Cover Image in Bubble */
.album-cover {
    width: 100%;
    max-width: 250px;
    border-radius: 12px;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Sent (Pink) Bubble - maintaining aesthetic */
.pink-bubble {
    background-color: #FFB6C1; 
    color: #1a1a1a; 
    border-bottom-right-radius: 4px;
}

/* Message grouping gap */
.received + .sent, 
.sent + .received {
    margin-top: 16px;
}

.read-receipt {
    font-size: 11px;
    color: #8e8e93;
    margin-top: 4px;
    font-weight: 500;
    padding-right: 4px;
}

.bottom-padding {
    height: 40px;
    flex-shrink: 0;
}

/* Input Area */
.chat-input-area {
    padding: 12px 16px 24px;
    background-color: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
}

.plus-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #e9e9eb;
    color: #8e8e93;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 300;
    padding-bottom: 2px;
}

.input-box {
    flex-grow: 1;
    height: 36px;
    border-radius: 18px;
    border: 1px solid #e5e5ea;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
}

.placeholder {
    color: #c7c7cc;
    font-size: 15px;
}

.dictation {
    color: #8e8e93;
    font-size: 16px;
}

/* Animations */
@keyframes fadeInBubble {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Custom Scrollbar to look like iOS */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
}
