:root {
    --wp-ai-primary: #1c4db8; /** BLUE */
    --wp-ai-secondary: #bf0241; /** PINK */
    --wp-ai-accent: #1D0075; /** PURPLE */
    --wp-ai-grey: #f0f0f5;
    --wp-ai-text: #333333;
    --wp-ai-border: #e1e1e8;
    --wp-ai-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.hidden {
    display: none !important;
}

#wp-ai-container,
#wp-ai-toggle {
    position: fixed;
    z-index: 99;
    background: #ffffff;
}

/* Vertical pill tab docked to the right edge of the screen. */
#wp-ai-toggle {
    top: 50%;
    right: 0;
    width: auto;
    height: auto;
    margin: 0;
    padding: 10px 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    color: var(--wp-ai-primary);
    background: linear-gradient(180deg, #F5F9FF 0%, #DCE7FF 50%, #F5F9FF 100%);
    background-size: 100% 300%;
    border: 2px solid var(--wp-ai-primary);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    box-shadow: -2px 2px 10px rgba(28, 77, 184, 0.18);
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    transition: padding-right 0.15s, color 0.15s;
    animation: wp-ai-toggle-bg 6s ease-in-out infinite;
}

/* Light sweep running down the face. */
#wp-ai-toggle::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -60%;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    pointer-events: none;
    animation: wp-ai-toggle-shine 6s ease-in-out infinite;
}

#wp-ai-toggle:hover,
#wp-ai-toggle:focus-visible {
    padding-right: 10px;
    color: var(--wp-ai-accent);
}

#wp-ai-toggle:focus-visible {
    outline: 2px solid var(--wp-ai-accent);
    outline-offset: 2px;
}

#wp-ai-toggle .wp-ai-toggle-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wp-ai-toggle .wp-ai-toggle-icon img {
    display: block;
    width: 18px;
    height: 18px;
}

#wp-ai-toggle .wp-ai-toggle-label {
    position: relative;
    writing-mode: vertical-rl;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

@keyframes wp-ai-toggle-bg {
    0%, 100% {
        background-position: 50% 0%;
    }

    50% {
        background-position: 50% 100%;
    }
}

@keyframes wp-ai-toggle-shine {
    0%, 60% {
        top: -60%;
    }

    85%, 100% {
        top: 130%;
    }
}

@media (prefers-reduced-motion: reduce) {
    #wp-ai-toggle,
    #wp-ai-toggle::before {
        animation: none;
    }
}

#wp-ai-container {
    left: 20px;
    bottom: 90px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--wp-ai-shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s;
}

#wp-ai-container.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#wp-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    color: #ffffff;
    background: var(--wp-ai-primary);
    font-weight: 600;
}

#wp-ai-header small {
    display: block;
    font-size: 9px;
    color: #d1d5ff;
}

#wp-ai-header button {
    padding: 0 8px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 26px;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s;
}

#wp-ai-header button:hover {
    opacity: 1;
}

#wp-ai-starter-panel {
    padding: 12px;
}

.wp-ai-starter-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    /* Background Clip trick */
    background: linear-gradient( 90deg, var(--wp-ai-primary) 0%, var(--accent) 50%, var(--wp-ai-primary) 100% );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shine 2.5s linear infinite;
}

@keyframes shine {
    to { background-position: 200% center; }
}

.wp-ai-starter-links {
}

.wp-ai-starter-pill {
display: inline-block;
  box-sizing: border-box;
  padding: 3px 6px;
  border: 1px solid rgba(20, 20, 145, 0.14);
  border-radius: 999px;
  background: linear-gradient(135deg, #f8f7ff 0%, #eef1ff 100%);
  color: var(--wp-ai-primary);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  margin: 0 4px 2px 0px;
}

.wp-ai-starter-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(20, 20, 145, 0.4);
}

.wp-ai-starter-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.wp-ai-starter-notice {
    padding: 10px 12px;
    border: 1px solid #e3e7ff;
    border-radius: 12px;
    background: #fbfbff;
    color: #4d4d72;
    font-size: 11px;
    line-height: 1.5;
}

.wp-ai-starter-notice p {
    margin: 0 0 8px;
}

.wp-ai-starter-notice p:last-child {
    margin-bottom: 0;
}

.wp-ai-starter-notice a {
    color: var(--wp-ai-primary);
    font-weight: 600;
}

#wp-ai-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding:12px;
    overflow-y: auto;
    background: #ffffff;
}

.wp-ai-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wp-ai-msg hr{margin:12px 0px;}

.wp-ai-msg.user {
    align-self: flex-end;
    color: #ffffff;
    background: var(--wp-ai-secondary);
    border-bottom-right-radius: 2px;
}

.wp-ai-msg.ai {
    align-self: flex-start;
    color: var(--wp-ai-text);
    background: #f0f0f54a;
    border: 1px solid var(--wp-ai-border);
    border-bottom-left-radius: 2px;
}

.wp-ai-msg.system {
    align-self: center;
    background: #fff8e1;
    color: #8a6d3b;
    font-size: 13px;
    text-align: center;
    border: none;
    box-shadow: none;
}
hr{
    margin: 15px 0;
}

.wp-ai-msg.ai h1,
.wp-ai-msg.ai h2,
.wp-ai-msg.ai h3,
.wp-ai-msg.ai h4,
.wp-ai-msg.ai h5 {
    font-size: 16px;
}

.wp-ai-msg.ai p {
    margin: 0 0 10px;
}

.wp-ai-msg.ai p:last-child {
    margin-bottom: 0;
}

.wp-ai-msg.ai ul,
.wp-ai-msg.ai ol {
    margin: 10px 0 10px 25px;
}

.wp-ai-msg.ai li {
    margin-bottom: 5px;
}

.wp-ai-msg.ai a {
    color: var(--wp-ai-primary);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px dotted var(--wp-ai-primary);
}

.wp-ai-msg.ai a:hover {
    border-bottom-style: solid;
}

.wp-ai-reasoning-msg {
    width: 100%;
    max-width: 100%;
    background: #f8f7ff;
    border-style: dashed;
}

.wp-ai-reasoning-title {
    margin-bottom: 6px;
    color: var(--wp-ai-primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wp-ai-reasoning-body {
    white-space: pre-wrap;
    color: #4d4d72;
    font-size: 8px;
    line-height: 1.35;
}

.wp-ai-thinking {
    min-width: 160px;
}

.wp-ai-thinking-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wp-ai-thinking-status {
    margin-top: 8px;
    color: #5c6485;
    font-size: 12px;
    line-height: 1.45;
}

.wp-ai-thinking-label {
    font-weight: 700;
    color: var(--wp-ai-primary);
    animation: wp-ai-thinking-pulse 1.2s ease-in-out infinite;
}

.wp-ai-thinking-dots {
    display: inline-flex;
    align-items: center;
}

@keyframes wp-ai-thinking-pulse {
    0%,
    100% {
        opacity: 0.45;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-1px);
    }
}

.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-radius: 50%;
    background-color: var(--wp-ai-accent);
    animation: wp-ai-wave 1.3s linear infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: -1.1s;
    background-color: var(--wp-ai-secondary);
}

.typing-dot:nth-child(3) {
    margin-right: 0;
    animation-delay: -0.9s;
    background-color: var(--wp-ai-primary);
}

@keyframes wp-ai-wave {
    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

#wp-ai-suggestions {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 15px;
    background: #ffffff;
    border-top: 1px solid #eeeeee;
}

.suggestion-pill {
    padding: 6px 12px;
    border: 1px solid var(--wp-ai-primary);
    border-radius: 20px;
    background: #ffffff;
    color: var(--wp-ai-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-pill:hover {
    color: #ffffff;
    background: var(--wp-ai-primary);
}

#wp-ai-input-area {
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

#wp-ai-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 45px 12px 15px;
    border: 1px solid #dddddd;
    border-radius: 25px;
    outline: none;
    font-size: 15px;
    transition: border-color 0.2s;
}

#wp-ai-input:focus {
    border-color: var(--wp-ai-primary);
}

#wp-ai-send {
    position: absolute;
    top: 50%;
    right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--wp-ai-primary);
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.2s;
}

#wp-ai-send:hover {
    background: #0f0f70;
}

#wp-ai-send.disabled {
    background: #cccccc;
    cursor: not-allowed;
}

#wp-ai-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

#wp-ai-modal.hidden {
    display: none;
}

.wp-ai-modal-content {
    width: 80%;
    max-width: 300px;
    padding: 20px;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.wp-ai-modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.wp-ai-modal-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
}

#wp-ai-confirm-reset {
    background: var(--wp-ai-secondary);
    color: #ffffff;
}

#wp-ai-cancel-reset {
    background: #eeeeee;
    color: #333333;
}

@media (max-width: 480px) {
    #wp-ai-container {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: 85% !important;
        max-height: 100% !important;
        border-radius: 0;
        transform: translateY(100%);
    }

    #wp-ai-container.active {
        transform: translateY(0);
    }
}
