/* === WTT AI Chat + Couples Persona + Mobile Fixes ===
 * Append to: assets/css/city-guide.css
 */


/* == AI Nav Badge == */

.city-nav-link--ai {
    position: relative;
}

.ai-nav-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    background: linear-gradient(135deg, #4a8c65, #2d5c42);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 5px;
    letter-spacing: .04em;
    vertical-align: middle;
    position: relative;
    top: -1px;
}


/* == AI Chat Wrapper == */

.wtt-ai-chat-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 680px;
}

.ai-chat-intro {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(26,58,42,.06), rgba(74,140,101,.04));
    border: 1px solid rgba(26,58,42,.12);
    border-radius: 12px;
}

.ai-orb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a8c65, #2d5c42);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 0 4px rgba(74,140,101,.15);
    animation: wtt-pulse 2.5s infinite;
}

@keyframes wtt-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(74,140,101,.15); }
    50%       { box-shadow: 0 0 0 8px rgba(74,140,101,.05); }
}

.ai-intro-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--wtt-green);
    margin-bottom: 4px;
}

.ai-intro-sub {
    font-size: 13.5px;
    color: var(--wtt-text-mid);
    line-height: 1.55;
    margin: 0;
}


/* == Suggested Questions == */

.ai-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-suggestion {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid var(--wtt-border);
    background: var(--wtt-cream);
    color: var(--wtt-text-mid);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
}

.ai-suggestion:hover {
    background: var(--wtt-sand);
    border-color: var(--wtt-green-light);
    color: var(--wtt-green);
}

.ai-suggestions.hidden {
    display: none;
}


/* == Chat Messages == */

.ai-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.ai-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.ai-msg-user {
    flex-direction: row-reverse;
}

.ai-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.ai-bubble-user {
    background: var(--wtt-green);
    color: #fff;
    border-radius: 12px 12px 3px 12px;
}

.ai-bubble-bot {
    background: #fff;
    color: var(--wtt-text);
    border: 1px solid var(--wtt-border);
    border-radius: 12px 12px 12px 3px;
    box-shadow: 0 1px 4px rgba(26,58,42,.06);
}

.ai-bubble-bot p { margin-bottom: 8px; }
.ai-bubble-bot p:last-child { margin-bottom: 0; }
.ai-bubble-bot strong { font-weight: 600; color: var(--wtt-green); }

.ai-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a8c65, #2d5c42);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-avatar-user {
    background: var(--wtt-terracotta);
}

/* Typing indicator */
.ai-typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 16px;
}

.ai-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--wtt-text-light);
    animation: wtt-bounce .9s infinite;
}

.ai-typing-dots span:nth-child(2) { animation-delay: .15s; }
.ai-typing-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes wtt-bounce {
    0%, 100% { transform: translateY(0); opacity: .4; }
    50%       { transform: translateY(-5px); opacity: 1; }
}


/* == Counter Bar == */

.ai-counter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.ai-counter-dots {
    display: flex;
    gap: 5px;
}

.ai-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--wtt-sand-dark);
    transition: background .3s;
}

.ai-dot.used {
    background: var(--wtt-terracotta);
}

.ai-counter-text {
    font-size: 12px;
    color: var(--wtt-text-light);
}


/* == Account Gate == */

.ai-gate {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: var(--wtt-sand);
    border: 1px solid var(--wtt-sand-dark);
    border-radius: 12px;
}

.ai-gate-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-gate-body h4 {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--wtt-green);
    margin-bottom: 6px;
}

.ai-gate-body p {
    font-size: 13.5px;
    color: var(--wtt-text-mid);
    line-height: 1.6;
    margin-bottom: 12px;
}

.ai-gate-btn {
    display: inline-block;
    background: var(--wtt-green);
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    padding: 9px 20px;
    border-radius: 8px;
    text-decoration: none;
    margin-right: 12px;
    margin-bottom: 4px;
}

.ai-gate-btn:hover {
    background: var(--wtt-green-mid);
    color: #fff;
}

.ai-gate-login {
    font-size: 13px;
    color: var(--wtt-green-mid);
    text-decoration: underline;
}


/* == AI Input == */

.ai-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-input {
    flex: 1;
    border: 1.5px solid var(--wtt-border, rgba(26,58,42,.12));
    border-radius: 10px;
    padding: 11px 16px;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 14px;
    color: #1a1a1a !important;
    background: #ffffff !important;
    transition: border-color .15s;
}

.ai-input:focus {
    outline: none;
    border-color: var(--wtt-green-light);
    box-shadow: 0 0 0 3px rgba(74,140,101,.1);
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--wtt-green);
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    flex-shrink: 0;
}

.ai-send-btn:hover {
    background: var(--wtt-green-mid);
}

.ai-send-btn:disabled {
    background: var(--wtt-text-light);
    cursor: not-allowed;
}


/* == Couples Persona Tip Box == */

.ptip-couples {
    background: #fdf2f8;
    border-left-color: #b45fa0;
}

.ptip-couples .ptip-heading { color: #7a2a6a; }


/* == Mobile Fixes == */

/* Fix 1: Persona pills horizontal scroll on mobile -- no stacking */
@media (max-width: 768px) {
    .persona-pills {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .persona-pills::-webkit-scrollbar { display: none; }
    .persona-pill { white-space: nowrap; flex-shrink: 0; }

    /* Fix 2: Persona bar label goes above pills on mobile */
    .persona-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Fix 3: On mobile, persona tips come BEFORE sidebar widgets */
    .city-layout {
        grid-template-columns: 1fr;
    }

    /* Sidebar moves below main, but persona tips stay in main above tab body */
    .city-sidebar {
        order: 2;
        position: static;
        max-height: none;
        overflow-y: visible;
        padding: 0 0 32px;
    }

    .city-main {
        order: 1;
        border-right: none;
        padding-right: 0;
    }

    /* AI chat on mobile */
    .wtt-ai-chat-wrap {
        max-width: 100%;
    }

    .ai-suggestions {
        gap: 6px;
    }

    .ai-suggestion {
        font-size: 12px;
        padding: 6px 12px;
    }

    .ai-bubble {
        max-width: 92%;
        font-size: 13px;
    }
}


/* == Homepage AI section (used in template-homepage.php) == */

.hp-ai-section {
    background: linear-gradient(135deg, #1a3a2a 0%, #0e2018 100%);
    padding: 52px 0;
    position: relative;
    overflow: hidden;
}

.hp-ai-section::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74,140,101,.2), transparent 70%);
    pointer-events: none;
}

.hp-ai-in {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 48px;
    text-align: center;
}

.hp-ai-orb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a8c65, #2d5c42);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 0 0 8px rgba(74,140,101,.15);
    animation: wtt-pulse 2.5s infinite;
}

.hp-ai-eyebrow {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,.5);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.hp-ai-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.hp-ai-sub {
    font-size: 15px;
    color: rgba(255,255,255,.65);
    line-height: 1.65;
    margin-bottom: 28px;
}

.hp-ai-suggestions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.hp-ai-suggestion {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.85);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}

.hp-ai-suggestion:hover {
    background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.4);
    color: #fff;
}

.hp-ai-input-row {
    display: flex;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto 12px;
}

.hp-ai-input {
    flex: 1;
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: 10px;
    padding: 12px 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #ffffff !important;
    background: rgba(255,255,255,.18) !important;
    -webkit-text-fill-color: #ffffff;
    transition: border-color .15s;
}

.hp-ai-input::placeholder { color: rgba(255,255,255,.4); }
.hp-ai-input:focus {
    outline: none;
    border-color: rgba(255,255,255,.5);
    background: rgba(255,255,255,.15);
}

.hp-ai-send {
    background: var(--wtt-terracotta);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}

.hp-ai-send:hover { background: var(--wtt-terracotta-lt); }

.hp-ai-response {
    max-width: 560px;
    margin: 0 auto;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    padding: 16px 20px;
    text-align: left;
    font-size: 14px;
    color: rgba(255,255,255,.88);
    line-height: 1.65;
    display: none;
}

.hp-ai-city-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--wtt-terracotta-lt);
    text-decoration: none;
    font-weight: 500;
}

.hp-ai-city-link:hover { color: #fff; text-decoration: underline; }

.hp-ai-note {
    font-size: 12px;
    color: rgba(255,255,255,.35);
    margin-top: 14px;
}

@media (max-width: 768px) {
    .hp-ai-in { padding: 0 20px; }
    .hp-ai-suggestions { gap: 6px; }
    .hp-ai-suggestion { font-size: 12px; padding: 6px 12px; }
    .hp-ai-input-row { flex-direction: column; }
}

/* === HERO AI BLOCK (replaces search bar on homepage) === */

.hp-hero-ai {
    max-width: 580px;
    margin-bottom: 18px;
}

.hp-hero-ai-suggestions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.hp-hero-ai-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.88);
    font-family: 'DM Sans', sans-serif;
    font-size: 12.5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.hp-hero-ai-pill:hover {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.5);
    color: #fff;
}

.hp-hero-ai-input-row {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,.14);
    border: 1.5px solid rgba(255,255,255,.3);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.hp-hero-ai-orb {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #4a8c65, #2d5c42);
    margin: 4px 0 4px 6px;
    border-radius: 7px;
}

.hp-hero-ai-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 11px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.hp-hero-ai-input::placeholder {
    color: rgba(255,255,255,.5);
}

.hp-hero-ai-send {
    background: #c4622d;
    color: #fff;
    border: none;
    padding: 0 20px;
    height: 100%;
    min-height: 44px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    border-radius: 0;
}

.hp-hero-ai-send:hover { background: #e07a45; }
.hp-hero-ai-send:disabled { background: rgba(255,255,255,.2); cursor: not-allowed; }

.hp-hero-ai-response {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13.5px;
    color: rgba(255,255,255,.92);
    line-height: 1.65;
    margin-bottom: 8px;
}

.hp-hero-ai-response strong { color: #fff; font-weight: 600; }
.hp-hero-ai-response a { color: #e07a45; }

.hp-hero-ai-note {
    font-size: 11px;
    color: rgba(255,255,255,.4);
}

@media (max-width: 768px) {
    .hp-hero-ai { max-width: 100%; }
    .hp-hero-ai-suggestions { gap: 5px; }
    .hp-hero-ai-pill { font-size: 11.5px; padding: 5px 11px; }
    .hp-hero-ai-input { font-size: 13px; }
}

/* === ABSOLUTE COLOR OVERRIDES - cannot be inherited away === */
input.ai-input,
input.ai-input:focus,
input.ai-input:active,
input.ai-input:hover {
    color: #1a1a1a !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #1a1a1a !important;
    caret-color: #1a1a1a !important;
    opacity: 1 !important;
}

input.hp-hero-ai-input,
input.hp-hero-ai-input:focus,
input.hp-hero-ai-input:active {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    background: transparent !important;
    opacity: 1 !important;
}

/* === MOBILE PERSONA PILLS - horizontal scroll, no wrapping === */
@media (max-width: 768px) {
    .persona-pills {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 6px;
        gap: 6px;
        /* Fade edges to indicate scrollability */
        -webkit-mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
    }
    .persona-pills::-webkit-scrollbar {
        display: none;
    }
    .persona-pill {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
}
