/*
 * Computer Repair Doctor GPT Chatbot
 * Version 1.1.0
 */

.crd-chatbot {
    max-width: 720px;
    margin: 20px auto;
    border: 1px solid #dddddd;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    font-family: Arial, Helvetica, sans-serif;
}

.crd-chat-header {
    background: var(--crd-color);
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crd-chat-header strong {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.crd-minimize {
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 5px 8px;
}

.crd-chat-messages {
    height: 420px;
    overflow-y: auto;
    padding: 16px;
    background: #f7f7f7;
    box-sizing: border-box;
}

.crd-msg {
    max-width: 82%;
    padding: 10px 13px;
    margin: 0 0 12px;
    border-radius: 12px;
    line-height: 1.45;
    font-size: 16px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.crd-msg.user {
    margin-left: auto;
    margin-right: 0;
    background: var(--crd-color);
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.crd-msg.assistant {
    margin-left: 0;
    margin-right: auto;
    background: #ffffff;
    color: #333333;
    border: 1px solid #e1e1e1;
    border-bottom-left-radius: 3px;
}

.crd-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #dddddd;
    background: #ffffff;
    box-sizing: border-box;
    align-items: stretch;
}

.crd-chat-input {
    flex: 1;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #bbbbbb;
    border-radius: 8px;
    background: #ffffff;
    color: #333333;
    font-size: 16px;
    box-sizing: border-box;
    outline: none;
}

.crd-chat-input:focus {
    border-color: var(--crd-color);
    box-shadow: 0 0 0 1px var(--crd-color);
}

.crd-send-button,
.crd-mic-button,
.crd-voice-button {
    background: var(--crd-color);
    color: #ffffff;
    border: 0;
    border-radius: 8px;
    min-height: 44px;
    cursor: pointer;
    font-size: 16px;
}

.crd-send-button {
    padding: 0 18px;
    font-weight: 600;
}

.crd-mic-button,
.crd-voice-button {
    min-width: 48px;
    padding: 0 10px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crd-send-button:hover,
.crd-mic-button:hover,
.crd-voice-button:hover {
    opacity: 0.9;
}

.crd-send-button:disabled,
.crd-mic-button:disabled,
.crd-voice-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crd-mic-button.is-listening {
    outline: 3px solid rgba(0, 0, 0, 0.12);
}

.crd-collapsed .crd-chat-messages,
.crd-collapsed .crd-chat-form {
    display: none;
}

@media (max-width: 600px) {
    .crd-chatbot {
        margin: 10px;
        border-radius: 8px;
        max-width: calc(100% - 20px);
    }

    .crd-chat-header {
        padding: 12px 14px;
    }

    .crd-chat-header strong {
        font-size: 17px;
    }

    .crd-chat-messages {
        height: 350px;
        padding: 12px;
    }

    .crd-msg {
        max-width: 90%;
        font-size: 15px;
    }

    .crd-chat-form {
        padding: 10px;
        flex-wrap: wrap;
    }

    .crd-chat-input {
        flex-basis: 100%;
        width: 100%;
        font-size: 16px;
    }

    .crd-mic-button,
    .crd-voice-button {
        min-width: 42px;
        padding: 0 8px;
    }

    .crd-send-button {
        flex: 1;
    }
}


.crd-repair-form-link {
    margin-top: 10px;
}

.crd-repair-form-link a {
    display: inline-block;
    font-weight: 700;
    text-decoration: underline;
    overflow-wrap: anywhere;
}
