/* CSS for the AI Concierge CTA button */
/* Note: Theme must define --wp--preset--color--... variables for these styles to work as intended. */
/* Fallback colors are provided for elements where direct theme variable mapping is not available from the user's list. */

/*
Verwendete Theme-Variablen (müssen vom Theme definiert sein):
--wp--preset--color--primary
--wp--preset--color--primary-hover
--wp--preset--color--secondary
--wp--preset--color--secondary-hover
--wp--preset--color--typography
--wp--preset--color--link
--wp--preset--color--link-hover
--wp--preset--color--white (angenommen für Text auf Primärfarbe)
--wp--preset--color--background (angenommen für Popup-Hintergrund)
--wp--preset--color--contrast (oder contrast-2, contrast-3 für Ränder)
*/

/* Styling für den Standard CTA-Button (falls er noch an anderer Stelle ohne Floating verwendet wird) */
.amhc-concierge-cta:not(.amhc-cta-floating),
.amhc-concierge-cta-shortcode:not(.amhc-cta-floating) {
    /* Entfernt: Feste Positionierung */
    /* position: fixed; */
    /* bottom: 20px; */
    /* right: 20px; */
    /* z-index: 10000; */
    display: inline-block; /* Oder 'block', je nach gewünschtem Verhalten im Fluss */
    background-color: var(--wp--preset--color--primary, #0073aa); /* Fallback zu WP Blau */
    color: var(--wp--preset--color--white, #ffffff); /* Annahme: Theme hat --wp--preset--color--white oder Text auf Primary ist hell */
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.amhc-concierge-cta:not(.amhc-cta-floating):hover,
.amhc-concierge-cta-shortcode:not(.amhc-cta-floating):hover {
    background-color: var(--wp--preset--color--primary-hover, #005177); /* Fallback zu dunklerem WP Blau */
}

/* Styling für den Floating CTA Button (Shortcode-Version) */
.amhc-cta-floating {
    position: fixed;
    top: 50%;
    right: 0; /* Icon-Teil ist am rechten Rand */
    transform: translateY(-50%);
    z-index: 9999; /* Unter dem Popup (10001), aber über dem meisten Inhalt */
    background-color: var(--wp--preset--color--primary, #0073aa);
    color: var(--wp--preset--color--white, #ffffff);
    border: none;
    border-radius: 22px 0 0 22px; /* Links abgerundet, rechts scharfkantig am Bildschirmrand */
    cursor: pointer;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.25); /* Schatten nach links oben */
    display: flex; /* Um Text und Icon nebeneinander zu platzieren */
    align-items: center; /* Vertikal zentrieren */
    padding: 0; /* Padding wird von inneren Elementen gehandhabt */
    overflow: hidden; /* Wichtig für den Slide-Effekt des Textes */
    transition: background-color 0.3s ease;
}

.amhc-cta-floating:hover {
    background-color: var(--wp--preset--color--primary-hover, #005177);
}

.amhc-cta-floating .amhc-cta-text-content {
    display: inline-block;
    white-space: nowrap;
    color: var(--wp--preset--color--white, #ffffff);
    font-size: 14px;
    line-height: 1.2;
    order: 1; /* Text links */

    /* Initial versteckter Zustand */
    max-width: 0;
    opacity: 0;
    padding-left: 0;
    padding-right: 0;
    visibility: hidden;

    transition: max-width 0.35s cubic-bezier(0.25, 0.1, 0.25, 1), /* Etwas smoother */
                opacity 0.2s ease-in-out 0.1s,
                padding-left 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                padding-right 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                visibility 0s linear 0.35s; /* Wird unsichtbar nach dem Ausblenden */
}

.amhc-cta-floating .amhc-cta-icon-symbol {
    display: inline-flex; /* Für Zentrierung des '?' */
    align-items: center;
    justify-content: center;
    width: 44px;  /* Quadratische Größe für das Icon */
    height: 44px;
    font-size: 22px;
    font-weight: bold;
    color: var(--wp--preset--color--white, #ffffff);
    order: 2; /* Icon rechts */
    transition: transform 0.3s ease;
}

.amhc-cta-floating:hover .amhc-cta-text-content,
.amhc-cta-floating:focus-within .amhc-cta-text-content { /* :focus-within für bessere Zugänglichkeit */
    max-width: 250px; /* Maximale Breite für den Text anpassen */
    opacity: 1;
    padding-left: 20px;  /* Padding links vom Text */
    padding-right: 10px; /* Abstand zwischen Text und Icon */
    visibility: visible;
    transition: max-width 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.2s ease-in-out,
                padding-left 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                padding-right 0.35s cubic-bezier(0.25, 0.1, 0.25, 1),
                visibility 0s linear 0s; /* Wird sofort sichtbar */
}

/* Optional: Kleine Animation für das Icon beim Hovern über den Button */
.amhc-cta-floating:hover .amhc-cta-icon-symbol {
    transform: scale(1.05) rotate(10deg);
}

/* CSS for the AI Concierge Popup */
.amhc-concierge-popup { /* Klasse aktualisiert */
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 10001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.amhc-popup-content { /* Klasse aktualisiert */
    background-color: var(--wp--preset--color--background, #fefefe); /* Annahme: Theme hat --wp--preset--color--background oder Fallback */
    margin: auto;
    padding: 30px;
    border: 1px solid var(--wp--preset--color--contrast-2, #ddd); /* Annahme: Theme hat --wp--preset--color--contrast-2 oder Fallback für einen leichten Rand */
    width: 90%; /* Responsive width */
    max-width: 600px; /* Max width for larger screens */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation-name: animatetop;
    animation-duration: 0.4s;
}

/* Animation for the popup */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.amhc-close-button { /* Klasse aktualisiert */
    color: var(--wp--preset--color--contrast, #aaa); /* Annahme für Kontrastfarbe */
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1; /* Adjust to better align 'x' */
    position: absolute;
    right: 15px;
    top: 10px;
}

.amhc-close-button:hover, /* Klasse aktualisiert */
.amhc-close-button:focus {
    color: var(--wp--preset--color--light, white); /* Annahme für Textfarbe */
    text-decoration: none;
}

.amhc-concierge-dialog h3 { /* Klasse aktualisiert */
    color: var(--wp--preset--color--typography, #333);
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.amhc-question-block { /* Klasse aktualisiert */
    display: none; /* Hidden by default */
    text-align: center;
}

.amhc-question-block.active { /* Klasse aktualisiert */
    display: block; /* Only active question is shown */
}

.amhc-question-text { /* Klasse aktualisiert */
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: bold;
    color: var(--wp--preset--color--typography, #333);
}

.amhc-answers { /* Klasse aktualisiert */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.amhc-answer-btn { /* Klasse aktualisiert */
    background-color: var(--wp--preset--color--light, #f0f0f0);
    color: var(--wp--preset--color--typography, #333);
    padding: 12px 20px;
    border: 1px solid var(--wp--preset--color--contrast-2, #ddd); /* Wiederverwendung oder spezifischere Variable, falls vom Theme bereitgestellt */
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    text-align: center;
}

.amhc-answer-btn:hover { /* Klasse aktualisiert */
    background-color: var(--wp--preset--color--dark, #e0e0e0);
    color: var(--wp--preset--color--light, #ccc); /* Annahme für Hover-Rand */
}

#amhc-loading { /* ID aktualisiert */
    text-align: center;
    padding: 20px;
    font-style: italic;
    color: var(--wp--preset--color--typography, #666);
    opacity: 0.7;
}

#amhc-guide-output { /* ID aktualisiert */
    padding-top: 20px;
    border-top: 1px solid var(--wp--preset--color--contrast, #eee); /* Annahme für einen sehr leichten Rand */
    margin-top: 20px;
    color: var(--wp--preset--color--typography, #333);
}

#amhc-guide-output h4 { /* ID aktualisiert */
    margin-bottom: 15px;
    font-size: 20px;
    color: var(--wp--preset--color--primary, #0073aa); /* Oder --wp--preset--color--link, je nach Design-Absicht */
}

#amhc-guide-output ul { /* ID aktualisiert */
    list-style: none;
    padding: 0;
    margin: 0;
}

#amhc-guide-output li { /* ID aktualisiert */
    margin-bottom: 10px;
}

#amhc-guide-output a { /* ID aktualisiert */
    color: var(--wp--preset--color--link, #0073aa);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

#amhc-guide-output a:hover { /* ID aktualisiert */
    color: var(--wp--preset--color--link-hover, #005177);
    text-decoration: underline;
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    .amhc-popup-content { /* Klasse aktualisiert */
        width: 95%;
        padding: 20px;
    }

    /* Anpassung für den Floating Button auf kleinen Bildschirmen */
    .amhc-cta-floating .amhc-cta-icon-symbol {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .amhc-cta-floating:hover .amhc-cta-text-content,
    .amhc-cta-floating:focus-within .amhc-cta-text-content {
        max-width: 180px; /* Kürzere Textbreite auf Mobilgeräten */
        padding-left: 15px;
    }
    /* Ggf. Styles für den nicht-floatenden Button auf Mobilgeräten, falls noch relevant */
    .amhc-concierge-cta:not(.amhc-cta-floating) {
        /* padding: 8px 12px; */
        /* font-size: 14px; */
    }
}
