/**
 * Kurs-Assistent – Styles
 *
 * Freitext-Eingabe + Chip-Rückfragen + Intro-Absatz + Cards-Grid + Refine-Feld
 *
 * @package rolfkrueger
 */

.adg-assistent {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: #1a1a1a;
}

/* =====================================================================
   Intro + Eingabe
   ===================================================================== */

.adg-assistent-intro {
    margin-bottom: 16px;
}

.adg-assistent-intro h2 {
    margin: 0 0 4px;
    font-size: 30px;
    font-weight: 800;
}

.adg-assistent-intro p {
    margin: 0;
    color: #555;
    font-size: 15px;
}

.adg-assistent-form,
.adg-assistent-refine {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.adg-assistent-input,
.adg-assistent-refine-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--lila);
    border-radius: 6px;
    font: inherit;
    resize: vertical;
    background: #fff;
}

.adg-assistent-input:focus,
.adg-assistent-refine-input:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.adg-assistent-submit,
.adg-assistent-refine-submit,
.adg-assistent-submit-answers {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.adg-assistent-submit,
.adg-assistent-submit-answers {
    align-self: flex-start;
}

.adg-assistent-refine-submit {
    align-self: center;
    margin: 10px auto 20px;
}

.adg-assistent-refine .adg-assistent-browse-link {
    align-self: center;
    margin-top: 16px;
}

.adg-assistent-submit:hover,
.adg-assistent-refine-submit:hover,
.adg-assistent-submit-answers:hover {
    background: #000;
}

.adg-assistent-submit:disabled,
.adg-assistent-refine-submit:disabled,
.adg-assistent-submit-answers:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.adg-assistent-refine-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.adg-assistent-browse-link {
    display: block;
    margin: 0 auto;
    color: var(--blau);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.adg-assistent-browse-link:hover,
.adg-assistent-browse-link:focus,
.adg-assistent-browse-link:focus-visible {
    color: var(--blau);
    text-decoration: underline;
}

.adg-assistent-browse-link-icon {
    margin-left: 6px;
    font-size: 0.9em;
}

/* =====================================================================
   Loading
   ===================================================================== */

.adg-assistent-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 0;
    color: #555;
    font-style: italic;
    text-align: center;
}

.adg-assistent-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #555;
    border-radius: 50%;
    animation: adg-assistent-spin 0.8s linear infinite;
}

@keyframes adg-assistent-spin {
    to { transform: rotate(360deg); }
}

/* =====================================================================
   Ergebnis-Output
   ===================================================================== */

.adg-assistent-output {
    margin: 8px 0 20px;
}

.adg-assistent-intro-text {
    padding: 14px 16px;
    margin-bottom: 20px;
    background: #18B5FE18;
    border-left: 3px solid #18B5FE;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.6;
    color: #2a2419;
    white-space: pre-wrap;
}

.adg-assistent-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.adg-assistent-empty {
    padding: 40px 20px;
    text-align: center;
    color: #888;
}

.adg-assistent-browse-all {
    margin: 24px 0 8px;
    text-align: center;
}

.adg-assistent-browse-btn {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid #18B5FE;
    border-radius: 999px;
    background: #fff;
    color: #0a7fb8;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.adg-assistent-browse-btn:hover,
.adg-assistent-browse-btn:focus {
    background: #18B5FE;
    color: #fff;
    text-decoration: none;
}

/* =====================================================================
   Clarify – Fragen mit Chips
   ===================================================================== */

.adg-assistent-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.adg-assistent-question {
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.adg-assistent-q-text {
    margin: 0 0 10px;
    font-weight: 600;
    color: #1a1a1a;
}

.adg-assistent-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.adg-assistent-chip {
    padding: 6px 14px;
    border: 1px solid #c0b090;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 14px;
    color: #2a2419;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.adg-assistent-chip:hover {
    background: #f5f1ea;
    border-color: #8b6b3a;
}

.adg-assistent-chip.is-selected {
    background: var(--gelb);
    border-color: var(--gelb);
    color: #000;
}

.adg-assistent-q-freetext {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font: inherit;
    font-size: 14px;
    background: #fff;
}

.adg-assistent-q-freetext:focus {
    outline: none;
    border-color: #888;
}

.adg-assistent-submit-answers {
    margin-top: 8px;
}

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

.adg-assistent-error {
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #fdf0f0;
    border-left: 3px solid #c44;
    border-radius: 4px;
    color: #8a2424;
    font-size: 14px;
}

.adg-assistent-retry {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 12px;
    border: 1px solid #c44;
    border-radius: 4px;
    background: #fff;
    color: #8a2424;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.adg-assistent-retry:hover {
    background: #c44;
    color: #fff;
}

.adg-assistent-validation {
    margin-top: 8px;
    color: #c44;
    font-size: 14px;
}

/* =====================================================================
   Mobile
   ===================================================================== */

@media (max-width: 640px) {
    .adg-assistent-cards {
        grid-template-columns: 1fr;
    }

    .adg-assistent-submit,
    .adg-assistent-refine-submit,
    .adg-assistent-submit-answers {
        width: 100%;
        align-self: stretch;
    }
}

/* =====================================================================
   Buttons dürfen umbrechen
   ===================================================================== */

.adg-assistent button {
    white-space: wrap;
}
