/* Hoyry Bot Contact Plugin Styles - Touhula Design */

header:has(.wp-block-navigation__responsive-container.is-menu-open){
    z-index: 100001;
}

#hoyry-bot-contact-container {
    position: fixed;
    bottom: clamp(0.625rem, 0.452rem + 0.709vw, 1.25rem);
    right: clamp(0.625rem, 0.452rem + 0.709vw, 1.25rem);
    z-index: 100000;
}

/* Floating Button Styles */
#hoyry-bot-contact-button {
    background: #282F65;
    color: white;
    border: none;
    border-radius: 40px;
    height: clamp(3.25rem, 2.852rem + 1.631vw, 4.688rem);
    padding: clamp(0.25rem, 0.198rem + 0.213vw, 0.438rem) clamp(2.5rem, 2.293rem + 0.851vw, 3.25rem) clamp(0.25rem, 0.198rem + 0.213vw, 0.438rem) clamp(0.25rem, 0.198rem + 0.213vw, 0.438rem); 
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease; 
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    font-size: clamp(0.875rem, 0.789rem + 0.355vw, 1.188rem);
    font-weight: 700;
    line-height: 1.2;
    color: white;
}
 
#hoyry-bot-contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
}

#hoyry-bot-contact-button:active {
    transform: translateY(0);
}

.hoyry-bot-contact-profile-img {
    height: 100%;
    aspect-ratio: 1/1;
    border-radius: 50%;
    object-fit: cover;
    width: auto;
}

.hoyry-bot-contact-button-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    gap: 1px;
}

.hoyry-bot-contact-title {
    font-size: clamp(0.563rem, 0.511rem + 0.213vw, 0.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: #B5B8DB;
}

/* Button when dialog is open - show only Close text and cross */
#hoyry-bot-contact-button.is-open {
    padding-left: clamp(1rem, 0.844rem + 0.638vw, 1.563rem);
    padding-right: clamp(1rem, 0.844rem + 0.638vw, 1.563rem);
}

#hoyry-bot-contact-button.is-open .hoyry-bot-contact-profile-img {
    display: none;
}

#hoyry-bot-contact-button.is-open .hoyry-bot-contact-button-content {
    display: none;
}

/* Show close text and cross when open */
#hoyry-bot-contact-button.is-open {
    gap: clamp(0.375rem, 0.219rem + 0.638vw, 0.938rem);
}
#hoyry-bot-contact-button.is-open::before {
    content: attr(data-close-text);
    display: block;
    opacity: 1;
    transition: all 0.3s ease;
    animation: fadeInClose 0.3s ease forwards;
}

#hoyry-bot-contact-button.is-open::after {
    content: '';
    background-image: url("./close.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: clamp(0.938rem, 0.816rem + 0.496vw, 1.375rem);
    height: clamp(0.938rem, 0.816rem + 0.496vw, 1.375rem);
    flex-shrink: 0;
    display: block;
    opacity: 1;
    transition: all 0.3s ease;
    animation: fadeInClose 0.3s ease forwards;
}

@keyframes fadeInClose {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Dialog Styles */
.hoyry-bot-contact-dialog {
    position: absolute;
    bottom: clamp(3.688rem, 3.221rem + 1.915vw, 5.375rem);
    right: 0;
    width: clamp(21.688rem, 20.581rem + 4.539vw, 25.688rem);
    max-width: 89vw;
    background: white;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.10);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 10000;
    border-radius: 16px;
}

.hoyry-bot-contact-dialog.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.hoyry-bot-contact-dialog-content {
    position: relative;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    background-color: white;
}

/* Dialog Header */
.hoyry-bot-contact-dialog-header {
    height: clamp(3rem, 2.879rem + 0.496vw, 3.438rem);
    padding-right: clamp(1rem, 0.931rem + 0.284vw, 1.25rem);
    padding-left: clamp(0.938rem, 0.868rem + 0.284vw, 1.188rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    border-bottom: 1px solid #EBEBEB;
}

.hoyry-bot-contact-logo {
    height: clamp(2rem, 1.862rem + 0.567vw, 2.5rem);
    width: auto;
}

.hoyry-bot-contact-close {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 16px;
    height: 16px;
}
.hoyry-bot-contact-close img {
    display: block;
    width: 100%;
    height: auto;
}

.hoyry-bot-contact-dialog-content-inner {
    max-height: clamp(30rem, 28.306rem + 6.95vw, 36.125rem);
    overflow-y: auto;
}

.hoyry-bot-contact-dialog-cover-image{
    height: clamp(12.5rem, 11.705rem + 3.262vw, 15.375rem);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    overflow: hidden;
}

.hoyry-bot-contact-dialog-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dialog Body */
.hoyry-bot-contact-dialog-body {
    padding: 1.1em clamp(1.563rem, 1.476rem + 0.355vw, 1.875rem) clamp(1.563rem, 1.476rem + 0.355vw, 1.875rem) clamp(1.563rem, 1.476rem + 0.355vw, 1.875rem);
    color: #27274b;
}

.hoyry-bot-contact-dialog-body *:last-child {
    margin-bottom: 0 !important;
}

.hoyry-bot-contact-dialog-body h2 {
    font-size: clamp(1rem, 0.931rem + 0.284vw, 1.25rem);
    letter-spacing: -0.005em; 
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.8em 0;
}

.hoyry-bot-contact-dialog-body h3 {
    font-size: clamp(0.75rem, 0.715rem + 0.142vw, 0.875rem);
    letter-spacing: 0.01em; 
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0 0 0.6em 0;
}

.hoyry-bot-contact-dialog-body h4 {
    font-size: clamp(0.75rem, 0.715rem + 0.142vw, 0.875rem);
    letter-spacing: -0.01em; 
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.35em 0;
}

.hoyry-bot-contact-dialog-body p {
    font-size: clamp(0.75rem, 0.733rem + 0.071vw, 0.813rem);
    letter-spacing: -0.01em; 
    line-height: 1.38;
    margin: 0;
}

.hoyry-bot-contact-dialog-links{
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 1.1em;
}

.hoyry-bot-contact-dialog-link{
    font-family: var(--wp--preset--font-family--degular);
    font-size: clamp(0.813rem, 0.761rem + 0.213vw, 1rem);
    letter-spacing: 0; 
    font-weight: 600;
    line-height: 1.2;
    display: block;
    border: 1px solid #E2E5E9;
    border-radius: 21px;
    padding: 0.7em 1.4em;
    text-align: center;
    color: #222;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.hoyry-bot-contact-dialog-link:hover,
.hoyry-bot-contact-dialog-link:focus{
    background-color: var(--wp--preset--color--custom-tummansininen);
    border-color: var(--wp--preset--color--custom-tummansininen);
    color: white;
}

.hoyry-bot-contact-dialog-faq{
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    margin-bottom: 0.5em;
}

.hoyry-bot-contact-dialog-faq-item{
    border: 1px solid #D1D1D1;
    border-radius: 8px;
    padding: 0.6em 0.85em;
}

.hoyry-bot-contact-dialog-button{
    font-family: var(--wp--preset--font-family--degular);
    font-size: clamp(0.813rem, 0.761rem + 0.213vw, 1rem);
    letter-spacing: 0; 
    font-weight: 600;
    line-height: 1.2;
    display: block;
    border-radius: 100px;
    padding: 1em 2em;
    text-align: center;
    border: 1px solid var(--wp--preset--color--custom-tummansininen);
    color: #222;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.hoyry-bot-contact-dialog-button:hover, 
.hoyry-bot-contact-dialog-button:focus{
    background-color: var(--wp--preset--color--custom-tummansininen);
    border-color: var(--wp--preset--color--custom-tummansininen);
    color: white;
}

/* Animation for smooth transitions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hoyry-bot-contact-dialog.is-opening {
    animation: fadeInUp 0.3s ease forwards;
}
