/* ==========================================================
   Telegram Support Backend
   ========================================================== */

.swoop-webhook {
    margin-top: 0.5rem;
}

.swoop-webhook > h2 {
    margin: 0 0 1rem;
}


/* ==========================================================
   Contao Status / Hinweisboxen
   ========================================================== */

.swoop-webhook .tl_message {
    margin: 0 0 1.25rem;
    border-radius: 6px;
}


.swoop-webhook .tl_message strong {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.swoop-webhook .tl_message p {
    margin: 0.35rem 0 0;
}

.swoop-webhook .tl_message code {
    overflow-wrap: anywhere;
    word-break: break-all;
}


/* ==========================================================
   Fehler
   ========================================================== */

.swoop-webhook-error {
    margin: 0 0 1.25rem;
    padding: 0.8rem 1rem;
    color: #8e2424;
    background: #fdeaea;
    border: 1px solid #f3c5c5;
    border-radius: 6px;
}


/* ==========================================================
   Webhook Tabelle
   ========================================================== */

.swoop-webhook-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #d9dde3;
    border-radius: 8px;
}

.swoop-webhook-table tr {
    border-bottom: 1px solid #edf0f3;
}

.swoop-webhook-table tr:last-child {
    border-bottom: 0;
}

.swoop-webhook-table td {
    padding: 0.75rem 1rem;
    vertical-align: top;
    line-height: 1.4;
}

.swoop-webhook-table td:first-child {
    width: 220px;
    color: #515761;
    font-weight: 600;
}

.swoop-webhook-table td:last-child {
    min-width: 0;
}


/* ==========================================================
   URLs / technische Werte
   ========================================================== */

.swoop-webhook-url,
.swoop-webhook code {
    font-family: ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

    overflow-wrap: anywhere;
    word-break: break-all;
}

.swoop-webhook-url {
    display: inline-block;

    max-width: 100%;

    padding: 0.25rem 0.45rem;

    background: #f4f5f7;
    border-radius: 4px;
}


/* ==========================================================
   Badges
   ========================================================== */

.swoop-badge {
    display: inline-flex;
    align-items: center;

    margin-left: 0.4rem;
    padding: 0.25rem 0.55rem;

    border-radius: 999px;

    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;

    white-space: nowrap;
}

.swoop-badge--success {
    color: #226c2e;
    background: #e9f7ec;
}

.swoop-badge--warning {
    color: #825d00;
    background: #fff4cf;
}

.swoop-badge--error {
    color: #9b2626;
    background: #fdeaea;
}

.swoop-badge--muted {
    color: #5a6069;
    background: #eef0f3;
}


/* ==========================================================
   Webhook Actions
   ========================================================== */

.swoop-webhook-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;

    margin-top: 1.25rem;
}

.swoop-webhook-actions form {
    margin: 0;
}

.swoop-webhook-actions .tl_submit {
    margin: 0;
}

.swoop-webhook-actions .tl_submit:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


/* ==========================================================
   Support Chat
   ========================================================== */

.swoop-support-chat .tl_message {
    margin: 0 0 1.25rem;
    border-radius: 6px;
}

.swoop-support-chat {
    /*margin-top: 2rem;*/
    /*padding-top: 1.5rem;*/
    /*border-top: 1px solid #d9dde3;*/
}

.swoop-support-chat > h2 {
    margin: 0 0 1rem;

    font-size: 1.15rem;
    font-weight: 600;
}

.swoop-support-chat > p {
    margin: 0 0 1rem;

    line-height: 1.5;
}

.swoop-support-chat .tl_message {
    margin-bottom: 0;
}

.swoop-support-chat .tl_message p {
    margin: 0.4rem 0 0;
}

.swoop-support-chat .tl_submit {
    display: inline-block;

    margin: 0;
}

.swoop-support-chat a.tl_submit {
    text-decoration: none;
}

.swoop-support-chat button.tl_submit:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


/* Hilfetext unter dem Connect-Button */

.swoop-support-chat .tl_help {
    margin-top: 0.6rem;
    margin-bottom: 0;

    color: #6a7078;

    font-size: 0.9rem;
    line-height: 1.45;
}


/* ==========================================================
   Debug
   Falls getMe/getWebhookInfo später wieder angezeigt werden.
   ========================================================== */

.swoop-webhook-debug {
    margin-top: 1.5rem;
    padding: 0.5rem 1.25rem 1rem;

    border: 1px solid #d9dde3;
    border-radius: 8px;
}

.swoop-webhook-debug details {
    margin-top: 0.75rem;
}

.swoop-webhook-debug summary {
    cursor: pointer;

    color: #515761;

    font-weight: 600;
}

.swoop-webhook-debug pre {
    margin: 0.75rem 0 0;
    padding: 1rem;

    overflow-x: auto;

    background: #f4f5f7;
    border-radius: 6px;

    font-family: ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;

    font-size: 0.85rem;
    line-height: 1.5;
}


/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 767px) {

    .swoop-webhook-table,
    .swoop-webhook-table tbody,
    .swoop-webhook-table tr,
    .swoop-webhook-table td {
        display: block;
        width: 100%;
    }

    .swoop-webhook-table td:first-child {
        width: auto;
        padding-bottom: 0.25rem;
    }

    .swoop-webhook-table td:last-child {
        padding-top: 0.25rem;
    }

    .swoop-badge {
        margin-top: 0.35rem;
        margin-left: 0;
    }

    .swoop-webhook-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .swoop-webhook-actions form {
        width: 100%;
    }

    .swoop-webhook-actions .tl_submit {
        width: 100%;
    }

    .swoop-support-chat .tl_submit {
        width: 100%;
        box-sizing: border-box;

        text-align: center;
    }
}

.swoop-support-chat__message {
    padding: 10px 15px;
    padding-left: 36px;
    border-radius: 3px;
    line-height: 1.5;
}

.swoop-support-chat__message p {
    margin: 0 0 5px;
}

.swoop-support-chat__message p:last-child {
    margin-bottom: 0;
}


/* Erfolgreich / verbunden */
.swoop-support-chat__message--success {

    border: 1px solid #badbcc;
    color: #3a7d44;
    background: var(--confirm-bg) url(/system/themes/flexible/icons/ok.svg) no-repeat 11px 12px

}


/* Fehler / noch nicht vollständig eingerichtet */
.swoop-support-chat__message--error {
    background: var(--error-bg) url("/system/themes/flexible/icons/error.svg") no-repeat 11px 12px;
    color: var(--red);
}


.swoop-support-chat__message strong,
.swoop-support-chat__message code,
.swoop-support-chat__message .swoop-support-chat__help {
    color: inherit;
}


/* Button soll weiterhin wie ein Contao-Button aussehen */
.swoop-support-chat__message .tl_submit {
    margin: 4px 0;
}

.swoop-message-warning , .tl_warning{
    padding: 12px 15px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    border-radius: 3px;
    color: #664d03;
}

.swoop-message-warning p,
.swoop-message-warning strong,
.swoop-message-warning code,
.swoop-message-warning .tl_help {
    color: inherit;
}

.swoop-message-warning p:first-child {
    margin-top: 0;
}

.swoop-message-warning p:last-child {
    margin-bottom: 0;
}

.swoop-message-confirm {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.swoop-message-warning , .tl_warning{
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #664d03;
}

.swoop-message-error {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}