.heise-io-chat-button {
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.heise-io-chat-button:hover {
    background-color: #005177;
}

.heise-io-chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.heise-io-chat-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.heise-io-chat-modal-content {
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 620px;
    max-height: 95dvh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.heise-io-chat-modal-header {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 20px;
    gap: 0.5rem;
}

.heise-io-chat-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.heise-io-chat-beta-badge {
    background-color: #f4f4f4;
    color: #666;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.heise-io-chat-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.heise-io-chat-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #666;
}

.heise-io-chat-modal-close:hover {
    color: #000;
}

.heise-io-chat-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.heise-io-chat-input-wrapper #heise-io-chat-input {
    padding-right: 30px;
}

.heise-io-chat-clear-input {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: #666;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.heise-io-chat-input-divider {
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(calc(-50% - 2px));
    color: #ccc;
    font-size: 18px;
    font-weight: 300;
    pointer-events: none;
    z-index: 5;
}

.heise-io-chat-clear-input:hover {
    background: #e0e0e0;
    color: #000;
}

.heise-io-chat-modal-body {
    padding: 0 12px 20px 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.heise-io-chat-answer-heading {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    padding: 0 10px;
    color: #333;
}

.heise-io-chat-messages {
    flex: 0 1 auto;
    margin-bottom: 20px;
    padding: 0 10px 10px 10px;
    /* background-color: #f9f9f9; */
    border-radius: 4px;
    min-height: 200px;
}

.heise-io-chat-messages p {
    margin: 0 0 10px 0;
}

.heise-io-chat-messages h1,
.heise-io-chat-messages h2,
.heise-io-chat-messages h3 {
    margin: 15px 0 10px 0;
}

.heise-io-chat-messages ul {
    margin: 10px 0;
    padding-left: 20px;
    list-style: disc;
}

.heise-io-chat-messages ol {
    margin: 10px 0;
    padding-left: 20px;
    list-style: decimal;
}

.heise-io-chat-messages code {
    background-color: #e8e8e8;
    padding: 2px 4px;
    border-radius: 3px;
}

.heise-io-chat-messages pre {
    background-color: #e8e8e8;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

.heise-io-chat-messages pre code {
    background-color: transparent;
    padding: 0;
}

.heise-io-chat-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #23a5f3;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.heise-io-chat-input-wrapper {
    display: flex;
    gap: 10px;
}

.heise-io-chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

input[type="text"]:focus {
    outline: none;
}

form:has(input[type="text"]:focus) {
    border-color: #23a5f3;
}

.heise-io-chat-send {
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.heise-io-chat-send:hover {
    background-color: #005177;
}

.heise-io-chat-send:disabled,
.heise-io-chat-input:disabled,
#heise-io-chat-send:disabled,
#heise-io-chat-input:disabled,
button.cursor-pointer:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.heise-io-chat-send:disabled:hover,
#heise-io-chat-send:disabled:hover,
button.cursor-pointer:disabled:hover {
    cursor: not-allowed !important;
}

.heise-io-chat-sources {
    padding: 0 10px;
}

.heise-io-chat-disclaimer {
    background-color: #f9f9f9;
    color: #666;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
}

.heise-io-chat-sources h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: normal;
}

.heise-io-chat-sources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.heise-io-chat-source-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    /* background-color: #f9f9f9; */
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.heise-io-chat-source-card:hover {
    background-color: #fff;
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.heise-io-chat-source-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.heise-io-chat-source-title {
    color: #333;
    font-size: 13px;
    line-height: 1.4;
}

.heise-io-chat-source-date {
    color: #666;
    font-size: 13px;
    line-height: 1.2;
}

.heise-io-chat-source-card:hover .heise-io-chat-source-title {
    color: #0073aa;
}

.heise-io-chat-source-card .heise-io-chat-doc-badge {
    display: none;
    flex-shrink: 0;
    margin: 4px 0 0 0;
    top: 0;
    padding: 4px 8px;
    font-size: 12px;
}

.heise-io-chat-doc-badge {
    /* display: inline-block; */
    display: none;
    background-color: #23a5f3;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    margin: 0 2px;
    vertical-align: middle;
    line-height: 1;
    position: relative;
    top: -2px;
    /* Entferne Leerzeichen vor dem Badge */
    font-size: 0;
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
}

.heise-io-chat-doc-badge:hover {
    background-color: #0073aa;
    color: #fff;
}

@media (max-width: 600px) {
    .heise-io-chat-sources-grid {
        grid-template-columns: 1fr;
    }
}

[data-regenerate-questions] i {
    display: inline-block;
    transition: transform 0.3s ease;
}

[data-regenerate-questions].heise-io-chat-regenerating i {
    animation: spin 1s linear infinite;
    display: inline-block;
}

[data-regenerate-questions].heise-io-chat-regenerating {
    opacity: 0.7;
    pointer-events: none;
}