/* LinkedIn Messaging — visual mobile */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --li-blue: #0a66c2;
    --li-blue-hover: #004182;
    --li-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --li-page-bg: #f4f2ee;
    --li-bg: #ffffff;
    --li-border: rgba(0, 0, 0, 0.08);
    --li-text: rgba(0, 0, 0, 0.9);
    --li-text-secondary: rgba(0, 0, 0, 0.6);
    --li-bubble-in: #f3f2ef;
    --li-bubble-out: #dde7f1;
    --li-composer-bg: #ffffff;
    --li-input-bg: #f3f2ef;
    --li-btn-text: #0a66c2;
    --li-online: #057642;
}

html, body {
    height: 100%;
    overflow: hidden;
}

.linkedin-page {
    background: var(--li-page-bg);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    font-family: var(--li-font);
    -webkit-font-smoothing: antialiased;
}

.linkedin-app {
    width: 100%;
    max-width: 430px;
    height: 100vh;
    height: 100dvh;
    background: var(--li-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

/* ===== Header ===== */
.linkedin-header {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 4px 6px 0;
    background: var(--li-bg);
    border-bottom: 1px solid var(--li-border);
    flex-shrink: 0;
    min-height: 56px;
}

.linkedin-header-back {
    color: var(--li-text);
    width: 40px;
    height: 40px;
}

.linkedin-header-back svg { width: 22px; height: 22px; }

.linkedin-header-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.linkedin-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.linkedin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.linkedin-avatar-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    color: var(--li-text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.linkedin-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--li-online);
    border: 2px solid #fff;
    border-radius: 50%;
}

.linkedin-header .chat-header-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--li-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.linkedin-status {
    font-size: 12px;
    color: var(--li-text-secondary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.linkedin-status.is-active {
    color: var(--li-text-secondary);
}

.linkedin-header-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-right: 2px;
}

.linkedin-header .chat-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--li-text-secondary);
    cursor: default;
    text-decoration: none;
}

.linkedin-header .chat-header-btn.is-linked { cursor: pointer; }
.linkedin-header .chat-header-btn.is-linked:active { opacity: 0.65; }
.linkedin-header .chat-header-btn svg { width: 20px; height: 20px; }

.chat-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    text-decoration: none;
    flex-shrink: 0;
}

.chat-header-back.is-linked { cursor: pointer; }

/* ===== Messages ===== */
.linkedin-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--li-bg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
}

.chat-date-divider {
    text-align: center;
    margin: 8px 0 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--li-text-secondary);
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    margin-bottom: 2px;
    animation: liFadeIn 0.22s ease;
}

.chat-msg-in { align-self: flex-start; }
.chat-msg-out { align-self: flex-end; }

@keyframes liFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble {
    background: var(--li-bubble-in);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--li-text);
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-msg-out .chat-bubble {
    background: var(--li-bubble-out);
}

.chat-media {
    max-width: 240px;
    max-height: 320px;
    border-radius: 8px;
    margin-bottom: 4px;
    object-fit: cover;
    display: block;
}

.chat-media-video {
    width: 240px;
    border-radius: 8px;
}

.chat-media-audio {
    width: 100%;
    max-width: 280px;
}

.chat-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
    min-width: 180px;
}

.chat-btn {
    background: var(--li-bg);
    border: 1px solid var(--li-blue);
    padding: 8px 14px;
    border-radius: 24px;
    font-family: var(--li-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--li-btn-text);
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
    width: 100%;
}

.chat-btn:hover:not(:disabled) {
    background: rgba(10, 102, 194, 0.08);
}

.chat-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.chat-typing-wrap {
    align-self: flex-start;
    padding: 4px 0;
}

.chat-typing {
    display: inline-flex;
    align-items: center;
    background: var(--li-bubble-in);
    padding: 10px 14px;
    border-radius: 8px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: #90949c;
    border-radius: 50%;
    animation: liBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes liBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== Composer ===== */
.linkedin-composer {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--li-border);
    background: var(--li-composer-bg);
    flex-shrink: 0;
}

.linkedin-composer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--li-text-secondary);
    flex-shrink: 0;
}

.linkedin-composer-btn svg { width: 20px; height: 20px; }

.linkedin-composer-field {
    flex: 1;
    min-width: 0;
}

.linkedin-composer-input {
    width: 100%;
    border: none;
    background: var(--li-input-bg);
    border-radius: 20px;
    font-family: var(--li-font);
    font-size: 14px;
    color: var(--li-text);
    outline: none;
    padding: 10px 14px;
}

.linkedin-composer-input::placeholder {
    color: var(--li-text-secondary);
}

.linkedin-composer-gif {
    width: auto;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--li-text-secondary);
}

.linkedin-composer-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--li-text-secondary);
    flex-shrink: 0;
}

.linkedin-composer-emoji svg { width: 20px; height: 20px; }

.linkedin-composer-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--li-blue);
    flex-shrink: 0;
}

.linkedin-composer-send svg { width: 22px; height: 22px; }

.linkedin-brand {
    text-align: center;
    padding: 6px;
    font-size: 10px;
    background: var(--li-composer-bg);
    border-top: 1px solid var(--li-border);
}

.linkedin-brand a {
    color: var(--li-text-secondary);
    text-decoration: none;
}

@media (min-width: 768px) {
    .linkedin-page { background: var(--li-page-bg); }
    .linkedin-app { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1); }
}
