/* Lite Plugin Frontend Styles */
.aips-lite-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.aips-summarize-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.aips-summarize-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.aips-lite-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    background-color: #10a37f;
    /* ChatGPT Emerald */
    box-shadow: 0 4px 12px rgba(16, 163, 127, 0.15);
    line-height: 1;
    font-family: inherit;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.aips-lite-btn:hover {
    background-color: #0d8a6c;
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(16, 163, 127, 0.25);
    color: #fff;
}

.aips-lite-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 163, 127, 0.2);
}

/* Style variations */
.aips-style-pill .aips-lite-btn {
    border-radius: 100px;
}

.aips-style-rounded .aips-lite-btn {
    border-radius: 8px;
}

.aips-style-square .aips-lite-btn {
    border-radius: 4px;
}

/* Text Sizes (Now auto-follows Button Size) */
.aips-text-small .aips-summarize-label {
    font-size: 14px;
    letter-spacing: 0.01em;
}

.aips-text-medium .aips-summarize-label {
    font-size: 18px;
    letter-spacing: 0.01em;
    font-weight: 600;
}

.aips-text-medium .aips-summarize-wrapper {
    gap: 15px;
}

.aips-text-large .aips-summarize-label {
    font-size: 22px;
    letter-spacing: 0.01em;
    font-weight: 700;
}

.aips-text-large .aips-summarize-wrapper {
    gap: 20px;
}

/* Button Sizes */
.aips-btn-size-small .aips-lite-btn {
    padding: 8px 16px;
    font-size: 14px;
}

.aips-btn-size-medium .aips-lite-btn {
    padding: 10px 20px;
    font-size: 16px;
}

.aips-btn-size-large .aips-lite-btn {
    padding: 12px 24px;
    font-size: 18px;
}

/* Platform Icons */
.aips-icon-chatgpt,
.aips-icon-googleai {
    width: 18px;
    height: 18px;
    display: inline-block;
    flex-shrink: 0;
}

.aips-btn-size-small .aips-icon-chatgpt,
.aips-btn-size-small .aips-icon-googleai {
    width: 16px;
    height: 16px;
}

.aips-btn-size-large .aips-icon-chatgpt,
.aips-btn-size-large .aips-icon-googleai {
    width: 20px;
    height: 20px;
}

.aips-icon-chatgpt svg,
.aips-icon-googleai svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Google AI Button */
.aips-btn-googleai {
    background-color: #1A73E8;
}
.aips-btn-googleai:hover {
    background-color: #1557b0;
    color: #ffffff !important;
}
/* Loading state */
.aips-lite-btn.aips-loading {
    opacity: 0.8;
    cursor: wait;
}

.aips-lite-btn.aips-loading .aips-icon-chatgpt {
    display: none;
}

.aips-lite-btn.aips-loading::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: aips-spin 1s ease-in-out infinite;
    margin-right: 6px;
}

@keyframes aips-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Summary result */
.aips-summary-result {
    margin-top: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #10a37f;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .aips-lite-container {
        margin: 16px 0;
    }

    .aips-summarize-wrapper {
        gap: 8px;
    }

    .aips-lite-btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .aips-summary-result {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 600px) {
    .aips-summarize-wrapper {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .aips-summarize-label {
        font-size: 13px;
    }

    .aips-lite-btn {
        width: auto;
        display: inline-flex;
        padding: 8px 14px;
        font-size: 14px;
    }

    .aips-icon-chatgpt {
        width: 18px;
        height: 18px;
    }

    .aips-summary-result {
        margin-top: 12px;
        padding: 12px;
        font-size: 14px;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .aips-lite-container {
        margin: 12px 0;
    }

    .aips-lite-btn {
        padding: 8px 12px;
        font-size: 14px;
        gap: 6px;
    }

    .aips-icon-chatgpt {
        width: 16px;
        height: 16px;
    }

    .aips-summary-result {
        padding: 14px;
        font-size: 15px;
        line-height: 1.7;
    }
}

/* --- Floating Widget Styles (Premium Gradient Redesign) --- */
.aips-floating-widget {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(30px);
}

.aips-floating-widget.bottom-right {
    bottom: 40px;
    right: 40px;
    align-items: flex-end;
}

.aips-floating-widget.bottom-left {
    bottom: 40px;
    left: 40px;
    align-items: flex-start;
}

.aips-floating-widget.aips-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Main Floating Button with Blue Gradient and Pulse */
.aips-floating-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7em 1.5em;
    background-image: linear-gradient(30deg, #0400ff, #4ce3f7);
    background-size: 100% auto;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(4, 0, 255, 0.2);
    cursor: pointer;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    transition: all 0.4s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

.aips-floating-btn:hover {
    background-position: right center;
    background-size: 200% auto;
    transform: translateY(-3px);
    animation: pulse512 1.5s infinite;
}

@keyframes pulse512 {
    0% {
        box-shadow: 0 0 0 0 rgba(5, 186, 218, 0.3);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(218, 103, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(218, 103, 68, 0);
    }
}

.aips-main-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Platforms Panel (Modern Popover) */
.aips-floating-platforms {
    display: flex;
    flex-direction: column;
    width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 24px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    transform-origin: bottom right;
}

.bottom-left .aips-floating-platforms {
    transform-origin: bottom left;
}

.aips-floating-platforms.aips-open {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.aips-platform-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 18px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.aips-platform-option:hover {
    background-color: #f8fafc;
}

.aips-floating-platforms .aips-btn-chatgpt:hover {
    color: #10a37f !important;
}

.aips-floating-platforms .aips-btn-googleai:hover {
    color: #4285f4 !important;
}

.aips-platform-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.aips-platform-option:hover .aips-platform-icon {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
}

.aips-platform-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.aips-btn-chatgpt .aips-platform-icon {
    color: #10a37f;
    border: 1px solid rgba(16, 163, 127, 0.1);
}

.aips-btn-googleai .aips-platform-icon {
    color: #4285f4;
    border: 1px solid rgba(66, 133, 244, 0.1);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .aips-floating-widget {
        bottom: 25px;
        right: 25px;
    }

    .aips-floating-widget.bottom-left {
        left: 25px;
    }

    .aips-btn-text {
        display: none;
    }

    .aips-floating-btn {
        padding: 16px;
        border-radius: 50%;
    }

    .aips-floating-platforms {
        width: 200px;
    }
}