#ai-chat-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#ai-chat-launcher {
    background: var(--wp--preset--color--primary, #0073aa);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#ai-chat-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#ai-chat-launcher .ai-label {
    font-weight: 600;
    font-size: 15px;
}

#ai-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#ai-chat-header {
    background: var(--wp--preset--color--primary, #0073aa);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.ai-title-wrap {
    display: flex;
    flex-direction: column;
}

.ai-title {
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
}

.ai-status {
    font-size: 12px;
    opacity: 0.8;
}

.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#ai-chat-download {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#ai-chat-download:hover {
    opacity: 1;
}

#ai-chat-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8f9fa;
}

.ai-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.ai-assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #212529;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ai-assistant a {
    color: var(--wp--preset--color--primary, #0073aa);
    text-decoration: underline;
    font-weight: 600;
}

.ai-assistant a:hover {
    text-decoration: none;
}

.ai-assistant ul, .ai-assistant ol {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-assistant li {
    margin-bottom: 6px;
}

.ai-assistant strong {
    font-weight: 700;
    color: #000;
}

.ai-quick-actions-bar {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-quick-btn {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 18px;
    padding: 6px 14px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.ai-quick-btn:hover {
    background: var(--wp--preset--color--primary, #0073aa);
    color: #ffffff;
    border-color: var(--wp--preset--color--primary, #0073aa);
}

.ai-quick-btn svg {
    opacity: 0.7;
}

.ai-quick-btn:hover svg {
    opacity: 1;
}

.ai-user {
    align-self: flex-end;
    background: var(--wp--preset--color--primary, #0073aa);
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

#ai-chat-footer {
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #eee;
}

.ai-input-container {
    background: #f1f3f5;
    border-radius: 24px;
    padding: 8px 16px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

#ai-chat-input {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 14px;
    max-height: 100px;
    resize: none;
    outline: none;
    color: #495057;
}

.ai-action-buttons {
    display: flex;
    gap: 4px;
    padding-bottom: 4px;
}

.ai-action-buttons button {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.ai-action-buttons button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--wp--preset--color--primary, #0073aa);
}

#ai-chat-send {
    color: var(--wp--preset--color--primary, #0073aa) !important;
}

.ai-typing {
    font-style: italic;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

/* Scrollbar styling */
#ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}
#ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
#ai-chat-messages::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 10px;
}

#ai-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999999;
    display: none; /* Toggled by JS */
    align-items: center;
    justify-content: center;
}

.ai-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

.ai-modal-content video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

@media (max-width: 480px) {
    #ai-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 70px;
    }
    .ai-modal-content {
        width: 95%;
    }
}
