/**
 * AI Widget Stylesheet — Kamdhenu AI Counselor Suite
 *
 * Phase:   05A — Conversation Engine
 * Version: 1.5.0
 *
 * All selectors are namespaced with `.kamdhenu-widget-` to prevent
 * conflicts with theme CSS. No !important except for position/z-index
 * where WordPress theme resets make it unavoidable.
 *
 * @package KamdhenuAICounselorSuite\Modules\AIWidget
 * @since   1.5.0
 */

/* =========================================================
   CSS CUSTOM PROPERTIES
   ========================================================= */

:root {
    --kw-primary:            #4f46e5;
    --kw-primary-dark:       #3730a3;
    --kw-primary-light:      #a5b4fc;
    --kw-secondary:          #7c3aed;
    --kw-accent:             #ec4899;
    --kw-success:            #10b981;
    --kw-surface:            #ffffff;
    --kw-surface-alt:        #f8f7ff;
    --kw-surface-chat:       #f3f4f6;
    --kw-text:               #1e1b4b;
    --kw-text-muted:         #6b7280;
    --kw-text-light:         #9ca3af;
    --kw-border:             rgba(79, 70, 229, 0.15);
    --kw-shadow-sm:          0 2px 8px rgba(79, 70, 229, 0.12);
    --kw-shadow-md:          0 8px 32px rgba(79, 70, 229, 0.18);
    --kw-shadow-lg:          0 20px 60px rgba(79, 70, 229, 0.24);
    --kw-radius-sm:          8px;
    --kw-radius-md:          16px;
    --kw-radius-lg:          24px;
    --kw-radius-full:        9999px;
    --kw-launcher-size:      68px;
    --kw-popup-width:        360px;
    --kw-popup-height:       540px;
    --kw-bottom-offset:      28px;
    --kw-right-offset:       28px;
    --kw-z-launcher:         999990;
    --kw-z-popup:            999989;
    --kw-z-tooltip:          999991;
    --kw-transition:         0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    --kw-transition-fast:    0.18s ease;
    --kw-transition-smooth:  0.25s ease;
    --kw-bubble-user-bg:     #4f46e5;
    --kw-bubble-user-text:   #ffffff;
    --kw-bubble-ai-bg:       #f3f4f6;
    --kw-bubble-ai-text:     #1e1b4b;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes kw-pulse-ring {
    0%   { transform: scale(1);    opacity: 0.8; }
    70%  { transform: scale(1.55); opacity: 0;   }
    100% { transform: scale(1.55); opacity: 0;   }
}

@keyframes kw-pulse-ring-2 {
    0%   { transform: scale(1);    opacity: 0.5; }
    100% { transform: scale(1.75); opacity: 0;   }
}

@keyframes kw-launcher-enter {
    0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg);    opacity: 1; }
}

@keyframes kw-popup-enter {
    0%   { opacity: 0; transform: translateY(20px) scale(0.94); }
    100% { opacity: 1; transform: translateY(0)    scale(1);    }
}

@keyframes kw-popup-exit {
    0%   { opacity: 1; transform: translateY(0)    scale(1);    }
    100% { opacity: 0; transform: translateY(20px) scale(0.94); }
}

@keyframes kw-dot-blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40%           { opacity: 1;   transform: scale(1.1); }
}

@keyframes kw-badge-pop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes kw-bubble-in {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes kw-slide-in {
    0%   { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes kw-fade-in {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes kw-online-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50%       { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

/* =========================================================
   LAUNCHER BUTTON
   ========================================================= */

.kamdhenu-widget-launcher {
    position: fixed;
    bottom: var(--kw-bottom-offset);
    right:  var(--kw-right-offset);
    width:  var(--kw-launcher-size);
    height: var(--kw-launcher-size);
    z-index: var(--kw-z-launcher);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    animation: kw-launcher-enter 0.6s var(--kw-transition) both;
    animation-delay: 0.8s;
}

/* Pulse ring 1 */
.kamdhenu-widget-launcher::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--kw-radius-full);
    background: var(--kw-primary);
    animation: kw-pulse-ring 2s ease-out infinite;
    animation-delay: 1.4s;
}

/* Pulse ring 2 */
.kamdhenu-widget-launcher::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: var(--kw-radius-full);
    background: var(--kw-primary);
    opacity: 0.25;
    animation: kw-pulse-ring-2 2s ease-out infinite;
    animation-delay: 1.4s;
}

.kamdhenu-widget-launcher--open::before,
.kamdhenu-widget-launcher--open::after {
    animation: none;
}

.kamdhenu-widget-launcher__inner {
    position: relative;
    z-index: 1;
    width: var(--kw-launcher-size);
    height: var(--kw-launcher-size);
    border-radius: var(--kw-radius-full);
    overflow: hidden;
    box-shadow: var(--kw-shadow-md), 0 0 0 3px #fff, 0 0 0 5px var(--kw-primary-light);
    transition: transform var(--kw-transition), box-shadow var(--kw-transition);
    background: linear-gradient(135deg, var(--kw-primary), var(--kw-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
}

.kamdhenu-widget-launcher:hover .kamdhenu-widget-launcher__inner {
    transform: scale(1.08);
    box-shadow: var(--kw-shadow-lg), 0 0 0 3px #fff, 0 0 0 5px var(--kw-primary);
}

.kamdhenu-widget-launcher__avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--kw-radius-full);
    display: block;
    transition: opacity var(--kw-transition-fast);
}

.kamdhenu-widget-launcher__avatar--fallback {
    width: 100%;
    height: 100%;
    border-radius: var(--kw-radius-full);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kamdhenu-widget-launcher__close-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity var(--kw-transition-fast);
    pointer-events: none;
}

.kamdhenu-widget-launcher__close-icon svg {
    width: 24px;
    height: 24px;
}

.kamdhenu-widget-launcher--open .kamdhenu-widget-launcher__avatar,
.kamdhenu-widget-launcher--open .kamdhenu-widget-launcher__avatar--fallback {
    opacity: 0;
}

.kamdhenu-widget-launcher--open .kamdhenu-widget-launcher__close-icon {
    opacity: 1;
}

/* Online status badge */
.kamdhenu-widget-launcher__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--kw-success);
    border: 2.5px solid #fff;
    border-radius: var(--kw-radius-full);
    z-index: 2;
    animation: kw-online-pulse 2.5s ease-in-out infinite, kw-badge-pop 0.4s ease both;
    animation-delay: 0s, 1.4s;
}

/* Tooltip */
.kamdhenu-widget-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    bottom: 50%;
    transform: translateY(50%);
    white-space: nowrap;
    background: var(--kw-text);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    padding: 8px 14px;
    border-radius: var(--kw-radius-sm);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: var(--kw-z-tooltip);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.kamdhenu-widget-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--kw-text);
}

.kamdhenu-widget-launcher:not(.kamdhenu-widget-launcher--open):hover .kamdhenu-widget-tooltip {
    opacity: 1;
}

/* =========================================================
   POPUP CARD
   ========================================================= */

.kamdhenu-widget-popup {
    position: fixed;
    bottom: calc(var(--kw-bottom-offset) + var(--kw-launcher-size) + 16px);
    right: var(--kw-right-offset);
    width: var(--kw-popup-width);
    background: var(--kw-surface);
    border-radius: var(--kw-radius-lg);
    box-shadow: var(--kw-shadow-lg);
    overflow: hidden;
    z-index: var(--kw-z-popup);
    display: flex;
    flex-direction: column;
    max-height: var(--kw-popup-height);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 1px solid var(--kw-border);
    /* Hidden by default — JS toggles visibility */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px) scale(0.94);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.kamdhenu-widget-popup--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* =========================================================
   POPUP HEADER
   ========================================================= */

.kamdhenu-widget-popup__header {
    background: linear-gradient(135deg, var(--kw-primary) 0%, var(--kw-secondary) 100%);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    position: relative;
}

.kamdhenu-widget-popup__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.kamdhenu-widget-popup__avatar {
    width: 46px;
    height: 46px;
    border-radius: var(--kw-radius-full);
    border: 2.5px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
    display: block;
    background: rgba(255, 255, 255, 0.2);
}

.kamdhenu-widget-popup__avatar--fallback {
    width: 46px;
    height: 46px;
    border-radius: var(--kw-radius-full);
    border: 2.5px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.kamdhenu-widget-popup__online {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: var(--kw-success);
    border: 2px solid var(--kw-primary);
    border-radius: var(--kw-radius-full);
    animation: kw-online-pulse 2.5s ease-in-out infinite;
}

.kamdhenu-widget-popup__info {
    flex: 1;
    min-width: 0;
}

.kamdhenu-widget-popup__name {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    letter-spacing: -0.01em;
}

.kamdhenu-widget-popup__title {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 400;
    margin: 2px 0 0;
}

.kamdhenu-widget-popup__online-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

.kamdhenu-widget-popup__online-label::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--kw-success);
    border-radius: var(--kw-radius-full);
    display: inline-block;
    animation: kw-online-pulse 2.5s ease-in-out infinite;
}

.kamdhenu-widget-popup__close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: var(--kw-radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--kw-transition-fast);
    flex-shrink: 0;
    padding: 0;
}

.kamdhenu-widget-popup__close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.kamdhenu-widget-popup__close svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* =========================================================
   POPUP BODY — SCREEN CONTAINER
   ========================================================= */

.kamdhenu-widget-popup__body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* =========================================================
   SCREEN: WELCOME
   ========================================================= */

.kamdhenu-screen {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: kw-fade-in 0.25s ease both;
}

.kamdhenu-screen--active {
    display: flex;
}

.kamdhenu-welcome {
    flex: 1;
    padding: 28px 22px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.kamdhenu-welcome__avatar-wrap {
    position: relative;
    margin-bottom: 18px;
}

.kamdhenu-welcome__avatar {
    width: 88px;
    height: 88px;
    border-radius: var(--kw-radius-full);
    border: 3px solid var(--kw-primary-light);
    object-fit: cover;
    display: block;
    box-shadow: var(--kw-shadow-md);
}

.kamdhenu-welcome__avatar--fallback {
    width: 88px;
    height: 88px;
    border-radius: var(--kw-radius-full);
    border: 3px solid var(--kw-primary-light);
    overflow: hidden;
    box-shadow: var(--kw-shadow-md);
}

.kamdhenu-welcome__online-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--kw-success);
    border: 3px solid #fff;
    border-radius: var(--kw-radius-full);
    animation: kw-online-pulse 2.5s ease-in-out infinite;
}

.kamdhenu-welcome__greeting {
    font-size: 22px;
    font-weight: 800;
    color: var(--kw-text);
    margin: 0 0 4px;
    line-height: 1.2;
}

.kamdhenu-welcome__name {
    color: var(--kw-primary);
}

.kamdhenu-welcome__subtitle {
    font-size: 13px;
    color: var(--kw-text-muted);
    margin: 0 0 16px;
    font-weight: 500;
    line-height: 1.4;
}

.kamdhenu-welcome__description {
    font-size: 14px;
    color: var(--kw-text);
    margin: 0 0 18px;
    line-height: 1.6;
}

.kamdhenu-welcome__features {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    text-align: left;
    width: 100%;
    max-width: 220px;
    background: var(--kw-surface-alt);
    border-radius: var(--kw-radius-md);
    padding: 14px 18px;
}

.kamdhenu-welcome__feature {
    font-size: 13px;
    color: var(--kw-text);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kamdhenu-welcome__feature-check {
    color: var(--kw-success);
    font-weight: 700;
    flex-shrink: 0;
}

.kamdhenu-welcome__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--kw-primary), var(--kw-secondary));
    color: #fff;
    border: none;
    border-radius: var(--kw-radius-full);
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--kw-transition), box-shadow var(--kw-transition);
    box-shadow: var(--kw-shadow-sm);
    letter-spacing: 0.01em;
    width: 100%;
    max-width: 260px;
}

.kamdhenu-welcome__btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--kw-shadow-md);
}

.kamdhenu-welcome__btn:active {
    transform: translateY(0);
}

/* =========================================================
   SCREEN: CONVERSATION / CHAT
   ========================================================= */

.kamdhenu-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kamdhenu-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.kamdhenu-chat__messages::-webkit-scrollbar {
    width: 4px;
}

.kamdhenu-chat__messages::-webkit-scrollbar-track {
    background: transparent;
}

.kamdhenu-chat__messages::-webkit-scrollbar-thumb {
    background: var(--kw-primary-light);
    border-radius: 4px;
}

/* Message row */
.kamdhenu-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: kw-bubble-in 0.25s ease both;
}

.kamdhenu-msg--ai {
    flex-direction: row;
}

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

.kamdhenu-msg__avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--kw-radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid var(--kw-primary-light);
}

.kamdhenu-msg__avatar--fallback {
    width: 28px;
    height: 28px;
    border-radius: var(--kw-radius-full);
    background: linear-gradient(135deg, var(--kw-primary), var(--kw-secondary));
    flex-shrink: 0;
    border: 1.5px solid var(--kw-primary-light);
    overflow: hidden;
}

.kamdhenu-msg__bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.kamdhenu-msg--ai .kamdhenu-msg__bubble {
    background: var(--kw-bubble-ai-bg);
    color: var(--kw-bubble-ai-text);
    border-bottom-left-radius: 4px;
}

.kamdhenu-msg--user .kamdhenu-msg__bubble {
    background: var(--kw-bubble-user-bg);
    color: var(--kw-bubble-user-text);
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.kamdhenu-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    animation: kw-bubble-in 0.25s ease both;
}

.kamdhenu-typing__dots {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--kw-bubble-ai-bg);
    padding: 10px 14px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.kamdhenu-typing__dot {
    width: 7px;
    height: 7px;
    background: var(--kw-text-light);
    border-radius: var(--kw-radius-full);
    animation: kw-dot-blink 1.4s ease-in-out infinite;
}

.kamdhenu-typing__dot:nth-child(1) { animation-delay: 0s; }
.kamdhenu-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.kamdhenu-typing__dot:nth-child(3) { animation-delay: 0.4s; }

.kamdhenu-typing__label {
    font-size: 11px;
    color: var(--kw-text-muted);
}

/* =========================================================
   CHAT INPUT AREA
   ========================================================= */

.kamdhenu-chat__input-area {
    padding: 10px 12px 12px;
    border-top: 1px solid var(--kw-border);
    background: var(--kw-surface);
    flex-shrink: 0;
}

/* Text input row */
.kamdhenu-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--kw-surface-chat);
    border-radius: var(--kw-radius-full);
    padding: 6px 6px 6px 16px;
    border: 1.5px solid var(--kw-border);
    transition: border-color var(--kw-transition-fast);
}

.kamdhenu-input-row:focus-within {
    border-color: var(--kw-primary);
}

.kamdhenu-input-row__field {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--kw-text);
    outline: none;
    font-family: inherit;
    min-width: 0;
}

.kamdhenu-input-row__field::placeholder {
    color: var(--kw-text-light);
}

.kamdhenu-input-row__send {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--kw-primary), var(--kw-secondary));
    border: none;
    border-radius: var(--kw-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform var(--kw-transition-fast), opacity var(--kw-transition-fast);
    color: #fff;
}

.kamdhenu-input-row__send:hover {
    transform: scale(1.08);
}

.kamdhenu-input-row__send:active {
    transform: scale(0.96);
}

.kamdhenu-input-row__send svg {
    width: 18px;
    height: 18px;
}

/* Quick reply buttons */
.kamdhenu-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.kamdhenu-quick-reply {
    background: var(--kw-surface);
    border: 1.5px solid var(--kw-primary);
    color: var(--kw-primary);
    border-radius: var(--kw-radius-full);
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--kw-transition-fast), color var(--kw-transition-fast), transform var(--kw-transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.kamdhenu-quick-reply:hover {
    background: var(--kw-primary);
    color: #fff;
    transform: translateY(-1px);
}

.kamdhenu-quick-reply:active {
    transform: translateY(0);
}

/* =========================================================
   SERVICE CARDS
   ========================================================= */

.kamdhenu-service-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 2px;
    animation: kw-fade-in 0.3s ease both;
}

.kamdhenu-service-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--kw-surface);
    border: 1.5px solid var(--kw-border);
    border-radius: var(--kw-radius-md);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color var(--kw-transition-fast), background var(--kw-transition-fast), transform var(--kw-transition-fast), box-shadow var(--kw-transition-fast);
    text-align: left;
    font-family: inherit;
    width: 100%;
}

.kamdhenu-service-card:hover {
    border-color: var(--kw-primary);
    background: var(--kw-surface-alt);
    transform: translateY(-2px);
    box-shadow: var(--kw-shadow-sm);
}

.kamdhenu-service-card:active {
    transform: translateY(0);
}

.kamdhenu-service-card__icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kw-surface-alt);
    border-radius: var(--kw-radius-sm);
}

.kamdhenu-service-card__text {
    flex: 1;
    min-width: 0;
}

.kamdhenu-service-card__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--kw-text);
    display: block;
    margin: 0 0 2px;
}

.kamdhenu-service-card__desc {
    font-size: 12px;
    color: var(--kw-text-muted);
    display: block;
    margin: 0;
}

.kamdhenu-service-card__arrow {
    color: var(--kw-text-light);
    flex-shrink: 0;
    font-size: 16px;
}

/* =========================================================
   SELECT INPUT (Qualification)
   ========================================================= */

.kamdhenu-select-wrap {
    position: relative;
    padding: 0 2px;
}

.kamdhenu-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--kw-border);
    border-radius: var(--kw-radius-md);
    background: var(--kw-surface);
    font-size: 13.5px;
    color: var(--kw-text);
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color var(--kw-transition-fast);
}

.kamdhenu-select:focus {
    border-color: var(--kw-primary);
}

.kamdhenu-select-wrap::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--kw-text-muted);
    pointer-events: none;
}

/* =========================================================
   PLACEMENT ACTION BUTTONS
   ========================================================= */

.kamdhenu-action-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 2px;
}

.kamdhenu-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--kw-radius-md);
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--kw-transition-fast), box-shadow var(--kw-transition-fast);
    font-family: inherit;
    border: none;
    text-decoration: none;
    width: 100%;
}

.kamdhenu-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--kw-shadow-sm);
}

.kamdhenu-action-btn:active {
    transform: translateY(0);
}

.kamdhenu-action-btn--primary {
    background: linear-gradient(135deg, var(--kw-primary), var(--kw-secondary));
    color: #fff;
}

.kamdhenu-action-btn--secondary {
    background: var(--kw-surface-alt);
    color: var(--kw-primary);
    border: 1.5px solid var(--kw-primary);
}

.kamdhenu-action-btn--success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

/* =========================================================
   REGISTRATION SUCCESS
   ========================================================= */

.kamdhenu-registration {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 18px;
    gap: 12px;
    animation: kw-fade-in 0.3s ease both;
}

.kamdhenu-registration__icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: var(--kw-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.kamdhenu-registration__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--kw-text);
    margin: 0;
}

.kamdhenu-registration__msg {
    font-size: 13px;
    color: var(--kw-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* =========================================================
   POPUP FOOTER
   ========================================================= */

.kamdhenu-widget-popup__footer {
    padding: 10px 16px;
    border-top: 1px solid var(--kw-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kw-surface);
    flex-shrink: 0;
}

.kamdhenu-widget-footer__brand {
    font-size: 11px;
    color: var(--kw-text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.kamdhenu-widget-footer__brand svg {
    width: 13px;
    height: 13px;
    color: var(--kw-primary);
    flex-shrink: 0;
}

/* =========================================================
   BACK BUTTON
   ========================================================= */

.kamdhenu-back-btn {
    background: none;
    border: none;
    color: var(--kw-text-muted);
    font-size: 12px;
    padding: 6px 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
    transition: color var(--kw-transition-fast);
    margin-bottom: 4px;
}

.kamdhenu-back-btn:hover {
    color: var(--kw-primary);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 480px) {
    .kamdhenu-widget-popup {
        right: 12px;
        left: 12px;
        width: auto;
        border-radius: var(--kw-radius-md);
        bottom: calc(var(--kw-bottom-offset) + var(--kw-launcher-size) + 12px);
    }

    .kamdhenu-widget-tooltip {
        display: none;
    }
}

@media (max-width: 360px) {
    .kamdhenu-welcome__greeting {
        font-size: 18px;
    }

    .kamdhenu-msg__bubble {
        font-size: 13px;
    }
}

/* =========================================================
   PRINT — HIDE WIDGET
   ========================================================= */

@media print {
    .kamdhenu-widget-launcher,
    .kamdhenu-widget-popup {
        display: none !important;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .kamdhenu-widget-launcher::before,
    .kamdhenu-widget-launcher::after,
    .kamdhenu-widget-launcher__badge,
    .kamdhenu-widget-popup__online,
    .kamdhenu-welcome__online-dot,
    .kamdhenu-typing__dot {
        animation: none;
    }

    .kamdhenu-widget-popup,
    .kamdhenu-welcome__btn,
    .kamdhenu-service-card,
    .kamdhenu-action-btn,
    .kamdhenu-quick-reply {
        transition: none;
    }
}

/* ==========================================================
   PHASE 06 ADDITIONS — Conversation Memory + Journey Engine
   v1.6.0
   ========================================================== */

/* ---- Resume Banner (Conversation Memory) ---- */

.kamdhenu-resume-banner {
    background-color: #f0f7ff;
    border: 1px solid #bee3f8;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 12px;
    margin-bottom: 4px;
    text-align: center;
}

.kamdhenu-resume-banner__text {
    margin: 0 0 10px;
    font-size: 13px;
    color: #2c5282;
    line-height: 1.5;
}

.kamdhenu-resume-banner__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.kamdhenu-resume-banner__fresh-btn {
    background: none;
    border: 1px solid #bee3f8;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: #4a90a4;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.kamdhenu-resume-banner__fresh-btn:hover {
    background-color: #e6f2fa;
}

/* ---- Journey Status Badge (in widget header) ---- */

.kamdhenu-journey-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-top: 2px;
    line-height: 1.6;
}

.kamdhenu-journey-badge--lead        { background-color: rgba(255,255,255,0.25); color: #fff; }
.kamdhenu-journey-badge--registered  { background-color: rgba(0,200,150,0.3);   color: #fff; }
.kamdhenu-journey-badge--training    { background-color: rgba(255,180,0,0.35);  color: #fff; }
.kamdhenu-journey-badge--assessment  { background-color: rgba(255,140,0,0.35);  color: #fff; }
.kamdhenu-journey-badge--placement   { background-color: rgba(100,220,100,0.35); color: #fff; }
.kamdhenu-journey-badge--completed   { background-color: rgba(80,80,80,0.35);   color: #fff; }
