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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #F5F0EB;
    min-height: 100vh;
}

/* ========== Page Layout ========== */

.page-layout {
    display: flex;
    min-height: 100vh;
}

.profile-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px 60px 80px;
}

.profile-content {
    max-width: 480px;
}

.profile-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 52px;
    font-weight: 400;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.profile-subtitle {
    font-size: 18px;
    font-weight: 400;
    color: #6b6b6b;
    margin-top: 12px;
    letter-spacing: 0.3px;
}

.profile-divider {
    width: 50px;
    height: 1px;
    background: #c4b8ab;
    margin: 32px 0;
}

.profile-bio p {
    font-size: 15px;
    line-height: 1.75;
    color: #4a4a4a;
    margin-bottom: 16px;
}

.profile-bio p:last-child {
    margin-bottom: 0;
}

.phone-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ========== Phone Container ========== */

.phone-container {
    width: 100%;
    max-width: 400px;
    height: 90vh;
    max-height: 800px;
    background: white;
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    position: relative;
}

/* Status Bar */
.status-bar {
    background: white;
    padding: 8px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid #e5e5e5;
}

/* Chat Header */
.chat-header {
    position: relative;
    background: #f6f6f6;
    padding: 16px 16px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #d1d1d1;
}

.back-button {
    position: absolute;
    left: 16px;
    color: #007AFF;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
}

.back-arrow {
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    margin-top: -1px;
}

.back-text {
    display: inline;
    line-height: 1;
}

.back-badge {
    display: flex;
    background: #007AFF;
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    margin-left: 4px;
    align-items: center;
    justify-content: center;
}

/* When checkpoint screen is visible, hide back text (we're already on Models) */
.checkpoint-visible .back-text {
    display: none;
}

.checkpoint-visible .back-badge {
    display: none;
}

.contact-info {
    text-align: center;
}

.contact-name {
    font-weight: 600;
    font-size: 15px;
}

.header-icons {
    position: absolute;
    right: 16px;
    color: #007AFF;
    font-size: 18px;
}

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: white;
    display: flex;
    flex-direction: column;
}

/* Message Bubbles */
.message {
    display: flex;
    margin-bottom: 8px;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.message.user .message-bubble {
    background: #E5E5EA;
    color: black;
    border-bottom-left-radius: 4px;
}

.message.bot .message-bubble {
    background: #007AFF;
    color: white;
    border-bottom-right-radius: 4px;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.message.bot .message-bubble:hover {
    filter: brightness(1.15);
}

/* Typing Bubble */
.typing-indicator {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
    animation: slideIn 0.3s ease-out;
}

.typing-bubble {
    background: #007AFF;
    padding: 10px 14px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.6;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Reactions */
.reaction {
    position: absolute;
    top: -20px;
    right: -18px;
    background: #007AFF;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    padding-top: 2px;
    animation: reactionPop 0.3s ease-out;
    z-index: 1;
    overflow: visible;
    filter: saturate(1.5) brightness(1.05);
}

.reaction::before {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0px;
    width: 10px;
    height: 10px;
    background: #007AFF;
    border-radius: 50%;
}

.reaction::after {
    content: '';
    position: absolute;
    bottom: -7px;
    right: -3px;
    width: 5px;
    height: 5px;
    background: #007AFF;
    border-radius: 50%;
}

.message.user .reaction {
    right: -8px;
}

@keyframes reactionPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Input Container */
.input-container {
    background: white;
    padding: 8px 12px 20px 12px;
    border-top: 1px solid #e5e5e5;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #F0F0F0;
    border-radius: 20px;
    padding: 6px 6px 6px 12px;
    gap: 8px;
}

.input-icon {
    background: none;
    border: none;
    color: #007AFF;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#message-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 16px;
    padding: 4px 0;
}

.send-button {
    background: #007AFF;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.send-button:hover {
    background: #0051D5;
}

.send-button:disabled {
    background: #B0B0B0;
    cursor: not-allowed;
}

/* Scrollbar */
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 3px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: #b1b1b1;
}

/* Checkpoint Selection Screen */
.checkpoint-screen {
    flex: 1;
    overflow-y: auto;
    background: white;
    display: none;
    flex-direction: column;
}

.checkpoint-screen.visible {
    display: flex;
}

.checkpoint-list {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.checkpoint-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e5e5;
    cursor: pointer;
    transition: background 0.15s;
}

.checkpoint-item:hover {
    background: #f0f0f0;
}

.checkpoint-item.current {
    background: #e8f4ff;
}

.checkpoint-item-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    font-size: 20px;
}

.checkpoint-item-info {
    flex: 1;
}

.checkpoint-item-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.checkpoint-item-date {
    font-size: 13px;
    color: #8e8e93;
}

.checkpoint-item-arrow {
    color: #c7c7cc;
    font-size: 20px;
}

.checkpoint-empty {
    padding: 40px 20px;
    text-align: center;
    color: #8e8e93;
    font-size: 15px;
}

.chat-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* ========== Mobile Tabs ========== */

.mobile-tabs {
    display: none;
}

@media (max-width: 768px) {
    .mobile-tabs {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: #F5F0EB;
        border-bottom: 1px solid #d1d1d1;
    }

    .mobile-tab {
        flex: 1;
        padding: 14px 0;
        border: none;
        background: none;
        font-size: 15px;
        font-weight: 500;
        color: #8e8e93;
        cursor: pointer;
        font-family: inherit;
    }

    .mobile-tab.active {
        color: #007AFF;
        box-shadow: inset 0 -2px 0 #007AFF;
    }

    .page-layout {
        flex-direction: column;
        padding-top: 48px;
    }

    /* Tab switching */
    .page-layout[data-active-tab="chat"] .profile-panel {
        display: none;
    }

    .page-layout[data-active-tab="about"] .phone-panel {
        display: none;
    }

    .page-layout[data-active-tab="about"] .profile-panel {
        display: block;
        padding: 24px 20px;
    }

    /* Phone panel fills screen on mobile */
    .phone-panel {
        padding: 0;
        flex: 1;
        min-height: 0;
    }

    .phone-container {
        max-width: none;
        height: calc(100vh - 48px);
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .status-bar {
        display: none;
    }
}
