
/* =====================================================
   CURIOUS MINDS AI — HOMEPAGE ASSISTANT
   Independent styling; does not modify main.css
===================================================== */

.ai-assistant-panel {
    position: absolute;
    top: 28%;
    left: 14px;

    width: 310px;
    height: 390px;

    display: flex;
    flex-direction: column;

    z-index: 5;

    padding: 12px;

    background: rgba(0, 8, 22, 0.88);

    border: 4px solid #008cff;
    border-radius: 5px;

    box-shadow:
        0 0 12px #008cff,
        inset 0 0 15px rgba(0, 140, 255, 0.18);

    color: pink;
    font-family: inherit;
}

/* ASSISTANT HEADING */

.ai-panel-header {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 8px 4px 12px;

    border-bottom: 3px solid #008cff;
}

.ai-panel-header h2 {
    color: #008cff;
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 2px;

    text-shadow: 0 0 12px rgba(0, 140, 255, 0.7);
}

.ai-header-symbol {
    color: #00c8ff;
    font-size: 1.8rem;
}

/* CONVERSATION AREA */

.ai-messages {
    flex: 1 1 auto;

    min-height: 0;
    overflow-y: auto;

    padding: 14px 8px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    scrollbar-width: thin;
    scrollbar-color: #008cff transparent;
}

/* MESSAGE BUBBLES */

.ai-message {
    max-width: 95%;

    padding: 10px 12px;

    border-radius: 10px;

    font-size: 0.92rem;
    line-height: 1.45;

    overflow-wrap: anywhere;
}

.ai-message.assistant {
    align-self: flex-start;

    background: rgba(0, 105, 180, 0.22);
    border-left: 3px solid #00aaff;

    color: #eaf7ff;
}

.ai-message.user {
    align-self: flex-end;

    background: rgba(0, 140, 255, 0.22);
    border-right: 3px solid #008cff;

    color: #ffffff;
}

/* TYPING INDICATOR */

.ai-typing {
    flex: 0 0 auto;

    padding: 4px 8px;

    color: #80dfff;
    font-size: 0.8rem;
    font-style: italic;
}

.ai-typing[hidden] {
    display: none;
}

/* MESSAGE INPUT */

.ai-input-area {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 6px;

    padding: 7px;

    border: 3px solid #008cff;
    border-radius: 5px;

    background: rgba(0, 0, 0, 0.75);
}

.ai-input-area textarea {
    flex: 1;
    min-width: 0;

    resize: none;
    max-height: 75px;

    padding: 8px 5px;

    background: transparent;
    border: none;
    outline: none;

    color: #ffffff;

    font-family: inherit;
    font-size: 0.9rem;
}

.ai-input-area textarea::placeholder {
    color: #008cff;
    font-weight: 700;
    letter-spacing: 1px;
}

.ai-input-area button {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    border: none;
    border-radius: 5px;

    background: #008cff;
    color: #ffffff;

    font-size: 1.3rem;
    cursor: pointer;

    transition: 0.2s ease;
}

.ai-input-area button:hover {
    background: #00c8ff;
    box-shadow: 0 0 12px #008cff;
}

.ai-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* STATUS AND ERROR MESSAGES */

.ai-feedback {
    flex: 0 0 auto;

    min-height: 0;
    padding-top: 4px;

    color: #ffcc99;
    font-size: 0.75rem;
    text-align: center;
}

.ai-feedback:empty {
    display: none;
}

/* TABLET */

@media (max-width: 1100px) {
    .ai-assistant-panel {
        width: 270px;
        height: 350px;
        left: 10px;
    }

    .ai-panel-header h2 {
        font-size: 1.8rem;
    }
}

/* MOBILE */

@media (max-width: 768px) {
    .ai-assistant-panel {
        position: relative;

        top: auto;
        left: auto;
        transform: none;

        width: min(92%, 420px);
        height: 360px;

        margin: 20px auto;
    }
}
