/* ============================================================
   James Chat — Luxury Boutique Design
   ============================================================ */

:root {
    --j-bg: #0f0f0f;
    --j-surface: #1a1a1a;
    --j-surface-light: #222;
    --j-gold: #c9a96e;
    --j-gold-dim: #a08050;
    --j-gold-glow: rgba(201,169,110,0.1);
    --j-text: #e8e0d4;
    --j-text-muted: #8a7e6e;
    --j-border: #2a2520;
    --j-user-bg: #c9a96e;
    --j-user-text: #1a1a1a;
    --j-james-bg: #1e1c18;
    --j-james-border: #2a2520;
}

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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--j-bg); color: var(--j-text);
    height: 100vh; display: flex; flex-direction: column;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #1a1812 0%, #0f0f0f 100%);
    padding: 20px 20px; display: flex; align-items: center; gap: 16px;
    border-bottom: 1px solid var(--j-border);
}
.chat-avatar {
    width: 120px; height: 120px; border-radius: 50%;
    border: 3px solid var(--j-gold);
    overflow: hidden; flex-shrink: 0;
    box-shadow: 0 0 30px var(--j-gold-glow);
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-header-info h1 {
    font-size: 26px; font-weight: 700; color: var(--j-gold);
    font-family: 'Georgia', serif; letter-spacing: 0.05em;
}
.chat-header-info p { font-size: 14px; color: var(--j-text-muted); letter-spacing: 0.03em; }

/* Messages */
.chat-messages {
    flex: 1; overflow-y: auto; padding: 20px;
    display: flex; flex-direction: column; gap: 14px;
    background: radial-gradient(ellipse at top, #151210 0%, #0f0f0f 70%);
}

.msg {
    max-width: 82%; padding: 14px 18px; font-size: 14px; line-height: 1.7;
    animation: msgIn 0.4s ease; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
@keyframes msgIn { from { transform: translateY(12px); opacity: 0; } }

.msg-james {
    background: var(--j-james-bg);
    border: 1px solid var(--j-james-border);
    border-radius: 2px 16px 16px 16px;
    align-self: flex-start; color: var(--j-text);
}
.msg-james .msg-name {
    font-size: 10px; font-weight: 600; color: var(--j-gold);
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px;
    font-family: 'Georgia', serif;
}

.msg-user {
    background: var(--j-user-bg); color: var(--j-user-text);
    border-radius: 16px 16px 2px 16px;
    align-self: flex-end; font-weight: 500;
}

.msg-system {
    background: var(--j-gold-glow); border: 1px solid var(--j-gold-dim);
    border-radius: 12px; align-self: center; text-align: center;
    font-size: 12px; color: var(--j-gold); padding: 10px 20px;
}

.msg-image { max-width: 200px; border-radius: 8px; margin-top: 8px; }

/* Recommendation Card */
.msg-recommendation {
    background: linear-gradient(135deg, #1e1c18, #252015);
    border: 1px solid var(--j-gold-dim);
    border-radius: 12px; padding: 20px; margin-top: 10px; text-align: center;
}
.msg-recommendation .rec-size {
    font-size: 32px; font-weight: 800; color: var(--j-gold);
    font-family: 'Georgia', serif;
}

/* Typing */
.typing {
    align-self: flex-start; padding: 14px 20px;
    background: var(--j-james-bg); border: 1px solid var(--j-james-border);
    border-radius: 2px 16px 16px 16px;
}
.typing-dots { display: flex; gap: 5px; }
.typing-dots span {
    width: 7px; height: 7px; background: var(--j-gold-dim);
    border-radius: 50%; animation: blink 1.4s infinite both;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* Input */
.chat-input-area {
    background: var(--j-surface);
    border-top: 1px solid var(--j-border);
    padding: 14px 16px; display: flex; gap: 10px; align-items: flex-end;
}
.chat-input {
    flex: 1; border: 1px solid var(--j-border); border-radius: 24px;
    padding: 11px 18px; font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    outline: none; resize: none; max-height: 100px; line-height: 1.4;
    background: var(--j-surface-light); color: var(--j-text);
}
.chat-input:focus { border-color: var(--j-gold-dim); }
.chat-input::placeholder { color: var(--j-text-muted); }

.chat-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.chat-btn-send { background: var(--j-gold); color: var(--j-bg); }
.chat-btn-send:hover { background: #d4b47a; }
.chat-btn-img { background: var(--j-surface-light); color: var(--j-text-muted); }
.chat-btn-img:hover { background: var(--j-border); color: var(--j-gold); }

/* Quick Actions */
.chat-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.quick-btn {
    padding: 7px 16px; border: 1px solid var(--j-border); border-radius: 20px;
    background: var(--j-surface-light); font-size: 13px; cursor: pointer;
    transition: all 0.2s; font-family: -apple-system, sans-serif;
    color: var(--j-text-muted);
}
.quick-btn:hover { border-color: var(--j-gold); color: var(--j-gold); background: var(--j-gold-glow); }

/* Body Shape Selector */
.sil-btn {
    border-color: var(--j-border) !important; background: var(--j-surface-light) !important;
}
.sil-btn span { color: var(--j-text-muted) !important; }
.sil-btn:hover { border-color: var(--j-gold) !important; }
.sil-btn.active { border-color: var(--j-gold) !important; background: var(--j-gold-glow) !important; }
.sil-btn img { filter: invert(0.85); }

/* Container */
@media (min-width: 600px) {
    body { align-items: center; justify-content: center; padding: 20px; background: #080808; }
    .chat-container {
        width: 100%; max-width: 480px; height: 92vh; max-height: 850px;
        border-radius: 20px; overflow: hidden;
        box-shadow: 0 0 60px rgba(201,169,110,0.08), 0 20px 50px rgba(0,0,0,0.5);
        display: flex; flex-direction: column;
        border: 1px solid var(--j-border);
    }
}
@media (max-width: 599px) {
    .chat-container { height: 100dvh; display: flex; flex-direction: column; }
    .chat-messages { flex: 1; min-height: 0; }
    .chat-input-area {
        position: sticky; bottom: 0; z-index: 10;
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
    .chat-header { flex-shrink: 0; }
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--j-border); border-radius: 2px; }
