/**
 * AICommerce Iframe Styles
 */

.aicommerce-iframe-wrapper {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
}

.aicommerce-iframe-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    padding: 0;
}

.aicommerce-iframe-button--with-label {
    width: auto;
    border-radius: 30px;
    padding: 0 20px 0 16px;
    gap: 10px;
}

.aicommerce-iframe-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.aicommerce-iframe-button:active {
    transform: scale(0.95);
}

.aicommerce-iframe-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.aicommerce-iframe-icon svg {
    width: 26px;
    height: 26px;
    color: #ffffff;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.aicommerce-iframe-button:hover .aicommerce-iframe-icon svg {
    transform: scale(1.15) rotate(15deg);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.aicommerce-iframe-button:active .aicommerce-iframe-icon svg {
    transform: scale(1.05) rotate(5deg);
}

.aicommerce-iframe-label {
    color: #ffffff;
    font-size: 18px;
    font-weight: 400;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.aicommerce-iframe-position-top-left {
    top: 20px;
    left: 20px;
}

.aicommerce-iframe-position-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.aicommerce-iframe-position-top-center .aicommerce-iframe-button:hover {
    transform: scale(1.1);
}

.aicommerce-iframe-position-top-right {
    top: 20px;
    right: 20px;
}

.aicommerce-iframe-position-middle-left {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
}

.aicommerce-iframe-position-middle-left .aicommerce-iframe-button:hover {
    transform: scale(1.1);
}

.aicommerce-iframe-position-middle-right {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.aicommerce-iframe-position-middle-right .aicommerce-iframe-button:hover {
    transform: scale(1.1);
}

.aicommerce-iframe-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.aicommerce-iframe-position-bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.aicommerce-iframe-position-bottom-center .aicommerce-iframe-button:hover {
    transform: scale(1.1);
}

.aicommerce-iframe-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.aicommerce-iframe-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aicommerce-iframe-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.aicommerce-iframe-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1;
}

/* Iframe container must have explicit size for iframe height:100% */
#aicommerce-iframe-container {
    width: 100%;
    height: 100%;
    display: block;
}

.aicommerce-iframe-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.aicommerce-iframe-close:hover {
    transform: rotate(90deg);
}

#aicommerce-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Placeholder when URL is not set */
.aicommerce-iframe-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: #64748b;
}

.aicommerce-iframe-placeholder p {
    margin: 0;
    font-size: 16px;
}

@media (max-width: 768px) {
    .aicommerce-iframe-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .aicommerce-iframe-button--with-label {
        width: auto;
        height: 50px;
        max-width: calc(100vw - 30px);
        border-radius: 25px;
        padding: 0 16px 0 14px;
        gap: 8px;
    }

    .aicommerce-iframe-label {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 16px;
    }
    
    .aicommerce-iframe-position-top-left,
    .aicommerce-iframe-position-top-right,
    .aicommerce-iframe-position-bottom-left,
    .aicommerce-iframe-position-bottom-right {
        bottom: 15px;
        right: 15px;
        top: auto;
        left: auto;
    }
    
    .aicommerce-iframe-position-top-center,
    .aicommerce-iframe-position-bottom-center {
        bottom: 15px;
        right: 15px;
        top: auto;
        left: auto;
        transform: none;
    }
    
    .aicommerce-iframe-position-middle-left,
    .aicommerce-iframe-position-middle-right {
        bottom: 15px;
        right: 15px;
        top: auto;
        left: auto;
        transform: none;
    }
    
    .aicommerce-iframe-modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}
