/* ============================================================
   LADY HAWK AI — Premium Light Theme v2
   Warm Ivory / Editorial Luxury / Copper Accents
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,600;9..144,700;9..144,800&family=JetBrains+Mono:wght@400;500&display=swap');

.lh-wrap {
    --lh-accent: #6C5CE7;
    --lh-bg: #FDFBF8;
    --lh-white: #FFFFFF;
    --lh-warm: #F8F5F0;
    --lh-cool: #F3F1EC;
    --lh-border: #E6E1D9;
    --lh-border-lt: #EFEBE4;
    --lh-text: #1A1714;
    --lh-text2: #6B645A;
    --lh-text3: #9C958B;
    --lh-muted: #B8B2A8;
    --lh-green: #2D8F6F;
    --lh-green-bg: #E8F5EF;
    --lh-amber: #C4870B;
    --lh-amber-bg: #FFF5E0;
    --lh-red: #C44B4B;
    --lh-red-bg: #FEECEC;
    --lh-accent-bg: #F0EEFF;
    --lh-font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --lh-serif: 'Fraunces', Georgia, serif;
    --lh-mono: 'JetBrains Mono', monospace;
    --lh-ease: cubic-bezier(0.22, 1, 0.36, 1);

    font-family: var(--lh-font);
    background: var(--lh-bg);
    border-radius: 22px;
    border: 1px solid var(--lh-border);
    overflow: hidden;
    max-width: 820px;
    margin: 48px auto;
    display: flex;
    flex-direction: column;
    height: 720px;
    position: relative;
    box-shadow: 0 24px 80px rgba(26,23,20,0.09), 0 4px 12px rgba(26,23,20,0.04);
}

.lh-wrap *, .lh-wrap *::before, .lh-wrap *::after { box-sizing: border-box; }
.lh-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 220px;
    background: linear-gradient(180deg, var(--lh-accent-bg) 0%, transparent 100%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* ---- HEADER ---- */
.lh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: var(--lh-white);
    border-bottom: 1px solid var(--lh-border-lt);
    position: relative;
    z-index: 5;
    flex-shrink: 0;
}
.lh-header-left { display: flex; align-items: center; gap: 14px; }
.lh-avatar {
    width: 46px; height: 46px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--lh-accent), #8B7CF7);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 4px 18px rgba(108,92,231,0.25);
    flex-shrink: 0;
}
.lh-avatar svg { width: 24px; height: 24px; }
.lh-brand {
    font-family: var(--lh-serif);
    font-size: 18px; font-weight: 700;
    color: var(--lh-text);
    letter-spacing: -0.02em;
}
.lh-status {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--lh-text3); font-weight: 500;
}
.lh-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--lh-green);
    animation: lh-pulse 2.5s ease-in-out infinite;
}
@keyframes lh-pulse {
    0%,100% { opacity:1; box-shadow: 0 0 0 0 rgba(45,143,111,0.3); }
    50% { opacity:0.6; box-shadow: 0 0 0 6px rgba(45,143,111,0); }
}
.lh-badge {
    font-size: 11px; font-weight: 600;
    color: var(--lh-accent);
    background: var(--lh-accent-bg);
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid rgba(108,92,231,0.12);
    max-width: 220px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- CHAT AREA ---- */
.lh-chat {
    flex: 1;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    scroll-behavior: smooth;
    background: var(--lh-bg);
}
.lh-chat::-webkit-scrollbar { width: 5px; }
.lh-chat::-webkit-scrollbar-thumb { background: var(--lh-border); border-radius: 10px; }
.lh-chat { scrollbar-width: thin; scrollbar-color: var(--lh-border) transparent; }

/* ---- WELCOME ---- */
.lh-welcome {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100%; padding: 48px 36px; text-align: center;
    position: relative;
    animation: lh-up 0.8s var(--lh-ease) both;
}
@keyframes lh-up { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:translateY(0); } }

.lh-welcome-deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.lh-circle { position: absolute; border-radius: 50%; border: 1px solid var(--lh-border-lt); }
.lh-circle:nth-child(1) { width: 220px; height: 220px; top: -50px; right: -70px; }
.lh-circle:nth-child(2) { width: 150px; height: 150px; bottom: -30px; left: -50px; }
.lh-circle:nth-child(3) { width: 90px; height: 90px; top: 38%; left: 7%; opacity: 0.5; }

.lh-welcome-eagle {
    position: relative; z-index: 1;
    margin-bottom: 24px;
    animation: lh-float 5s ease-in-out infinite;
    filter: drop-shadow(0 10px 28px rgba(108,92,231,0.15));
}
@keyframes lh-float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-10px); } }

.lh-welcome-title {
    font-family: var(--lh-serif);
    font-size: 32px; font-weight: 800;
    color: var(--lh-text);
    margin: 0 0 12px; letter-spacing: -0.03em;
    line-height: 1.2;
    position: relative; z-index: 1;
}
.lh-welcome-sub {
    font-size: 15px; color: var(--lh-text2);
    line-height: 1.8; max-width: 450px;
    margin: 0 0 36px;
    position: relative; z-index: 1;
}

/* Shared primary button */
.lh-btn-primary {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 36px;
    background: linear-gradient(145deg, var(--lh-accent), #8B7CF7);
    color: #fff !important;
    border: none; border-radius: 14px;
    font-family: var(--lh-font);
    font-size: 15px; font-weight: 700;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.4s var(--lh-ease);
    box-shadow: 0 6px 24px rgba(108,92,231,0.3), 0 2px 6px rgba(108,92,231,0.15);
    position: relative; z-index: 1;
}
.lh-btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 36px rgba(108,92,231,0.4); color: #fff !important; }
.lh-btn-primary:active { transform: scale(0.97); }

/* ---- MESSAGES ---- */
.lh-messages {
    padding: 24px 28px;
    display: flex; flex-direction: column; gap: 20px;
    min-height: 100%;
}
.lh-msg {
    display: flex; gap: 12px; max-width: 82%;
    animation: lh-msgIn 0.45s var(--lh-ease) both;
}
@keyframes lh-msgIn { from { opacity:0; transform:translateY(14px) scale(0.97); } to { opacity:1; transform:translateY(0) scale(1); } }

.lh-msg.lh-ai { align-self: flex-start; }
.lh-msg.lh-user { align-self: flex-end; flex-direction: row-reverse; }

.lh-msg-av {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
}
.lh-ai .lh-msg-av {
    background: linear-gradient(145deg, var(--lh-accent), #8B7CF7);
    color: #fff;
    box-shadow: 0 3px 12px rgba(108,92,231,0.2);
}
.lh-ai .lh-msg-av svg { width: 18px; height: 18px; }
.lh-user .lh-msg-av {
    background: var(--lh-warm);
    color: var(--lh-text2);
    border: 1px solid var(--lh-border);
}
.lh-user .lh-msg-av svg { width: 18px; height: 18px; }

.lh-bubble {
    padding: 16px 20px;
    border-radius: 20px;
    line-height: 1.75;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.lh-ai .lh-bubble {
    background: var(--lh-white);
    border: 1px solid var(--lh-border);
    color: var(--lh-text);
    border-top-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(26,23,20,0.04);
}
.lh-user .lh-bubble {
    background: linear-gradient(145deg, var(--lh-accent), #8B7CF7);
    color: #fff;
    border-top-right-radius: 6px;
    box-shadow: 0 4px 18px rgba(108,92,231,0.22);
}
.lh-ai .lh-bubble strong { color: var(--lh-accent); font-weight: 700; }
.lh-user .lh-bubble strong { color: #fff; font-weight: 700; }
.lh-bubble em { font-style: italic; opacity: 0.85; }
.lh-bubble ul, .lh-bubble ol { padding-left: 20px; margin: 8px 0; }
.lh-bubble li { margin-bottom: 5px; }
.lh-bubble code {
    font-family: var(--lh-mono); font-size: 12px;
    background: var(--lh-warm); padding: 2px 7px; border-radius: 5px;
    color: #C4875B; border: 1px solid var(--lh-border-lt);
}
.lh-user .lh-bubble code { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.2); color: #fff; }
.lh-bubble p { margin: 0 0 8px; }
.lh-bubble p:last-child { margin: 0; }
.lh-bubble hr { border: none; border-top: 1px solid var(--lh-border-lt); margin: 14px 0; }

/* ---- TYPING ---- */
.lh-typing { display: flex; align-items: center; gap: 12px; padding: 0 28px 14px; }
.lh-typing-av {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(145deg, var(--lh-accent), #8B7CF7);
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.lh-typing-av svg { width: 18px; height: 18px; }
.lh-typing-dots {
    display: flex; gap: 5px; padding: 14px 18px;
    background: var(--lh-white); border: 1px solid var(--lh-border);
    border-radius: 20px; border-top-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(26,23,20,0.04);
}
.lh-typing-dots span {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--lh-muted);
    animation: lh-bounce 1.4s ease-in-out infinite;
}
.lh-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.lh-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lh-bounce {
    0%,60%,100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ---- INPUT ---- */
.lh-input-area {
    padding: 18px 28px 22px;
    background: var(--lh-white);
    border-top: 1px solid var(--lh-border-lt);
    position: relative; z-index: 5; flex-shrink: 0;
}
.lh-input-wrap {
    display: flex; align-items: flex-end; gap: 10px;
    background: var(--lh-bg);
    border: 1.5px solid var(--lh-border);
    border-radius: 16px;
    padding: 6px 6px 6px 18px;
    transition: all 0.3s ease;
}
.lh-input-wrap:focus-within {
    border-color: var(--lh-accent);
    box-shadow: 0 0 0 4px rgba(108,92,231,0.08);
    background: var(--lh-white);
}
.lh-input {
    flex: 1; background: transparent; border: none;
    color: var(--lh-text); font-family: var(--lh-font);
    font-size: 14px; line-height: 1.5;
    resize: none; max-height: 120px;
    padding: 8px 0; outline: none;
}
.lh-input::placeholder { color: var(--lh-muted); }
.lh-send {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(145deg, var(--lh-accent), #8B7CF7);
    border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.3s var(--lh-ease);
    opacity: 0.35;
}
.lh-send:not(:disabled) { opacity: 1; box-shadow: 0 4px 14px rgba(108,92,231,0.25); }
.lh-send:not(:disabled):hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(108,92,231,0.35); }
.lh-send:disabled { cursor: not-allowed; }

.lh-input-foot { display: flex; justify-content: space-between; padding: 8px 6px 0; }
.lh-charcount { font-size: 11px; color: var(--lh-muted); font-family: var(--lh-mono); }
.lh-powered { font-size: 11px; color: var(--lh-text3); letter-spacing: 0.02em; }
.lh-powered strong { color: var(--lh-accent); font-weight: 700; }

/* ============================================================
   FULL-PAGE RESULTS SCREEN
   ============================================================ */
.lh-results {
    position: absolute; inset: 0; z-index: 50;
    background: var(--lh-bg);
    display: flex; flex-direction: column;
    overflow-y: auto;
    animation: lh-resultsIn 0.7s var(--lh-ease) both;
}
.lh-results::-webkit-scrollbar { width: 5px; }
.lh-results::-webkit-scrollbar-thumb { background: var(--lh-border); border-radius: 10px; }
@keyframes lh-resultsIn { from { opacity:0; transform:scale(0.96); } to { opacity:1; transform:scale(1); } }

.lh-res-header {
    text-align: center; padding: 36px 28px 14px;
    position: relative; overflow: hidden;
}
.lh-res-header::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, var(--lh-accent-bg) 0%, transparent 100%);
    pointer-events: none;
}
.lh-res-eagle {
    display: block; margin: 0 auto 10px;
    position: relative; z-index: 1;
    filter: drop-shadow(0 8px 20px rgba(108,92,231,0.2));
    animation: lh-pop 0.8s var(--lh-ease) both;
    animation-delay: 0.3s;
}
.lh-res-eagle svg { width: 72px; height: 72px; }
@keyframes lh-pop {
    from { opacity:0; transform:scale(0.3) rotate(-20deg); }
    60% { transform:scale(1.15) rotate(5deg); }
    to { opacity:1; transform:scale(1) rotate(0); }
}
.lh-res-title {
    font-family: var(--lh-serif);
    font-size: 28px; font-weight: 800;
    color: var(--lh-text); margin: 0 0 4px;
    letter-spacing: -0.03em; position: relative; z-index: 1;
}
.lh-res-subtitle {
    font-size: 14px; color: var(--lh-text2);
    margin: 0; position: relative; z-index: 1;
}

/* Score Ring */
.lh-ring-wrap { display: flex; justify-content: center; padding: 20px 0 10px; }
.lh-ring {
    position: relative; width: 150px; height: 150px;
    animation: lh-up 0.6s var(--lh-ease) both;
    animation-delay: 0.4s;
}
.lh-ring svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.lh-ring-bg { fill: none; stroke: var(--lh-border-lt); stroke-width: 10; }
.lh-ring-fill {
    fill: none; stroke: var(--lh-accent); stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 408; stroke-dashoffset: 408;
    transition: stroke-dashoffset 1.6s var(--lh-ease);
}
.lh-ring-fill.lh-high { stroke: var(--lh-green); }
.lh-ring-fill.lh-mid  { stroke: var(--lh-amber); }
.lh-ring-fill.lh-low  { stroke: var(--lh-red); }

.lh-score-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.lh-score-num {
    font-family: var(--lh-serif);
    font-size: 44px; font-weight: 800;
    color: var(--lh-text); line-height: 1;
    letter-spacing: -0.03em;
}
.lh-score-label {
    font-size: 11px; color: var(--lh-text3);
    font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; margin-top: 4px;
}

/* Results Body */
.lh-res-body {
    padding: 14px 28px 8px;
    display: flex; flex-direction: column; gap: 14px; flex: 1;
}

.lh-appreciation {
    background: linear-gradient(145deg, var(--lh-accent-bg), #F5F0FF);
    border: 1px solid rgba(108,92,231,0.12);
    border-radius: 16px; padding: 20px 22px; text-align: center;
}
.lh-appreciation h3 {
    font-family: var(--lh-serif);
    font-size: 17px; font-weight: 700;
    color: var(--lh-accent); margin: 0 0 4px;
}
.lh-appreciation p {
    font-size: 13px; color: var(--lh-text2); margin: 0;
}

.lh-res-card {
    background: var(--lh-white);
    border: 1px solid var(--lh-border);
    border-radius: 16px; padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(26,23,20,0.03);
}
.lh-res-card-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.lh-res-card-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.lh-res-card-icon.lh-ic-str { background: var(--lh-green-bg); }
.lh-res-card-icon.lh-ic-imp { background: var(--lh-amber-bg); }
.lh-res-card-icon.lh-ic-rec { background: var(--lh-accent-bg); }
.lh-res-card-title { font-size: 14px; font-weight: 700; color: var(--lh-text); margin: 0; }
.lh-res-card-body {
    font-size: 13px; line-height: 1.75; color: var(--lh-text2);
}
.lh-res-card-body p { margin: 0 0 6px; }
.lh-res-card-body p:last-child { margin: 0; }
.lh-res-card-body strong { color: var(--lh-text); font-weight: 600; }
.lh-res-card-body ul { padding-left: 18px; margin: 6px 0; }
.lh-res-card-body li { margin-bottom: 4px; }

/* Results Actions */
.lh-res-actions {
    display: flex; gap: 12px; justify-content: center;
    padding: 18px 28px 30px;
}
.lh-btn-outline {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 24px;
    background: var(--lh-white); color: var(--lh-text);
    border: 1.5px solid var(--lh-border); border-radius: 14px;
    font-family: var(--lh-font); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease;
}
.lh-btn-outline:hover { background: var(--lh-warm); border-color: var(--lh-accent); }

/* ---- LOGIN ---- */
.lh-login { height: 360px; }
.lh-login-inner {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100%; text-align: center; padding: 40px;
}
.lh-login-eagle { margin-bottom: 16px; }
.lh-login-eagle svg { width: 70px; height: 70px; }
.lh-login-inner h3 {
    font-family: var(--lh-serif);
    font-size: 22px; font-weight: 800;
    color: var(--lh-text); margin: 0 0 8px;
}
.lh-login-inner p { font-size: 14px; color: var(--lh-text2); margin: 0 0 24px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
    .lh-wrap { margin: 12px; height: 92vh; border-radius: 16px; }
    .lh-header { padding: 14px 18px; }
    .lh-badge { display: none; }
    .lh-messages { padding: 18px; }
    .lh-msg { max-width: 90%; }
    .lh-input-area { padding: 14px 18px 18px; }
    .lh-welcome-title { font-size: 26px; }
    .lh-welcome { padding: 32px 22px; }
    .lh-res-header { padding: 26px 18px 10px; }
    .lh-res-body { padding: 10px 18px 8px; }
    .lh-res-title { font-size: 22px; }
    .lh-ring, .lh-ring svg { width: 120px; height: 120px; }
    .lh-score-num { font-size: 36px; }
    .lh-res-actions { flex-direction: column; padding: 12px 18px 20px; }
    .lh-btn-primary, .lh-btn-outline { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .lh-wrap *, .lh-wrap *::before, .lh-wrap *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
